Fix wrong ifdef in ssl_server2 & add test for it
This was found as a warning when running scripts/baremetal.sh --ram
--build-only manually, but it should have been found in a more automated way.
Adding -Werror so that future such issues will be caught by all.sh
(component_test_baremetal already invokes baremetal.sh --ram --build-only).
diff --git a/programs/ssl/ssl_server2.c b/programs/ssl/ssl_server2.c
index bc97149..6d81626 100644
--- a/programs/ssl/ssl_server2.c
+++ b/programs/ssl/ssl_server2.c
@@ -791,6 +791,7 @@
return( mbedtls_net_send( io_ctx->net, buf, len ) );
}
+#if defined(SNI_OPTION) || !defined(MBEDTLS_SSL_CONF_AUTHMODE)
/*
* Return authmode from string, or -1 on error
*/
@@ -805,6 +806,7 @@
return( -1 );
}
+#endif /* SNI_OPTION || !MBEDTLS_SSL_CONF_AUTHMODE */
/*
* Used by sni_parse and psk_parse to handle coma-separated lists