mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2026-08-23 03:29:54 +00:00
library: ssl_tls: replace wrong usage of mbedtls_pk_get_type with mbedtls_pk_get_key_type
The intent on these lines was to get 'psa_key_type_t' for which 'mbedtls_pk_get_key_type' should clearly be used, not 'mbedtls_pk_get_type'. Signed-off-by: Valerio Setti <[email protected]>
This commit is contained in:
+2
-2
@@ -8815,8 +8815,8 @@ int mbedtls_ssl_verify_certificate(mbedtls_ssl_context *ssl,
|
||||
#if defined(MBEDTLS_SSL_PROTO_TLS1_2) && \
|
||||
defined(PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY)
|
||||
if (ssl->tls_version == MBEDTLS_SSL_VERSION_TLS1_2 &&
|
||||
PSA_KEY_TYPE_IS_ECC(mbedtls_pk_get_type(&chain->pk))) {
|
||||
psa_key_type_t key_type = mbedtls_pk_get_type(&chain->pk);
|
||||
PSA_KEY_TYPE_IS_ECC(mbedtls_pk_get_key_type(&chain->pk))) {
|
||||
psa_key_type_t key_type = mbedtls_pk_get_key_type(&chain->pk);
|
||||
psa_ecc_family_t ec_family = PSA_KEY_TYPE_ECC_GET_FAMILY(key_type);
|
||||
size_t bits = mbedtls_pk_get_bitlen(&chain->pk);
|
||||
int tls_id = mbedtls_ssl_get_tls_id_from_curve_info(ec_family, bits);
|
||||
|
||||
@@ -629,7 +629,7 @@ static int ssl_check_key_curve(mbedtls_pk_context *pk,
|
||||
uint16_t *curves_tls_id)
|
||||
{
|
||||
uint16_t *curr_tls_id = curves_tls_id;
|
||||
psa_key_type_t key_type = mbedtls_pk_get_type(pk);
|
||||
psa_key_type_t key_type = mbedtls_pk_get_key_type(pk);
|
||||
size_t key_bits = mbedtls_pk_get_bitlen(pk);
|
||||
psa_key_type_t curr_key_type;
|
||||
size_t curr_key_bits;
|
||||
|
||||
Reference in New Issue
Block a user