Fixes bug with creation of the KeyUsage BitString which was always adding the optional second byte reguardless of len, which created invalid ASN if value provided was less than 256. Bug was introduced with ASN refactor in commit fd9e41dd99.

This commit is contained in:
David Garske
2017-09-20 15:00:24 -07:00
parent 2f96f1ae9f
commit 3f493770d4

View File

@ -1060,7 +1060,8 @@ static word32 SetBitString16Bit(word16 val, byte* output)
idx = SetBitString(len, unusedBits, output);
output[idx++] = (byte)val;
output[idx++] = (byte)(val >> 8);
if (len > 1)
output[idx++] = (byte)(val >> 8);
return idx;
}