diff options
author | jsing <> | 2014-07-09 11:25:42 +0000 |
---|---|---|
committer | jsing <> | 2014-07-09 11:25:42 +0000 |
commit | c90a1a4bb021e5a2622323df8464bf574d0c4364 (patch) | |
tree | 604b9084e9f8d9e522922bc0cd6be5e22478e9ee /src/lib/libssl/s3_srvr.c | |
parent | 4afcbff6153d561348af47fa000f298df3693a3c (diff) | |
download | openbsd-c90a1a4bb021e5a2622323df8464bf574d0c4364.tar.gz openbsd-c90a1a4bb021e5a2622323df8464bf574d0c4364.tar.bz2 openbsd-c90a1a4bb021e5a2622323df8464bf574d0c4364.zip |
tedu the SSL export cipher handling - since we do not have enabled export
ciphers we no longer need the flags or code to support it.
ok beck@ miod@
Diffstat (limited to 'src/lib/libssl/s3_srvr.c')
-rw-r--r-- | src/lib/libssl/s3_srvr.c | 33 |
1 files changed, 6 insertions, 27 deletions
diff --git a/src/lib/libssl/s3_srvr.c b/src/lib/libssl/s3_srvr.c index a3387040a9..f24d0f9cf8 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.67 2014/06/30 14:13:27 tedu Exp $ */ | 1 | /* $OpenBSD: s3_srvr.c,v 1.68 2014/07/09 11:25:42 jsing 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 | * |
@@ -435,11 +435,7 @@ ssl3_accept(SSL *s) | |||
435 | || ((alg_k & SSL_kRSA) | 435 | || ((alg_k & SSL_kRSA) |
436 | && (s->cert->pkeys[SSL_PKEY_RSA_ENC].privatekey == | 436 | && (s->cert->pkeys[SSL_PKEY_RSA_ENC].privatekey == |
437 | NULL | 437 | NULL |
438 | || (SSL_C_IS_EXPORT(s->s3->tmp.new_cipher) | 438 | ))) { |
439 | && EVP_PKEY_size( | ||
440 | s->cert->pkeys[SSL_PKEY_RSA_ENC].privatekey) * 8 | ||
441 | > SSL_C_EXPORT_PKEYLENGTH(s->s3->tmp.new_cipher | ||
442 | ))))) { | ||
443 | ret = ssl3_send_server_key_exchange(s); | 439 | ret = ssl3_send_server_key_exchange(s); |
444 | if (ret <= 0) | 440 | if (ret <= 0) |
445 | goto end; | 441 | goto end; |
@@ -1296,8 +1292,6 @@ ssl3_get_client_hello(SSL *s) | |||
1296 | c = sk_SSL_CIPHER_value(sk, i); | 1292 | c = sk_SSL_CIPHER_value(sk, i); |
1297 | if (c->algorithm_enc & SSL_eNULL) | 1293 | if (c->algorithm_enc & SSL_eNULL) |
1298 | nc = c; | 1294 | nc = c; |
1299 | if (SSL_C_IS_EXPORT(c)) | ||
1300 | ec = c; | ||
1301 | } | 1295 | } |
1302 | if (nc != NULL) | 1296 | if (nc != NULL) |
1303 | s->s3->tmp.new_cipher = nc; | 1297 | s->s3->tmp.new_cipher = nc; |
@@ -1508,9 +1502,7 @@ ssl3_send_server_key_exchange(SSL *s) | |||
1508 | if (type & SSL_kRSA) { | 1502 | if (type & SSL_kRSA) { |
1509 | rsa = cert->rsa_tmp; | 1503 | rsa = cert->rsa_tmp; |
1510 | if ((rsa == NULL) && (s->cert->rsa_tmp_cb != NULL)) { | 1504 | if ((rsa == NULL) && (s->cert->rsa_tmp_cb != NULL)) { |
1511 | rsa = s->cert->rsa_tmp_cb(s, | 1505 | rsa = s->cert->rsa_tmp_cb(s, 0, 0); |
1512 | SSL_C_IS_EXPORT(s->s3->tmp.new_cipher), | ||
1513 | SSL_C_EXPORT_PKEYLENGTH(s->s3->tmp.new_cipher)); | ||
1514 | if (rsa == NULL) { | 1506 | if (rsa == NULL) { |
1515 | al = SSL_AD_HANDSHAKE_FAILURE; | 1507 | al = SSL_AD_HANDSHAKE_FAILURE; |
1516 | SSLerr( | 1508 | SSLerr( |
@@ -1534,9 +1526,7 @@ ssl3_send_server_key_exchange(SSL *s) | |||
1534 | if (type & SSL_kEDH) { | 1526 | if (type & SSL_kEDH) { |
1535 | dhp = cert->dh_tmp; | 1527 | dhp = cert->dh_tmp; |
1536 | if ((dhp == NULL) && (s->cert->dh_tmp_cb != NULL)) | 1528 | if ((dhp == NULL) && (s->cert->dh_tmp_cb != NULL)) |
1537 | dhp = s->cert->dh_tmp_cb(s, | 1529 | dhp = s->cert->dh_tmp_cb(s, 0, 0); |
1538 | SSL_C_IS_EXPORT(s->s3->tmp.new_cipher), | ||
1539 | SSL_C_EXPORT_PKEYLENGTH(s->s3->tmp.new_cipher)); | ||
1540 | if (dhp == NULL) { | 1530 | if (dhp == NULL) { |
1541 | al = SSL_AD_HANDSHAKE_FAILURE; | 1531 | al = SSL_AD_HANDSHAKE_FAILURE; |
1542 | SSLerr(SSL_F_SSL3_SEND_SERVER_KEY_EXCHANGE, | 1532 | SSLerr(SSL_F_SSL3_SEND_SERVER_KEY_EXCHANGE, |
@@ -1584,12 +1574,8 @@ ssl3_send_server_key_exchange(SSL *s) | |||
1584 | const EC_GROUP *group; | 1574 | const EC_GROUP *group; |
1585 | 1575 | ||
1586 | ecdhp = cert->ecdh_tmp; | 1576 | ecdhp = cert->ecdh_tmp; |
1587 | if ((ecdhp == NULL) && (s->cert->ecdh_tmp_cb != NULL)) { | 1577 | if (ecdhp == NULL && s->cert->ecdh_tmp_cb != NULL) |
1588 | ecdhp = s->cert->ecdh_tmp_cb( | 1578 | ecdhp = s->cert->ecdh_tmp_cb(s, 0, 0); |
1589 | s, SSL_C_IS_EXPORT(s->s3->tmp.new_cipher), | ||
1590 | SSL_C_EXPORT_PKEYLENGTH( | ||
1591 | s->s3->tmp.new_cipher)); | ||
1592 | } | ||
1593 | if (ecdhp == NULL) { | 1579 | if (ecdhp == NULL) { |
1594 | al = SSL_AD_HANDSHAKE_FAILURE; | 1580 | al = SSL_AD_HANDSHAKE_FAILURE; |
1595 | SSLerr(SSL_F_SSL3_SEND_SERVER_KEY_EXCHANGE, | 1581 | SSLerr(SSL_F_SSL3_SEND_SERVER_KEY_EXCHANGE, |
@@ -1634,13 +1620,6 @@ ssl3_send_server_key_exchange(SSL *s) | |||
1634 | goto err; | 1620 | goto err; |
1635 | } | 1621 | } |
1636 | 1622 | ||
1637 | if (SSL_C_IS_EXPORT(s->s3->tmp.new_cipher) && | ||
1638 | (EC_GROUP_get_degree(group) > 163)) { | ||
1639 | SSLerr(SSL_F_SSL3_SEND_SERVER_KEY_EXCHANGE, | ||
1640 | SSL_R_ECGROUP_TOO_LARGE_FOR_CIPHER); | ||
1641 | goto err; | ||
1642 | } | ||
1643 | |||
1644 | /* | 1623 | /* |
1645 | * XXX: For now, we only support ephemeral ECDH | 1624 | * XXX: For now, we only support ephemeral ECDH |
1646 | * keys over named (not generic) curves. For | 1625 | * keys over named (not generic) curves. For |