From 2e0bedcc35ba67d481272676a19cf43d58f07bd3 Mon Sep 17 00:00:00 2001 From: Hanno Becker Date: Tue, 30 Apr 2019 14:18:06 +0100 Subject: [PATCH] Correct compile-time guard around unhexify() in ssl_server2 --- programs/ssl/ssl_server2.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/programs/ssl/ssl_server2.c b/programs/ssl/ssl_server2.c index ca9d0357e..4a1c0474f 100644 --- a/programs/ssl/ssl_server2.c +++ b/programs/ssl/ssl_server2.c @@ -759,7 +759,8 @@ int sni_callback( void *p_info, mbedtls_ssl_context *ssl, #endif /* SNI_OPTION */ -#if defined(MBEDTLS_KEY_EXCHANGE__SOME__PSK_ENABLED) +#if defined(MBEDTLS_KEY_EXCHANGE__SOME__PSK_ENABLED) || \ + defined(MBEDTLS_SSL_CID) #define HEX2NUM( c ) \ if( c >= '0' && c <= '9' ) \ @@ -799,6 +800,10 @@ int unhexify( unsigned char *output, const char *input, size_t *olen ) return( 0 ); } +#endif + +#if defined(MBEDTLS_KEY_EXCHANGE__SOME__PSK_ENABLED) + typedef struct _psk_entry psk_entry; struct _psk_entry