summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/dh/dh_key.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/dh/dh_key.c')
-rw-r--r--src/lib/libcrypto/dh/dh_key.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/lib/libcrypto/dh/dh_key.c b/src/lib/libcrypto/dh/dh_key.c
index e3641ec468..74de589204 100644
--- a/src/lib/libcrypto/dh/dh_key.c
+++ b/src/lib/libcrypto/dh/dh_key.c
@@ -181,6 +181,12 @@ static int compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh)
181 int ret= -1; 181 int ret= -1;
182 int check_result; 182 int check_result;
183 183
184 if (BN_num_bits(dh->p) > OPENSSL_DH_MAX_MODULUS_BITS)
185 {
186 DHerr(DH_F_DH_COMPUTE_KEY,DH_R_MODULUS_TOO_LARGE);
187 return -1;
188 }
189
184 ctx = BN_CTX_new(); 190 ctx = BN_CTX_new();
185 if (ctx == NULL) goto err; 191 if (ctx == NULL) goto err;
186 BN_CTX_start(ctx); 192 BN_CTX_start(ctx);