File tree Expand file tree Collapse file tree 4 files changed +21
-33
lines changed Expand file tree Collapse file tree 4 files changed +21
-33
lines changed Original file line number Diff line number Diff line change @@ -449,24 +449,15 @@ int dtls1_accept(SSL *s)
449
449
case SSL3_ST_SW_KEY_EXCH_B :
450
450
alg_k = s -> s3 -> tmp .new_cipher -> algorithm_mkey ;
451
451
452
- /* clear this, it may get reset by
453
- * send_server_key_exchange */
454
- if ((s -> options & SSL_OP_EPHEMERAL_RSA )
455
- #ifndef OPENSSL_NO_KRB5
456
- && !(alg_k & SSL_kKRB5 )
457
- #endif /* OPENSSL_NO_KRB5 */
458
- )
459
- /* option SSL_OP_EPHEMERAL_RSA sends temporary RSA key
460
- * even when forbidden by protocol specs
461
- * (handshake may fail as clients are not required to
462
- * be able to handle this) */
463
- s -> s3 -> tmp .use_rsa_tmp = 1 ;
464
- else
465
- s -> s3 -> tmp .use_rsa_tmp = 0 ;
452
+ /*
453
+ * clear this, it may get reset by
454
+ * send_server_key_exchange
455
+ */
456
+ s -> s3 -> tmp .use_rsa_tmp = 0 ;
466
457
467
458
/* only send if a DH key exchange or
468
459
* RSA but we have a sign only certificate */
469
- if (s -> s3 -> tmp . use_rsa_tmp
460
+ if (
470
461
/* PSK: send ServerKeyExchange if PSK identity
471
462
* hint if provided */
472
463
#ifndef OPENSSL_NO_PSK
Original file line number Diff line number Diff line change @@ -1554,6 +1554,13 @@ int ssl3_get_key_exchange(SSL *s)
1554
1554
#ifndef OPENSSL_NO_RSA
1555
1555
if (alg_k & SSL_kRSA )
1556
1556
{
1557
+ /* Temporary RSA keys only allowed in export ciphersuites */
1558
+ if (!SSL_C_IS_EXPORT (s -> s3 -> tmp .new_cipher ))
1559
+ {
1560
+ al = SSL_AD_UNEXPECTED_MESSAGE ;
1561
+ SSLerr (SSL_F_SSL3_GET_SERVER_CERTIFICATE ,SSL_R_UNEXPECTED_MESSAGE );
1562
+ goto f_err ;
1563
+ }
1557
1564
if ((rsa = RSA_new ()) == NULL )
1558
1565
{
1559
1566
SSLerr (SSL_F_SSL3_GET_KEY_EXCHANGE ,ERR_R_MALLOC_FAILURE );
Original file line number Diff line number Diff line change @@ -444,20 +444,11 @@ int ssl3_accept(SSL *s)
444
444
case SSL3_ST_SW_KEY_EXCH_B :
445
445
alg_k = s -> s3 -> tmp .new_cipher -> algorithm_mkey ;
446
446
447
- /* clear this, it may get reset by
448
- * send_server_key_exchange */
449
- if ((s -> options & SSL_OP_EPHEMERAL_RSA )
450
- #ifndef OPENSSL_NO_KRB5
451
- && !(alg_k & SSL_kKRB5 )
452
- #endif /* OPENSSL_NO_KRB5 */
453
- )
454
- /* option SSL_OP_EPHEMERAL_RSA sends temporary RSA key
455
- * even when forbidden by protocol specs
456
- * (handshake may fail as clients are not required to
457
- * be able to handle this) */
458
- s -> s3 -> tmp .use_rsa_tmp = 1 ;
459
- else
460
- s -> s3 -> tmp .use_rsa_tmp = 0 ;
447
+ /*
448
+ * clear this, it may get reset by
449
+ * send_server_key_exchange
450
+ */
451
+ s -> s3 -> tmp .use_rsa_tmp = 0 ;
461
452
462
453
463
454
/* only send if a DH key exchange, fortezza or
@@ -471,7 +462,7 @@ int ssl3_accept(SSL *s)
471
462
* server certificate contains the server's
472
463
* public key for key exchange.
473
464
*/
474
- if (s -> s3 -> tmp . use_rsa_tmp
465
+ if (0
475
466
/* PSK: send ServerKeyExchange if PSK identity
476
467
* hint if provided */
477
468
#ifndef OPENSSL_NO_PSK
Original file line number Diff line number Diff line change @@ -590,9 +590,8 @@ struct ssl_session_st
590
590
#define SSL_OP_SINGLE_ECDH_USE 0x00080000L
591
591
/* If set, always create a new key when using tmp_dh parameters */
592
592
#define SSL_OP_SINGLE_DH_USE 0x00100000L
593
- /* Set to always use the tmp_rsa key when doing RSA operations,
594
- * even when this violates protocol specs */
595
- #define SSL_OP_EPHEMERAL_RSA 0x00200000L
593
+ /* Does nothing: retained for compatibiity */
594
+ #define SSL_OP_EPHEMERAL_RSA 0x0
596
595
/* Set on servers to choose the cipher according to the server's
597
596
* preferences */
598
597
#define SSL_OP_CIPHER_SERVER_PREFERENCE 0x00400000L
You can’t perform that action at this time.
0 commit comments