diff options
author | jkim <jkim@FreeBSD.org> | 2016-03-01 22:08:28 +0000 |
---|---|---|
committer | jkim <jkim@FreeBSD.org> | 2016-03-01 22:08:28 +0000 |
commit | de2249f81ccf8ad3eac972b7558a16a3bab99325 (patch) | |
tree | dd0f91775301f47811f2b56ba60043ebdf64aea9 /crypto/openssl/crypto/bn/bn.h | |
parent | 0e774f6016f1dfb6a8f55462cc815c3b4da580b2 (diff) | |
parent | 72d32bf80dfdcfe0e69da200b66f195e919653f7 (diff) | |
download | FreeBSD-src-de2249f81ccf8ad3eac972b7558a16a3bab99325.zip FreeBSD-src-de2249f81ccf8ad3eac972b7558a16a3bab99325.tar.gz |
Merge OpenSSL 1.0.2g.
Relnotes: yes
Diffstat (limited to 'crypto/openssl/crypto/bn/bn.h')
-rw-r--r-- | crypto/openssl/crypto/bn/bn.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/crypto/openssl/crypto/bn/bn.h b/crypto/openssl/crypto/bn/bn.h index 5696965..86264ae 100644 --- a/crypto/openssl/crypto/bn/bn.h +++ b/crypto/openssl/crypto/bn/bn.h @@ -125,6 +125,7 @@ #ifndef HEADER_BN_H # define HEADER_BN_H +# include <limits.h> # include <openssl/e_os2.h> # ifndef OPENSSL_NO_FP_API # include <stdio.h> /* FILE */ @@ -721,8 +722,17 @@ const BIGNUM *BN_get0_nist_prime_521(void); /* library internal functions */ -# define bn_expand(a,bits) ((((((bits+BN_BITS2-1))/BN_BITS2)) <= (a)->dmax)?\ - (a):bn_expand2((a),(bits+BN_BITS2-1)/BN_BITS2)) +# define bn_expand(a,bits) \ + ( \ + bits > (INT_MAX - BN_BITS2 + 1) ? \ + NULL \ + : \ + (((bits+BN_BITS2-1)/BN_BITS2) <= (a)->dmax) ? \ + (a) \ + : \ + bn_expand2((a),(bits+BN_BITS2-1)/BN_BITS2) \ + ) + # define bn_wexpand(a,words) (((words) <= (a)->dmax)?(a):bn_expand2((a),(words))) BIGNUM *bn_expand2(BIGNUM *a, int words); # ifndef OPENSSL_NO_DEPRECATED |