projects
/
oweals
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
PR: 2062
[oweals/openssl.git]
/
crypto
/
bn
/
bn_mpi.c
diff --git
a/crypto/bn/bn_mpi.c
b/crypto/bn/bn_mpi.c
index 53945c105717981d0330e0380400bc315f9bfb95..a054d21aed6b9a0cb04b384320ddd2fc6d6bfcbf 100644
(file)
--- a/
crypto/bn/bn_mpi.c
+++ b/
crypto/bn/bn_mpi.c
@@
-60,9
+60,7
@@
#include "cryptlib.h"
#include "bn_lcl.h"
#include "cryptlib.h"
#include "bn_lcl.h"
-int BN_bn2mpi(a,d)
-BIGNUM *a;
-unsigned char *d;
+int BN_bn2mpi(const BIGNUM *a, unsigned char *d)
{
int bits;
int num=0;
{
int bits;
int num=0;
@@
-90,10
+88,7
@@
unsigned char *d;
return(num+4+ext);
}
return(num+4+ext);
}
-BIGNUM *BN_mpi2bn(d,n,a)
-unsigned char *d;
-int n;
-BIGNUM *a;
+BIGNUM *BN_mpi2bn(const unsigned char *d, int n, BIGNUM *a)
{
long len;
int neg=0;
{
long len;
int neg=0;
@@
-103,7
+98,7
@@
BIGNUM *a;
BNerr(BN_F_BN_MPI2BN,BN_R_INVALID_LENGTH);
return(NULL);
}
BNerr(BN_F_BN_MPI2BN,BN_R_INVALID_LENGTH);
return(NULL);
}
- len=(
d[0]<<24)|(d[1]<<16)|(d[2]<<8)|
d[3];
+ len=(
(long)d[0]<<24)|((long)d[1]<<16)|((int)d[2]<<8)|(int)
d[3];
if ((len+4) != n)
{
BNerr(BN_F_BN_MPI2BN,BN_R_ENCODING_ERROR);
if ((len+4) != n)
{
BNerr(BN_F_BN_MPI2BN,BN_R_ENCODING_ERROR);
@@
-129,6
+124,7
@@
BIGNUM *a;
{
BN_clear_bit(a,BN_num_bits(a)-1);
}
{
BN_clear_bit(a,BN_num_bits(a)-1);
}
+ bn_check_top(a);
return(a);
}
return(a);
}