mirror of https://github.com/openssl/openssl.git
				
				
				
			Only allow a temporary rsa key exchange when they key is larger than 512.
Reviewed-by: Matt Caswell <matt@openssl.org> MR #588
This commit is contained in:
		
							parent
							
								
									26c79d5641
								
							
						
					
					
						commit
						1dece95168
					
				|  | @ -334,7 +334,7 @@ int ssl3_connect(SSL *s) | ||||||
|             if (! |             if (! | ||||||
|                 (s->s3->tmp. |                 (s->s3->tmp. | ||||||
|                  new_cipher->algorithm_auth & (SSL_aNULL | SSL_aSRP)) |                  new_cipher->algorithm_auth & (SSL_aNULL | SSL_aSRP)) | ||||||
| && !(s->s3->tmp.new_cipher->algorithm_mkey & SSL_kPSK)) { |                     && !(s->s3->tmp.new_cipher->algorithm_mkey & SSL_kPSK)) { | ||||||
|                 ret = ssl3_get_server_certificate(s); |                 ret = ssl3_get_server_certificate(s); | ||||||
|                 if (ret <= 0) |                 if (ret <= 0) | ||||||
|                     goto end; |                     goto end; | ||||||
|  | @ -1704,6 +1704,13 @@ int ssl3_get_key_exchange(SSL *s) | ||||||
|             SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE, ERR_R_INTERNAL_ERROR); |             SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE, ERR_R_INTERNAL_ERROR); | ||||||
|             goto err; |             goto err; | ||||||
|         } |         } | ||||||
|  | 
 | ||||||
|  |         if (EVP_PKEY_bits(pkey) <= SSL_C_EXPORT_PKEYLENGTH(s->s3->tmp.new_cipher)) { | ||||||
|  |             al = SSL_AD_UNEXPECTED_MESSAGE; | ||||||
|  |             SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE, SSL_R_UNEXPECTED_MESSAGE); | ||||||
|  |             goto f_err; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|         s->session->sess_cert->peer_rsa_tmp = rsa; |         s->session->sess_cert->peer_rsa_tmp = rsa; | ||||||
|         rsa = NULL; |         rsa = NULL; | ||||||
|     } |     } | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue