mirror of
https://github.com/openssl/openssl.git
synced 2025-01-18 13:44:20 +08:00
BN_set_bit() etc should use "unsigned int".
Keep it as is to avoid an API change, but check for negativ values. Submitted by: Nils Larsch
This commit is contained in:
parent
d2cd46127c
commit
1a01733047
@ -782,6 +782,9 @@ int BN_set_bit(BIGNUM *a, int n)
|
||||
{
|
||||
int i,j,k;
|
||||
|
||||
if (n < 0)
|
||||
return 0;
|
||||
|
||||
i=n/BN_BITS2;
|
||||
j=n%BN_BITS2;
|
||||
if (a->top <= i)
|
||||
@ -801,6 +804,9 @@ int BN_clear_bit(BIGNUM *a, int n)
|
||||
{
|
||||
int i,j;
|
||||
|
||||
if (n < 0)
|
||||
return 0;
|
||||
|
||||
i=n/BN_BITS2;
|
||||
j=n%BN_BITS2;
|
||||
if (a->top <= i) return(0);
|
||||
@ -825,6 +831,9 @@ int BN_mask_bits(BIGNUM *a, int n)
|
||||
{
|
||||
int b,w;
|
||||
|
||||
if (n < 0)
|
||||
return 0;
|
||||
|
||||
w=n/BN_BITS2;
|
||||
b=n%BN_BITS2;
|
||||
if (w >= a->top) return(0);
|
||||
|
Loading…
Reference in New Issue
Block a user