From 07990acaa6934d8aad08d978412afbd47367b246 Mon Sep 17 00:00:00 2001 From: John Safranek Date: Wed, 9 May 2012 16:40:36 -0700 Subject: [PATCH] fixed off-by-one bug when encoding serial number as ASN.1 --- ctaocrypt/src/asn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ctaocrypt/src/asn.c b/ctaocrypt/src/asn.c index 80f285689..0af015174 100644 --- a/ctaocrypt/src/asn.c +++ b/ctaocrypt/src/asn.c @@ -4119,7 +4119,7 @@ static int SetSerialNumber(const byte* sn, word32 snSz, byte* output) if (snSz <= EXTERNAL_SERIAL_SIZE) { output[0] = ASN_INTEGER; - output[1] = snSz; + output[1] = snSz + 1; output[2] = 0; XMEMCPY(&output[3], sn, snSz); result = snSz + 3;