Skip to content

Commit 5ad2bfa

Browse files
committed
library: ssl: adjust return type of mbedtls_psa_alg_from_pk_sigalg()
The correct return type should have been "psa_algorithm_t" since the beginning because this is what the function really returns and this is what the returned value is then used for in the calling functions. Change also the returned value in the default case from MBEDTLS_PK_SIGALG_NONE to PSA_ALG_NONE in order to return the same type as in other cases of the switch case. Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
1 parent d8f0b37 commit 5ad2bfa

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

library/mbedtls_utils.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
#define MBEDTLS_UTILS_H
66

77
/* Return the PSA algorithm associated to the given combination of "sigalg" and "hash_alg". */
8-
static inline int mbedtls_psa_alg_from_pk_sigalg(mbedtls_pk_sigalg_t sigalg,
9-
psa_algorithm_t hash_alg)
8+
static inline psa_algorithm_t mbedtls_psa_alg_from_pk_sigalg(mbedtls_pk_sigalg_t sigalg,
9+
psa_algorithm_t hash_alg)
1010
{
1111
switch (sigalg) {
1212
case MBEDTLS_PK_SIGALG_RSA_PKCS1V15:
@@ -16,7 +16,7 @@ static inline int mbedtls_psa_alg_from_pk_sigalg(mbedtls_pk_sigalg_t sigalg,
1616
case MBEDTLS_PK_SIGALG_ECDSA:
1717
return MBEDTLS_PK_ALG_ECDSA(hash_alg);
1818
default:
19-
return MBEDTLS_PK_SIGALG_NONE;
19+
return PSA_ALG_NONE;
2020
}
2121
}
2222

0 commit comments

Comments
 (0)