mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-26 12:55:46 +01:00
Small code simplification in pkcs5_pbes2()
This commit is contained in:
parent
66aca931bc
commit
90dac90f53
@ -204,19 +204,8 @@ int pkcs5_pbes2( asn1_buf *pbe_params, int mode,
|
|||||||
if( ( ret = cipher_setkey( &cipher_ctx, key, 8 * keylen, mode ) ) != 0 )
|
if( ( ret = cipher_setkey( &cipher_ctx, key, 8 * keylen, mode ) ) != 0 )
|
||||||
goto exit;
|
goto exit;
|
||||||
|
|
||||||
if( ( ret = cipher_set_iv( &cipher_ctx, iv, enc_scheme_params.len ) ) != 0 )
|
if( ( ret = cipher_crypt( &cipher_ctx, iv, enc_scheme_params.len,
|
||||||
goto exit;
|
data, datalen, output, &olen ) ) != 0 )
|
||||||
|
|
||||||
if( ( ret = cipher_reset( &cipher_ctx ) ) != 0 )
|
|
||||||
goto exit;
|
|
||||||
|
|
||||||
if( ( ret = cipher_update( &cipher_ctx, data, datalen,
|
|
||||||
output, &olen ) ) != 0 )
|
|
||||||
{
|
|
||||||
goto exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( ( ret = cipher_finish( &cipher_ctx, output + olen, &olen ) ) != 0 )
|
|
||||||
ret = POLARSSL_ERR_PKCS5_PASSWORD_MISMATCH;
|
ret = POLARSSL_ERR_PKCS5_PASSWORD_MISMATCH;
|
||||||
|
|
||||||
exit:
|
exit:
|
||||||
|
Loading…
Reference in New Issue
Block a user