hcrypto: fix off-by-one set-bit counting
This commit is contained in:
@@ -305,7 +305,7 @@ DH_check_pubkey(const DH *dh, const BIGNUM *pub_key, int *codes)
|
||||
unsigned i, n = BN_num_bits(pub_key);
|
||||
unsigned bits = 0;
|
||||
|
||||
for (i = 0; i <= n; i++)
|
||||
for (i = 0; i < n; i++)
|
||||
if (BN_is_bit_set(pub_key, i))
|
||||
bits++;
|
||||
|
||||
|
Reference in New Issue
Block a user