From e6145dc47fdcbaf51428cf5b5bba42eae20995af Mon Sep 17 00:00:00 2001 From: Paul Elliott Date: Tue, 7 Feb 2023 12:51:21 +0000 Subject: [PATCH] Add documentation comment to internal abort functions Explain the reasoning behind not clearing some variables. Signed-off-by: Paul Elliott --- library/psa_crypto.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/library/psa_crypto.c b/library/psa_crypto.c index 419be1649c..97edc15a44 100644 --- a/library/psa_crypto.c +++ b/library/psa_crypto.c @@ -3192,6 +3192,10 @@ static psa_status_t psa_sign_hash_abort_internal( operation->id = 0; + /* Do not clear either the error_occurred or num_ops elements here as they + * only want to be cleared by the application calling abort, not by abort + * being called at completion of an operation. */ + return status; } @@ -3335,6 +3339,10 @@ static psa_status_t psa_verify_hash_abort_internal( operation->id = 0; + /* Do not clear either the error_occurred or num_ops elements here as they + * only want to be cleared by the application calling abort, not by abort + * being called at completion of an operation. */ + return status; }