Skip to content

Commit 18f2661

Browse files
Merge pull request #10491 from valeriosetti/issue10229
Remove temporary fixes introduced in #10213
2 parents ee72a20 + 910bf4b commit 18f2661

File tree

2 files changed

+7
-20
lines changed

2 files changed

+7
-20
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);

tests/suites/test_suite_x509parse.function

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1133,14 +1133,6 @@ void x509parse_crt(data_t *buf, char *result_str, int result)
11331133
int result_back_comp = result;
11341134
int res;
11351135

1136-
#if !defined(MBEDTLS_PK_USE_PSA_RSA_DATA)
1137-
/* Support for mbedtls#10213 before psa#308. Once psa#308 will be
1138-
* merged this dirty fix can be removed. */
1139-
if (result == MBEDTLS_ERR_PK_INVALID_PUBKEY) {
1140-
result_back_comp = MBEDTLS_ERR_ASN1_UNEXPECTED_TAG;
1141-
}
1142-
#endif /* MBEDTLS_PK_USE_PSA_RSA_DATA */
1143-
11441136
mbedtls_x509_crt_init(&crt);
11451137
USE_PSA_INIT();
11461138

0 commit comments

Comments
 (0)