mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-01-13 07:25:31 +00:00
Fix missing state check for tls12_prf output
Fix PSA_ALG_TLS12_PRF and PSA_ALG_TLS12_PSK_TO_MS being too permissive about missing inputs. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
parent
d40a21cff1
commit
f216f0d5d4
3
ChangeLog.d/psa_key_derivation-bad_workflow.txt
Normal file
3
ChangeLog.d/psa_key_derivation-bad_workflow.txt
Normal file
|
@ -0,0 +1,3 @@
|
|||
Bugfix
|
||||
* Fix PSA_ALG_TLS12_PRF and PSA_ALG_TLS12_PSK_TO_MS being too permissive
|
||||
about missing inputs.
|
|
@ -3785,6 +3785,17 @@ static psa_status_t psa_key_derivation_tls12_prf_read(
|
|||
psa_status_t status;
|
||||
uint8_t offset, length;
|
||||
|
||||
switch( tls12_prf->state )
|
||||
{
|
||||
case PSA_TLS12_PRF_STATE_LABEL_SET:
|
||||
tls12_prf->state = PSA_TLS12_PRF_STATE_OUTPUT;
|
||||
break;
|
||||
case PSA_TLS12_PRF_STATE_OUTPUT:
|
||||
break;
|
||||
default:
|
||||
return( PSA_ERROR_BAD_STATE );
|
||||
}
|
||||
|
||||
while( output_length != 0 )
|
||||
{
|
||||
/* Check if we have fully processed the current block. */
|
||||
|
|
Loading…
Reference in a new issue