mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-03 20:54:41 +02:00
fixed off-by-one bug when encoding serial number as ASN.1
This commit is contained in:
@@ -4119,7 +4119,7 @@ static int SetSerialNumber(const byte* sn, word32 snSz, byte* output)
|
|||||||
|
|
||||||
if (snSz <= EXTERNAL_SERIAL_SIZE) {
|
if (snSz <= EXTERNAL_SERIAL_SIZE) {
|
||||||
output[0] = ASN_INTEGER;
|
output[0] = ASN_INTEGER;
|
||||||
output[1] = snSz;
|
output[1] = snSz + 1;
|
||||||
output[2] = 0;
|
output[2] = 0;
|
||||||
XMEMCPY(&output[3], sn, snSz);
|
XMEMCPY(&output[3], sn, snSz);
|
||||||
result = snSz + 3;
|
result = snSz + 3;
|
||||||
|
Reference in New Issue
Block a user