mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-29 11:41:15 +03:00
Check key size in cipher_setkey()
This commit is contained in:
committed by
Paul Bakker
parent
d331319a38
commit
dd0f57f186
@ -181,7 +181,7 @@ int pkcs12_pbe( asn1_buf *pbe_params, int mode,
|
||||
if( ( ret = cipher_init_ctx( &cipher_ctx, cipher_info ) ) != 0 )
|
||||
goto exit;
|
||||
|
||||
if( ( ret = cipher_setkey( &cipher_ctx, key, keylen, mode ) ) != 0 )
|
||||
if( ( ret = cipher_setkey( &cipher_ctx, key, 8 * keylen, mode ) ) != 0 )
|
||||
goto exit;
|
||||
|
||||
if( ( ret = cipher_set_iv( &cipher_ctx, iv, cipher_info->iv_size ) ) != 0 )
|
||||
|
Reference in New Issue
Block a user