Split tag handling out of cipher_finish()

This commit is contained in:
Manuel Pégourié-Gonnard 2013-09-03 16:19:22 +02:00
parent 2adc40c346
commit aa9ffc5e98
6 changed files with 88 additions and 54 deletions

View file

@ -199,11 +199,8 @@ int pkcs5_pbes2( asn1_buf *pbe_params, int mode,
goto exit;
}
if( ( ret = cipher_finish( &cipher_ctx, output + olen, &olen, NULL, 0 ) )
!= 0 )
{
if( ( ret = cipher_finish( &cipher_ctx, output + olen, &olen ) ) != 0 )
ret = POLARSSL_ERR_PKCS5_PASSWORD_MISMATCH;
}
exit:
md_free_ctx( &md_ctx );