Skip to content

Commit a35e332

Browse files
committed
library: debug: remove temporary fixes for RSA key handling
Since crypto#308 has been merged: - replace MBEDTLS_PK_USE_PSA_RSA_DATA with PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY - remove "no-check-names" Signed-off-by: Valerio Setti <[email protected]>
1 parent 32b597b commit a35e332

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

library/debug.c

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,7 @@ void mbedtls_debug_print_mpi(const mbedtls_ssl_context *ssl, int level,
220220

221221
#if defined(MBEDTLS_X509_CRT_PARSE_C) && !defined(MBEDTLS_X509_REMOVE_INFO)
222222

223-
/* no-check-names will be removed in mbedtls#10229. */
224-
#if defined(PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY) || defined(MBEDTLS_PK_USE_PSA_RSA_DATA) //no-check-names
223+
#if defined(PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY) || defined(PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY)
225224
static void mbedtls_debug_print_integer(const mbedtls_ssl_context *ssl, int level,
226225
const char *file, int line, const char *text,
227226
const unsigned char *buf, size_t bitlen)
@@ -257,8 +256,7 @@ static void mbedtls_debug_print_integer(const mbedtls_ssl_context *ssl, int leve
257256
debug_send_line(ssl, level, file, line, str);
258257
}
259258
}
260-
/* no-check-names will be removed in mbedtls#10229. */
261-
#endif /* PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY || MBEDTLS_PK_USE_PSA_RSA_DATA */ //no-check-names
259+
#endif /* PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY || PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY */
262260

263261
#if defined(PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY)
264262
static void mbedtls_debug_print_psa_ec(const mbedtls_ssl_context *ssl, int level,
@@ -292,8 +290,7 @@ static void mbedtls_debug_print_psa_ec(const mbedtls_ssl_context *ssl, int level
292290
}
293291
#endif /* PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY */
294292

295-
/* no-check-names will be removed in mbedtls#10229. */
296-
#if defined(MBEDTLS_PK_USE_PSA_RSA_DATA) //no-check-names
293+
#if defined(PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY)
297294
static size_t debug_count_valid_bits(unsigned char **buf, size_t len)
298295
{
299296
size_t i, bits;
@@ -389,8 +386,7 @@ static void mbedtls_debug_print_psa_rsa(const mbedtls_ssl_context *ssl, int leve
389386
mbedtls_snprintf(str, sizeof(str), "%s.E", text);
390387
mbedtls_debug_print_integer(ssl, level, file, line, str, start_cur, bits);
391388
}
392-
/* no-check-names will be removed in mbedtls#10229. */
393-
#endif /* MBEDTLS_PK_USE_PSA_RSA_DATA */ //no-check-names
389+
#endif /* PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY */
394390

395391
static void debug_print_pk(const mbedtls_ssl_context *ssl, int level,
396392
const char *file, int line,
@@ -421,12 +417,11 @@ static void debug_print_pk(const mbedtls_ssl_context *ssl, int level,
421417
mbedtls_debug_print_mpi(ssl, level, file, line, name, items[i].value);
422418
} else
423419
#endif /* MBEDTLS_RSA_C */
424-
/* no-check-names will be removed in mbedtls#10229. */
425-
#if defined(MBEDTLS_PK_USE_PSA_RSA_DATA) //no-check-names
426-
if (items[i].type == MBEDTLS_PK_DEBUG_PSA_RSA) { //no-check-names
420+
#if defined(PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY)
421+
if (items[i].type == MBEDTLS_PK_DEBUG_PSA_RSA) {
427422
mbedtls_debug_print_psa_rsa(ssl, level, file, line, name, items[i].value);
428423
} else
429-
#endif /* MBEDTLS_PK_USE_PSA_RSA_DATA */ //no-check-names
424+
#endif /* PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY */
430425
#if defined(PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY)
431426
if (items[i].type == MBEDTLS_PK_DEBUG_PSA_EC) {
432427
mbedtls_debug_print_psa_ec(ssl, level, file, line, name, items[i].value);

0 commit comments

Comments
 (0)