From 53bb3120544d23473370f8e75f6d2fe89241e880 Mon Sep 17 00:00:00 2001 From: Paul Elliott Date: Fri, 10 Feb 2023 14:22:22 +0000 Subject: [PATCH] Wipe output buffer even when INCOMPLETE is returned. Signed-off-by: Paul Elliott --- library/psa_crypto.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/library/psa_crypto.c b/library/psa_crypto.c index 776a9c858..e10c34cc5 100644 --- a/library/psa_crypto.c +++ b/library/psa_crypto.c @@ -3292,10 +3292,10 @@ exit: /* Update ops count with work done. */ operation->num_ops = psa_driver_wrapper_sign_hash_get_num_ops(operation); - if (status != PSA_OPERATION_INCOMPLETE) { - psa_wipe_output_buffer(signature, status, signature_size, - *signature_length); + psa_wipe_output_buffer(signature, status, signature_size, + *signature_length); + if (status != PSA_OPERATION_INCOMPLETE) { if (status != PSA_SUCCESS) { operation->error_occurred = 1; }