create tls12/tls13 sig alg support check
@@ -2059,16 +2059,20 @@ static inline int mbedtls_ssl_tls13_get_pk_type_and_md_alg_from_sig_alg(
return( 0 );
}
-
-#endif /* MBEDTLS_SSL_PROTO_TLS1_3 */
-
-static inline int mbedtls_ssl_sig_alg_is_supported(
- const mbedtls_ssl_context *ssl,
+static inline int mbedtls_ssl_tls13_sig_alg_is_supported(
const uint16_t sig_alg )
{
+ mbedtls_pk_type_t pk_type;
+ mbedtls_md_type_t md_alg;
+ return( ! mbedtls_ssl_tls13_get_pk_type_and_md_alg_from_sig_alg(
+ sig_alg, &pk_type, &md_alg ) );
+}
+
+#endif /* MBEDTLS_SSL_PROTO_TLS1_3 */
#if defined(MBEDTLS_SSL_PROTO_TLS1_2)
- if( ssl->tls_version == MBEDTLS_SSL_VERSION_TLS1_2 )
+static inline int mbedtls_ssl_tls12_sig_alg_is_supported(
+ const uint16_t sig_alg )
{
/* High byte is hash */
unsigned char hash = MBEDTLS_BYTE_1( sig_alg );
@@ -2130,13 +2134,22 @@ static inline int mbedtls_ssl_sig_alg_is_supported(
}
#endif /* MBEDTLS_SSL_PROTO_TLS1_2 */
+static inline int mbedtls_ssl_sig_alg_is_supported(
+ const mbedtls_ssl_context *ssl,
+ const uint16_t sig_alg )
+{
+
+#if defined(MBEDTLS_SSL_PROTO_TLS1_2)
+ if( ssl->tls_version == MBEDTLS_SSL_VERSION_TLS1_2 )
+ {
+ return( mbedtls_ssl_tls12_sig_alg_is_supported( sig_alg ) );
+ }
+#endif /* MBEDTLS_SSL_PROTO_TLS1_2 */
+
#if defined(MBEDTLS_SSL_PROTO_TLS1_3)
if( ssl->tls_version == MBEDTLS_SSL_VERSION_TLS1_3 )
{
- mbedtls_pk_type_t pk_type;
- mbedtls_md_type_t md_alg;
- return( ! mbedtls_ssl_tls13_get_pk_type_and_md_alg_from_sig_alg(
- sig_alg, &pk_type, &md_alg ) );
+ return( mbedtls_ssl_tls13_sig_alg_is_supported( sig_alg ) );
}
#endif /* MBEDTLS_SSL_PROTO_TLS1_3 */
((void) ssl);
