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

@ -196,11 +196,8 @@ int pkcs12_pbe( 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_PKCS12_PASSWORD_MISMATCH;
}
exit:
cipher_free_ctx( &cipher_ctx );