mirror of
				https://github.com/cuberite/polarssl.git
				synced 2025-11-03 20:22:59 -05:00 
			
		
		
		
	Skip PMS generation on client if opaque PSK is used
For opaque PSKs, the PSK-to-MS expansion is performed atomatically on the PSA-side.
This commit is contained in:
		
							parent
							
								
									7d0a569d38
								
							
						
					
					
						commit
						afd311ee12
					
				@ -3165,6 +3165,17 @@ ecdh_calc_secret:
 | 
				
			|||||||
            return( MBEDTLS_ERR_SSL_INTERNAL_ERROR );
 | 
					            return( MBEDTLS_ERR_SSL_INTERNAL_ERROR );
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#if defined(MBEDTLS_USE_PSA_CRYPTO) &&          \
 | 
				
			||||||
 | 
					    defined(MBEDTLS_KEY_EXCHANGE_PSK_ENABLED)
 | 
				
			||||||
 | 
					        if( ciphersuite_info->key_exchange == MBEDTLS_KEY_EXCHANGE_PSK &&
 | 
				
			||||||
 | 
					            ssl->minor_ver == MBEDTLS_SSL_MINOR_VERSION_3 &&
 | 
				
			||||||
 | 
					            ssl_conf_has_raw_psk( ssl->conf ) == 0 )
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            MBEDTLS_SSL_DEBUG_MSG( 1, ( "skip PMS generation for opaque PSK" ) );
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        else
 | 
				
			||||||
 | 
					#endif /* MBEDTLS_USE_PSA_CRYPTO &&
 | 
				
			||||||
 | 
					          MBEDTLS_KEY_EXCHANGE_PSK_ENABLED */
 | 
				
			||||||
        if( ( ret = mbedtls_ssl_psk_derive_premaster( ssl,
 | 
					        if( ( ret = mbedtls_ssl_psk_derive_premaster( ssl,
 | 
				
			||||||
                        ciphersuite_info->key_exchange ) ) != 0 )
 | 
					                        ciphersuite_info->key_exchange ) ) != 0 )
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user