summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libssl/s3_clnt.c13
-rw-r--r--src/lib/libssl/src/ssl/s3_clnt.c13
2 files changed, 24 insertions, 2 deletions
diff --git a/src/lib/libssl/s3_clnt.c b/src/lib/libssl/s3_clnt.c
index 9b52691015..d68aecf541 100644
--- a/src/lib/libssl/s3_clnt.c
+++ b/src/lib/libssl/s3_clnt.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: s3_clnt.c,v 1.107 2015/02/07 05:46:01 jsing Exp $ */ 1/* $OpenBSD: s3_clnt.c,v 1.108 2015/03/08 16:48:47 miod Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -1268,6 +1268,17 @@ ssl3_get_key_exchange(SSL *s)
1268 p += i; 1268 p += i;
1269 n -= param_len; 1269 n -= param_len;
1270 1270
1271 /*
1272 * Check the strength of the DH key just constructed.
1273 * Discard keys weaker than 1024 bits.
1274 */
1275
1276 if (DH_size(dh) < 1024 / 8) {
1277 SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE,
1278 SSL_R_BAD_DH_P_LENGTH);
1279 goto err;
1280 }
1281
1271 if (alg_a & SSL_aRSA) 1282 if (alg_a & SSL_aRSA)
1272 pkey = X509_get_pubkey( 1283 pkey = X509_get_pubkey(
1273 s->session->sess_cert->peer_pkeys[ 1284 s->session->sess_cert->peer_pkeys[
diff --git a/src/lib/libssl/src/ssl/s3_clnt.c b/src/lib/libssl/src/ssl/s3_clnt.c
index 9b52691015..d68aecf541 100644
--- a/src/lib/libssl/src/ssl/s3_clnt.c
+++ b/src/lib/libssl/src/ssl/s3_clnt.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: s3_clnt.c,v 1.107 2015/02/07 05:46:01 jsing Exp $ */ 1/* $OpenBSD: s3_clnt.c,v 1.108 2015/03/08 16:48:47 miod Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -1268,6 +1268,17 @@ ssl3_get_key_exchange(SSL *s)
1268 p += i; 1268 p += i;
1269 n -= param_len; 1269 n -= param_len;
1270 1270
1271 /*
1272 * Check the strength of the DH key just constructed.
1273 * Discard keys weaker than 1024 bits.
1274 */
1275
1276 if (DH_size(dh) < 1024 / 8) {
1277 SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE,
1278 SSL_R_BAD_DH_P_LENGTH);
1279 goto err;
1280 }
1281
1271 if (alg_a & SSL_aRSA) 1282 if (alg_a & SSL_aRSA)
1272 pkey = X509_get_pubkey( 1283 pkey = X509_get_pubkey(
1273 s->session->sess_cert->peer_pkeys[ 1284 s->session->sess_cert->peer_pkeys[