From 83da34eb592238ff554bf6e3c0f865ca37ecc70c Mon Sep 17 00:00:00 2001 From: Jerry Yu Date: Sat, 16 Apr 2022 13:59:52 +0800 Subject: [PATCH] tls13:server:add dummy write certificate Signed-off-by: Jerry Yu --- library/ssl_tls13_server.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/library/ssl_tls13_server.c b/library/ssl_tls13_server.c index 46a6a49dd..41e772958 100644 --- a/library/ssl_tls13_server.c +++ b/library/ssl_tls13_server.c @@ -1443,6 +1443,24 @@ cleanup: return( ret ); } +/* + * State Handler : MBEDTLS_SSL_SERVER_CERTIFICATE + */ +int ssl_tls13_write_server_certificate( mbedtls_ssl_context *ssl ) +{ + ((void) ssl); + return( MBEDTLS_ERR_SSL_FEATURE_UNAVAILABLE ); +} + +/* + * State Handler : MBEDTLS_SSL_CERTIFICATE_VERIFY + */ +int ssl_tls13_write_certificate_verify( mbedtls_ssl_context *ssl ) +{ + ((void) ssl); + return( MBEDTLS_ERR_SSL_FEATURE_UNAVAILABLE ); +} + /* * TLS 1.3 State Machine -- server side */ @@ -1499,6 +1517,14 @@ int mbedtls_ssl_tls13_handshake_server_step( mbedtls_ssl_context *ssl ) break; #endif /* MBEDTLS_KEY_EXCHANGE_WITH_CERT_ENABLED */ + case MBEDTLS_SSL_SERVER_CERTIFICATE: + ret = ssl_tls13_write_server_certificate( ssl ); + break; + + case MBEDTLS_SSL_CERTIFICATE_VERIFY: + ret = ssl_tls13_write_certificate_verify( ssl ); + break; + default: MBEDTLS_SSL_DEBUG_MSG( 1, ( "invalid state %d", ssl->state ) ); return( MBEDTLS_ERR_SSL_FEATURE_UNAVAILABLE );