|
@@ -21,7 +21,7 @@
|
|
|
/**
|
|
|
Store a BIT STRING
|
|
|
@param in The array of bits to store (8 per char)
|
|
|
- @param inlen The number of bits tostore
|
|
|
+ @param inlen The number of bits to store
|
|
|
@param out [out] The destination for the DER encoded BIT STRING
|
|
|
@param outlen [in/out] The max size and resulting size of the DER BIT STRING
|
|
|
@return CRYPT_OK if successful
|
|
@@ -68,11 +68,11 @@ int der_encode_raw_bit_string(const unsigned char *in, unsigned long inlen,
|
|
|
|
|
|
/* store the bits in big endian format */
|
|
|
for (y = buf = 0; y < inlen; y++) {
|
|
|
- buf |= (getbit(in[y/8],7-y%8)?1:0) << (7 - (y & 7));
|
|
|
- if ((y & 7) == 7) {
|
|
|
- out[x++] = buf;
|
|
|
- buf = 0;
|
|
|
- }
|
|
|
+ buf |= (getbit(in[y/8],7-y%8)?1:0) << (7 - (y & 7));
|
|
|
+ if ((y & 7) == 7) {
|
|
|
+ out[x++] = buf;
|
|
|
+ buf = 0;
|
|
|
+ }
|
|
|
}
|
|
|
/* store last byte */
|
|
|
if (inlen & 7) {
|