mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-04-19 19:51:41 +00:00
Add a length check in ssl_derive_keys()
This commit is contained in:
parent
511d809dd1
commit
4091141368
|
@ -526,6 +526,12 @@ int ssl_derive_keys( ssl_context *ssl )
|
|||
transform->keylen, transform->minlen, transform->ivlen,
|
||||
transform->maclen ) );
|
||||
|
||||
if( transform->maclen > sizeof transform->mac_enc )
|
||||
{
|
||||
SSL_DEBUG_MSG( 1, ( "should never happen" ) );
|
||||
return( POLARSSL_ERR_SSL_FEATURE_UNAVAILABLE );
|
||||
}
|
||||
|
||||
/*
|
||||
* Finally setup the cipher contexts, IVs and MAC secrets.
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue