mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-01-11 13:15:30 +00:00
Missing uECC ECDSA flagging
This commit is contained in:
parent
ad78931fb3
commit
7cb5c11067
|
@ -173,7 +173,8 @@ static void ssl_write_signature_algorithms_ext( mbedtls_ssl_context *ssl,
|
||||||
unsigned char *p = buf;
|
unsigned char *p = buf;
|
||||||
const unsigned char *end = ssl->out_msg + MBEDTLS_SSL_OUT_CONTENT_LEN;
|
const unsigned char *end = ssl->out_msg + MBEDTLS_SSL_OUT_CONTENT_LEN;
|
||||||
size_t sig_alg_len = 0;
|
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;
|
unsigned char *sig_alg_list = buf + 6;
|
||||||
#endif
|
#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 )
|
MBEDTLS_SSL_BEGIN_FOR_EACH_SIG_HASH_TLS( hash )
|
||||||
((void) hash);
|
((void) hash);
|
||||||
#if defined(MBEDTLS_ECDSA_C)
|
#if defined(MBEDTLS_ECDSA_C) || defined(MBEDTLS_USE_TINYCRYPT)
|
||||||
sig_alg_len += 2;
|
sig_alg_len += 2;
|
||||||
#endif
|
#endif
|
||||||
#if defined(MBEDTLS_RSA_C)
|
#if defined(MBEDTLS_RSA_C)
|
||||||
|
@ -209,7 +210,7 @@ static void ssl_write_signature_algorithms_ext( mbedtls_ssl_context *ssl,
|
||||||
sig_alg_len = 0;
|
sig_alg_len = 0;
|
||||||
|
|
||||||
MBEDTLS_SSL_BEGIN_FOR_EACH_SIG_HASH_TLS( hash )
|
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++] = hash;
|
||||||
sig_alg_list[sig_alg_len++] = MBEDTLS_SSL_SIG_ECDSA;
|
sig_alg_list[sig_alg_len++] = MBEDTLS_SSL_SIG_ECDSA;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -3064,7 +3064,7 @@ static int ssl_write_certificate_request( mbedtls_ssl_context *ssl )
|
||||||
#if defined(MBEDTLS_RSA_C)
|
#if defined(MBEDTLS_RSA_C)
|
||||||
p[1 + ct_len++] = MBEDTLS_SSL_CERT_TYPE_RSA_SIGN;
|
p[1 + ct_len++] = MBEDTLS_SSL_CERT_TYPE_RSA_SIGN;
|
||||||
#endif
|
#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;
|
p[1 + ct_len++] = MBEDTLS_SSL_CERT_TYPE_ECDSA_SIGN;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -3105,7 +3105,7 @@ static int ssl_write_certificate_request( mbedtls_ssl_context *ssl )
|
||||||
p[2 + sa_len++] = hash;
|
p[2 + sa_len++] = hash;
|
||||||
p[2 + sa_len++] = MBEDTLS_SSL_SIG_RSA;
|
p[2 + sa_len++] = MBEDTLS_SSL_SIG_RSA;
|
||||||
#endif
|
#endif
|
||||||
#if defined(MBEDTLS_ECDSA_C)
|
#if defined(MBEDTLS_ECDSA_C) || defined(MBEDTLS_USE_TINYCRYPT)
|
||||||
p[2 + sa_len++] = hash;
|
p[2 + sa_len++] = hash;
|
||||||
p[2 + sa_len++] = MBEDTLS_SSL_SIG_ECDSA;
|
p[2 + sa_len++] = MBEDTLS_SSL_SIG_ECDSA;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -12057,7 +12057,8 @@ void mbedtls_ssl_config_free( mbedtls_ssl_config *conf )
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(MBEDTLS_PK_C) && \
|
#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
|
* 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 ) )
|
if( mbedtls_pk_can_do( pk, MBEDTLS_PK_RSA ) )
|
||||||
return( MBEDTLS_SSL_SIG_RSA );
|
return( MBEDTLS_SSL_SIG_RSA );
|
||||||
#endif
|
#endif
|
||||||
#if defined(MBEDTLS_ECDSA_C)
|
#if defined(MBEDTLS_ECDSA_C) || defined(MBEDTLS_USE_TINYCRYPT)
|
||||||
if( mbedtls_pk_can_do( pk, MBEDTLS_PK_ECDSA ) )
|
if( mbedtls_pk_can_do( pk, MBEDTLS_PK_ECDSA ) )
|
||||||
return( MBEDTLS_SSL_SIG_ECDSA );
|
return( MBEDTLS_SSL_SIG_ECDSA );
|
||||||
#endif
|
#endif
|
||||||
|
@ -12095,7 +12096,7 @@ mbedtls_pk_type_t mbedtls_ssl_pk_alg_from_sig( unsigned char sig )
|
||||||
case MBEDTLS_SSL_SIG_RSA:
|
case MBEDTLS_SSL_SIG_RSA:
|
||||||
return( MBEDTLS_PK_RSA );
|
return( MBEDTLS_PK_RSA );
|
||||||
#endif
|
#endif
|
||||||
#if defined(MBEDTLS_ECDSA_C)
|
#if defined(MBEDTLS_ECDSA_C) || defined(MBEDTLS_USE_TINYCRYPT)
|
||||||
case MBEDTLS_SSL_SIG_ECDSA:
|
case MBEDTLS_SSL_SIG_ECDSA:
|
||||||
return( MBEDTLS_PK_ECDSA );
|
return( MBEDTLS_PK_ECDSA );
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue