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.
This commit is contained in:
Janos Follath 2019-06-25 10:15:04 +01:00
parent 5fe19734d5
commit 30090bc2cf

View file

@ -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;