diff --git a/library/ssl_cli.c b/library/ssl_cli.c index 5fd8e4ce5..a68d802a8 100644 --- a/library/ssl_cli.c +++ b/library/ssl_cli.c @@ -173,7 +173,8 @@ static void ssl_write_signature_algorithms_ext( mbedtls_ssl_context *ssl, unsigned char *p = buf; const unsigned char *end = ssl->out_msg + MBEDTLS_SSL_OUT_CONTENT_LEN; size_t sig_alg_len = 0; -#if defined(MBEDTLS_RSA_C) || defined(MBEDTLS_ECDSA_C) +#if defined(MBEDTLS_RSA_C) || defined(MBEDTLS_ECDSA_C) || \ + defined(MBEDTLS_USE_TINYCRYPT) unsigned char *sig_alg_list = buf + 6; #endif @@ -189,7 +190,7 @@ static void ssl_write_signature_algorithms_ext( mbedtls_ssl_context *ssl, MBEDTLS_SSL_BEGIN_FOR_EACH_SIG_HASH_TLS( hash ) ((void) hash); -#if defined(MBEDTLS_ECDSA_C) +#if defined(MBEDTLS_ECDSA_C) || defined(MBEDTLS_USE_TINYCRYPT) sig_alg_len += 2; #endif #if defined(MBEDTLS_RSA_C) @@ -209,7 +210,7 @@ static void ssl_write_signature_algorithms_ext( mbedtls_ssl_context *ssl, sig_alg_len = 0; MBEDTLS_SSL_BEGIN_FOR_EACH_SIG_HASH_TLS( hash ) -#if defined(MBEDTLS_ECDSA_C) +#if defined(MBEDTLS_ECDSA_C) || defined(MBEDTLS_USE_TINYCRYPT) sig_alg_list[sig_alg_len++] = hash; sig_alg_list[sig_alg_len++] = MBEDTLS_SSL_SIG_ECDSA; #endif diff --git a/library/ssl_srv.c b/library/ssl_srv.c index b058e7c81..f27fb0db9 100644 --- a/library/ssl_srv.c +++ b/library/ssl_srv.c @@ -3064,7 +3064,7 @@ static int ssl_write_certificate_request( mbedtls_ssl_context *ssl ) #if defined(MBEDTLS_RSA_C) p[1 + ct_len++] = MBEDTLS_SSL_CERT_TYPE_RSA_SIGN; #endif -#if defined(MBEDTLS_ECDSA_C) +#if defined(MBEDTLS_ECDSA_C) || defined(MBEDTLS_USE_TINYCRYPT) p[1 + ct_len++] = MBEDTLS_SSL_CERT_TYPE_ECDSA_SIGN; #endif @@ -3105,7 +3105,7 @@ static int ssl_write_certificate_request( mbedtls_ssl_context *ssl ) p[2 + sa_len++] = hash; p[2 + sa_len++] = MBEDTLS_SSL_SIG_RSA; #endif -#if defined(MBEDTLS_ECDSA_C) +#if defined(MBEDTLS_ECDSA_C) || defined(MBEDTLS_USE_TINYCRYPT) p[2 + sa_len++] = hash; p[2 + sa_len++] = MBEDTLS_SSL_SIG_ECDSA; #endif diff --git a/library/ssl_tls.c b/library/ssl_tls.c index d4d51b5ef..f56475be0 100644 --- a/library/ssl_tls.c +++ b/library/ssl_tls.c @@ -12057,7 +12057,8 @@ void mbedtls_ssl_config_free( mbedtls_ssl_config *conf ) } #if defined(MBEDTLS_PK_C) && \ - ( defined(MBEDTLS_RSA_C) || defined(MBEDTLS_ECDSA_C) ) + ( defined(MBEDTLS_RSA_C) || defined(MBEDTLS_ECDSA_C) ) || \ + ( defined(MBEDTLS_USE_TINYCRYPT) ) /* * Convert between MBEDTLS_PK_XXX and SSL_SIG_XXX */ @@ -12067,7 +12068,7 @@ unsigned char mbedtls_ssl_sig_from_pk( mbedtls_pk_context *pk ) if( mbedtls_pk_can_do( pk, MBEDTLS_PK_RSA ) ) return( MBEDTLS_SSL_SIG_RSA ); #endif -#if defined(MBEDTLS_ECDSA_C) +#if defined(MBEDTLS_ECDSA_C) || defined(MBEDTLS_USE_TINYCRYPT) if( mbedtls_pk_can_do( pk, MBEDTLS_PK_ECDSA ) ) return( MBEDTLS_SSL_SIG_ECDSA ); #endif @@ -12095,7 +12096,7 @@ mbedtls_pk_type_t mbedtls_ssl_pk_alg_from_sig( unsigned char sig ) case MBEDTLS_SSL_SIG_RSA: return( MBEDTLS_PK_RSA ); #endif -#if defined(MBEDTLS_ECDSA_C) +#if defined(MBEDTLS_ECDSA_C) || defined(MBEDTLS_USE_TINYCRYPT) case MBEDTLS_SSL_SIG_ECDSA: return( MBEDTLS_PK_ECDSA ); #endif