From daf5c8954c121b73f2cb1764e99738eac686ad61 Mon Sep 17 00:00:00 2001 From: Paul Elliott Date: Wed, 25 Aug 2021 16:24:58 +0100 Subject: [PATCH] Remove extraneous state checks Signed-off-by: Paul Elliott --- library/psa_crypto.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/library/psa_crypto.c b/library/psa_crypto.c index 13116dcad..0bdbc5bd7 100644 --- a/library/psa_crypto.c +++ b/library/psa_crypto.c @@ -3514,8 +3514,7 @@ psa_status_t psa_aead_generate_nonce( psa_aead_operation_t *operation, goto exit; } - if( operation->nonce_set || operation->ad_started || - operation->body_started || !operation->is_encrypt ) + if( operation->nonce_set || !operation->is_encrypt ) { status = PSA_ERROR_BAD_STATE; goto exit; @@ -3561,8 +3560,7 @@ psa_status_t psa_aead_set_nonce( psa_aead_operation_t *operation, goto exit; } - if( operation->nonce_set || operation->ad_started || - operation->body_started ) + if( operation->nonce_set ) { status = PSA_ERROR_BAD_STATE; goto exit;