From 30090bc2cfcddc8e321507a9e4e72acdd496f821 Mon Sep 17 00:00:00 2001 From: Janos Follath Date: Tue, 25 Jun 2019 10:15:04 +0100 Subject: [PATCH] Fix error code PSA_ERROR_BAD_STATE means that the function was called on a context in a bad state. This error is something that can't happen while only using the PSA API and therefore a PSA_ERROR_CORRUPTION_DETECTED is a more appropriate error code. --- library/psa_crypto.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/psa_crypto.c b/library/psa_crypto.c index 9d02a971d..4b7ae1f7c 100644 --- a/library/psa_crypto.c +++ b/library/psa_crypto.c @@ -4141,7 +4141,7 @@ static psa_status_t psa_key_derivation_tls12_prf_generate_next_block( * object was corrupted or if this function is called directly * inside the library. */ if( tls12_prf->block_number == 0xff ) - return( PSA_ERROR_BAD_STATE ); + return( PSA_ERROR_CORRUPTION_DETECTED ); /* We need a new block */ ++tls12_prf->block_number;