Cipher: test multiple cycles

GCM-cipher: just trust the user to call update_ad at the right time
This commit is contained in:
Manuel Pégourié-Gonnard 2013-09-05 10:30:32 +02:00
parent 45125bc160
commit 1af50a240b
2 changed files with 34 additions and 32 deletions

View file

@ -445,13 +445,6 @@ int cipher_update_ad( cipher_context_t *ctx,
#if defined(POLARSSL_GCM_C)
if( POLARSSL_MODE_GCM == ctx->cipher_info->mode )
{
/* Make sure we're called right after cipher_reset() */
if( ((gcm_context *) ctx->cipher_ctx)->len != 0 ||
((gcm_context *) ctx->cipher_ctx)->add_len != 0 )
{
return POLARSSL_ERR_CIPHER_FEATURE_UNAVAILABLE;
}
return gcm_starts( ctx->cipher_ctx, ctx->operation,
ctx->iv, ctx->iv_size, ad, ad_len );
}