@@ -368,11 +368,6 @@ uint64_t mbedtls_test_parse_binary_string(data_t *bin_string);
368
368
#else /* MBEDTLS_VERSION_MAJOR < 4 */
369
369
370
370
/** \def USE_PSA_INIT
371
- *
372
- * Call this macro to initialize the PSA subsystem if #MBEDTLS_USE_PSA_CRYPTO
373
- * or #MBEDTLS_SSL_PROTO_TLS1_3 (In contrast to TLS 1.2 implementation, the
374
- * TLS 1.3 one uses PSA independently of the definition of
375
- * #MBEDTLS_USE_PSA_CRYPTO) is enabled and do nothing otherwise.
376
371
*
377
372
* If the initialization fails, mark the test case as failed and jump to the
378
373
* \p exit label.
@@ -384,25 +379,8 @@ uint64_t mbedtls_test_parse_binary_string(data_t *bin_string);
384
379
* This is like #PSA_DONE except it does nothing under the same conditions as
385
380
* #USE_PSA_INIT.
386
381
*/
387
- #if defined(MBEDTLS_USE_PSA_CRYPTO )
388
382
#define USE_PSA_INIT () PSA_INIT()
389
383
#define USE_PSA_DONE () PSA_DONE()
390
- #elif defined(MBEDTLS_SSL_PROTO_TLS1_3 )
391
- /* TLS 1.3 must work without having called psa_crypto_init(), for backward
392
- * compatibility with Mbed TLS <= 3.5 when connecting with a peer that
393
- * supports both TLS 1.2 and TLS 1.3. See mbedtls_ssl_tls13_crypto_init()
394
- * and https://github.com/Mbed-TLS/mbedtls/issues/9072 . */
395
- #define USE_PSA_INIT () ((void) 0)
396
- /* TLS 1.3 may have initialized the PSA subsystem. Shut it down cleanly,
397
- * otherwise Asan and Valgrind would notice a resource leak. */
398
- #define USE_PSA_DONE () PSA_DONE()
399
- #else /* MBEDTLS_USE_PSA_CRYPTO || MBEDTLS_SSL_PROTO_TLS1_3 */
400
- /* Define empty macros so that we can use them in the preamble and teardown
401
- * of every test function that uses PSA conditionally based on
402
- * MBEDTLS_USE_PSA_CRYPTO. */
403
- #define USE_PSA_INIT () ((void) 0)
404
- #define USE_PSA_DONE () ((void) 0)
405
- #endif /* !MBEDTLS_USE_PSA_CRYPTO && !MBEDTLS_SSL_PROTO_TLS1_3 */
406
384
407
385
/** \def MD_PSA_INIT
408
386
*
@@ -452,10 +430,6 @@ uint64_t mbedtls_test_parse_binary_string(data_t *bin_string);
452
430
453
431
454
432
/** \def MD_OR_USE_PSA_INIT
455
- *
456
- * Call this macro to initialize the PSA subsystem if MD uses a driver,
457
- * or if #MBEDTLS_USE_PSA_CRYPTO or #MBEDTLS_SSL_PROTO_TLS1_3 is enabled,
458
- * and do nothing otherwise.
459
433
*
460
434
* If the initialization fails, mark the test case as failed and jump to the
461
435
* \p exit label.
@@ -544,19 +518,11 @@ uint64_t mbedtls_test_parse_binary_string(data_t *bin_string);
544
518
545
519
/* Helper macro for the PK module to check whether MBEDTLS_PSA_STATIC_KEY_SLOT_BUFFER_SIZE
546
520
* is large enough to contain 4096-bit RSA key pairs. Of course this check is only
547
- * necessary if PK relies on PSA (i.e. MBEDTLS_USE_PSA_CRYPTO) to store and manage
521
+ * necessary if PK relies on PSA to store and manage
548
522
* the key. */
549
- #if defined(MBEDTLS_USE_PSA_CRYPTO )
550
-
551
523
#if !defined(MBEDTLS_PSA_STATIC_KEY_SLOTS ) || \
552
524
defined(MBEDTLS_TEST_STATIC_KEY_SLOTS_SUPPORT_RSA_4096 )
553
525
#define MBEDTLS_TEST_PK_ALLOW_RSA_KEY_PAIR_4096
554
526
#endif
555
527
556
- #else /* MBEDTLS_USE_PSA_CRYPTO */
557
-
558
- #define MBEDTLS_TEST_PK_ALLOW_RSA_KEY_PAIR_4096
559
-
560
- #endif /* MBEDTLS_USE_PSA_CRYPTO */
561
-
562
528
#endif /* PSA_CRYPTO_HELPERS_H */
0 commit comments