Continue check next psk key when binder mismatch
with matched identity and mismatch binder, should check next psk key.
Exit with error will break multi-psk cases.
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
diff --git a/library/ssl_tls13_server.c b/library/ssl_tls13_server.c
index 5ae9f7c..6013079 100644
--- a/library/ssl_tls13_server.c
+++ b/library/ssl_tls13_server.c
@@ -298,7 +298,7 @@
ret = ssl_tls13_offered_psks_check_binder_match(
ssl, binder, binder_len, &alg );
- if( ret != SSL_TLS1_3_OFFERED_PSK_MATCH )
+ if( ret < 0 )
{
MBEDTLS_SSL_DEBUG_RET( 1,
"ssl_tls13_offered_psks_check_binder_match" , ret );
@@ -308,6 +308,9 @@
return( ret );
}
+ if( ret != SSL_TLS1_3_OFFERED_PSK_MATCH )
+ continue;
+
matched_identity = identity_id;
*psk_alg = alg;
}