summaryrefslogtreecommitdiff
path: root/src/lib/libssl/s3_srvr.c
diff options
context:
space:
mode:
authorguenther <>2014-07-28 04:23:12 +0000
committerguenther <>2014-07-28 04:23:12 +0000
commit224cc55e7b0aa21110d14dd564e88e13893a294e (patch)
tree51d2af22ad1dd980f4ce9c87fa7c5ea39efd7be6 /src/lib/libssl/s3_srvr.c
parent23872c177fa5acf651189cdfcafd44e94da780ef (diff)
downloadopenbsd-224cc55e7b0aa21110d14dd564e88e13893a294e.tar.gz
openbsd-224cc55e7b0aa21110d14dd564e88e13893a294e.tar.bz2
openbsd-224cc55e7b0aa21110d14dd564e88e13893a294e.zip
The RSA, DH, and ECDH temporary key callbacks expect the number of keybits
for the key (expressed in RSA key bits, which makes *no sense* for ECDH) as their second argument, not zero. (jsing@ notes that the RSA callback is only invoked for 'export' ciphers, which have been removed from LibreSSL, and for the SSL_OP_EPHEMERAL_RSA option, which is makes the application non-compliant. More fuel for the tedu fire...) jasper@ noted the breakage and bisected it down to the diff that broke this ok jsing@ miod@
Diffstat (limited to 'src/lib/libssl/s3_srvr.c')
-rw-r--r--src/lib/libssl/s3_srvr.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/lib/libssl/s3_srvr.c b/src/lib/libssl/s3_srvr.c
index 8d47a16b55..ed2aaf19b5 100644
--- a/src/lib/libssl/s3_srvr.c
+++ b/src/lib/libssl/s3_srvr.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: s3_srvr.c,v 1.78 2014/07/12 22:33:39 jsing Exp $ */ 1/* $OpenBSD: s3_srvr.c,v 1.79 2014/07/28 04:23:12 guenther 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 *
@@ -1395,7 +1395,8 @@ ssl3_send_server_key_exchange(SSL *s)
1395 if (type & SSL_kRSA) { 1395 if (type & SSL_kRSA) {
1396 rsa = cert->rsa_tmp; 1396 rsa = cert->rsa_tmp;
1397 if ((rsa == NULL) && (s->cert->rsa_tmp_cb != NULL)) { 1397 if ((rsa == NULL) && (s->cert->rsa_tmp_cb != NULL)) {
1398 rsa = s->cert->rsa_tmp_cb(s, 0, 0); 1398 rsa = s->cert->rsa_tmp_cb(s, 0,
1399 SSL_C_PKEYLENGTH(s->s3->tmp.new_cipher));
1399 if (rsa == NULL) { 1400 if (rsa == NULL) {
1400 al = SSL_AD_HANDSHAKE_FAILURE; 1401 al = SSL_AD_HANDSHAKE_FAILURE;
1401 SSLerr( 1402 SSLerr(
@@ -1419,7 +1420,8 @@ ssl3_send_server_key_exchange(SSL *s)
1419 if (type & SSL_kDHE) { 1420 if (type & SSL_kDHE) {
1420 dhp = cert->dh_tmp; 1421 dhp = cert->dh_tmp;
1421 if ((dhp == NULL) && (s->cert->dh_tmp_cb != NULL)) 1422 if ((dhp == NULL) && (s->cert->dh_tmp_cb != NULL))
1422 dhp = s->cert->dh_tmp_cb(s, 0, 0); 1423 dhp = s->cert->dh_tmp_cb(s, 0,
1424 SSL_C_PKEYLENGTH(s->s3->tmp.new_cipher));
1423 if (dhp == NULL) { 1425 if (dhp == NULL) {
1424 al = SSL_AD_HANDSHAKE_FAILURE; 1426 al = SSL_AD_HANDSHAKE_FAILURE;
1425 SSLerr(SSL_F_SSL3_SEND_SERVER_KEY_EXCHANGE, 1427 SSLerr(SSL_F_SSL3_SEND_SERVER_KEY_EXCHANGE,
@@ -1468,7 +1470,8 @@ ssl3_send_server_key_exchange(SSL *s)
1468 1470
1469 ecdhp = cert->ecdh_tmp; 1471 ecdhp = cert->ecdh_tmp;
1470 if (ecdhp == NULL && s->cert->ecdh_tmp_cb != NULL) 1472 if (ecdhp == NULL && s->cert->ecdh_tmp_cb != NULL)
1471 ecdhp = s->cert->ecdh_tmp_cb(s, 0, 0); 1473 ecdhp = s->cert->ecdh_tmp_cb(s, 0,
1474 SSL_C_PKEYLENGTH(s->s3->tmp.new_cipher));
1472 if (ecdhp == NULL) { 1475 if (ecdhp == NULL) {
1473 al = SSL_AD_HANDSHAKE_FAILURE; 1476 al = SSL_AD_HANDSHAKE_FAILURE;
1474 SSLerr(SSL_F_SSL3_SEND_SERVER_KEY_EXCHANGE, 1477 SSLerr(SSL_F_SSL3_SEND_SERVER_KEY_EXCHANGE,