@@ -1689,7 +1689,7 @@ component_full_no_pkparse_pkwrite() {
16891689component_test_crypto_full_md_light_only () {
16901690 msg " build: crypto_full with only the light subset of MD"
16911691 scripts/config.py crypto_full
1692- scripts/config.py unset MBEDTLS_PSA_CRYPTO_CONFIG
1692+
16931693 # Disable MD
16941694 scripts/config.py unset MBEDTLS_MD_C
16951695 # Disable direct dependencies of MD_C
@@ -1698,6 +1698,7 @@ component_test_crypto_full_md_light_only () {
16981698 scripts/config.py unset MBEDTLS_PKCS7_C
16991699 # Disable indirect dependencies of MD_C
17001700 scripts/config.py unset MBEDTLS_ECDSA_DETERMINISTIC # needs HMAC_DRBG
1701+ scripts/config.py -f $CRYPTO_CONFIG_H unset PSA_WANT_ALG_DETERMINISTIC_ECDSA
17011702 # Disable things that would auto-enable MD_C
17021703 scripts/config.py unset MBEDTLS_PKCS5_C
17031704
@@ -1713,69 +1714,28 @@ component_test_crypto_full_md_light_only () {
17131714 make test
17141715}
17151716
1716- component_test_full_no_cipher_no_psa_crypto () {
1717- msg " build: full no CIPHER no PSA_CRYPTO_C"
1718- scripts/config.py full
1719- scripts/config.py unset MBEDTLS_CIPHER_C
1720- # Don't pull in cipher via PSA mechanisms
1721- # (currently ignored anyway because we completely disable PSA)
1722- scripts/config.py unset MBEDTLS_PSA_CRYPTO_CONFIG
1723- # Disable features that depend on CIPHER_C
1724- scripts/config.py unset MBEDTLS_CMAC_C
1725- scripts/config.py unset MBEDTLS_NIST_KW_C
1726- scripts/config.py unset MBEDTLS_PSA_CRYPTO_C
1727- scripts/config.py unset MBEDTLS_PSA_CRYPTO_CLIENT
1728- scripts/config.py unset MBEDTLS_SSL_TLS_C
1729- scripts/config.py unset MBEDTLS_SSL_TICKET_C
1730- # Disable features that depend on PSA_CRYPTO_C
1731- scripts/config.py unset MBEDTLS_PSA_CRYPTO_SE_C
1732- scripts/config.py unset MBEDTLS_PSA_CRYPTO_STORAGE_C
1733- scripts/config.py unset MBEDTLS_USE_PSA_CRYPTO
1734- scripts/config.py unset MBEDTLS_LMS_C
1735- scripts/config.py unset MBEDTLS_LMS_PRIVATE
1736-
1737- msg " test: full no CIPHER no PSA_CRYPTO_C"
1738- make test
1739- }
1740-
1741- # This is a common configurator and test function that is used in:
1742- # - component_test_full_no_cipher_with_psa_crypto
1743- # - component_test_full_no_cipher_with_psa_crypto_config
1744- # It accepts 2 input parameters:
1745- # - $1: boolean value which basically reflects status of MBEDTLS_PSA_CRYPTO_CONFIG
1746- # - $2: a text string which describes the test component
1747- common_test_full_no_cipher_with_psa_crypto () {
1748- USE_CRYPTO_CONFIG=" $1 "
1749- COMPONENT_DESCRIPTION=" $2 "
1750-
1751- msg " build: $COMPONENT_DESCRIPTION "
1717+ component_test_full_no_cipher () {
1718+ msg " build: full no CIPHER"
17521719
17531720 scripts/config.py full
17541721 scripts/config.py unset MBEDTLS_CIPHER_C
17551722
1756- if [ " $USE_CRYPTO_CONFIG " -eq 1 ]; then
1757- # The built-in implementation of the following algs/key-types depends
1758- # on CIPHER_C so we disable them.
1759- # This does not hold for KEY_TYPE_CHACHA20 and ALG_CHACHA20_POLY1305
1760- # so we keep them enabled.
1761- scripts/config.py -f $CRYPTO_CONFIG_H unset PSA_WANT_ALG_CCM_STAR_NO_TAG
1762- scripts/config.py -f $CRYPTO_CONFIG_H unset PSA_WANT_ALG_CMAC
1763- scripts/config.py -f $CRYPTO_CONFIG_H unset PSA_WANT_ALG_CBC_NO_PADDING
1764- scripts/config.py -f $CRYPTO_CONFIG_H unset PSA_WANT_ALG_CBC_PKCS7
1765- scripts/config.py -f $CRYPTO_CONFIG_H unset PSA_WANT_ALG_CFB
1766- scripts/config.py -f $CRYPTO_CONFIG_H unset PSA_WANT_ALG_CTR
1767- scripts/config.py -f $CRYPTO_CONFIG_H unset PSA_WANT_ALG_ECB_NO_PADDING
1768- scripts/config.py -f $CRYPTO_CONFIG_H unset PSA_WANT_ALG_OFB
1769- scripts/config.py -f $CRYPTO_CONFIG_H unset PSA_WANT_ALG_PBKDF2_AES_CMAC_PRF_128
1770- scripts/config.py -f $CRYPTO_CONFIG_H unset PSA_WANT_ALG_STREAM_CIPHER
1771- scripts/config.py -f $CRYPTO_CONFIG_H unset PSA_WANT_KEY_TYPE_DES
1772- else
1773- # Don't pull in cipher via PSA mechanisms
1774- scripts/config.py unset MBEDTLS_PSA_CRYPTO_CONFIG
1775- # Disable cipher modes/keys that make PSA depend on CIPHER_C.
1776- # Keep CHACHA20 and CHACHAPOLY enabled since they do not depend on CIPHER_C.
1777- scripts/config.py unset-all MBEDTLS_CIPHER_MODE
1778- fi
1723+ # The built-in implementation of the following algs/key-types depends
1724+ # on CIPHER_C so we disable them.
1725+ # This does not hold for KEY_TYPE_CHACHA20 and ALG_CHACHA20_POLY1305
1726+ # so we keep them enabled.
1727+ scripts/config.py -f $CRYPTO_CONFIG_H unset PSA_WANT_ALG_CCM_STAR_NO_TAG
1728+ scripts/config.py -f $CRYPTO_CONFIG_H unset PSA_WANT_ALG_CMAC
1729+ scripts/config.py -f $CRYPTO_CONFIG_H unset PSA_WANT_ALG_CBC_NO_PADDING
1730+ scripts/config.py -f $CRYPTO_CONFIG_H unset PSA_WANT_ALG_CBC_PKCS7
1731+ scripts/config.py -f $CRYPTO_CONFIG_H unset PSA_WANT_ALG_CFB
1732+ scripts/config.py -f $CRYPTO_CONFIG_H unset PSA_WANT_ALG_CTR
1733+ scripts/config.py -f $CRYPTO_CONFIG_H unset PSA_WANT_ALG_ECB_NO_PADDING
1734+ scripts/config.py -f $CRYPTO_CONFIG_H unset PSA_WANT_ALG_OFB
1735+ scripts/config.py -f $CRYPTO_CONFIG_H unset PSA_WANT_ALG_PBKDF2_AES_CMAC_PRF_128
1736+ scripts/config.py -f $CRYPTO_CONFIG_H unset PSA_WANT_ALG_STREAM_CIPHER
1737+ scripts/config.py -f $CRYPTO_CONFIG_H unset PSA_WANT_KEY_TYPE_DES
1738+
17791739 # The following modules directly depends on CIPHER_C
17801740 scripts/config.py unset MBEDTLS_CMAC_C
17811741 scripts/config.py unset MBEDTLS_NIST_KW_C
@@ -1785,18 +1745,10 @@ common_test_full_no_cipher_with_psa_crypto () {
17851745 # Ensure that CIPHER_C was not re-enabled
17861746 not grep mbedtls_cipher_init library/cipher.o
17871747
1788- msg " test: $COMPONENT_DESCRIPTION "
1748+ msg " test: full no CIPHER "
17891749 make test
17901750}
17911751
1792- component_test_full_no_cipher_with_psa_crypto () {
1793- common_test_full_no_cipher_with_psa_crypto 0 " full no CIPHER no CRYPTO_CONFIG"
1794- }
1795-
1796- component_test_full_no_cipher_with_psa_crypto_config () {
1797- common_test_full_no_cipher_with_psa_crypto 1 " full no CIPHER"
1798- }
1799-
18001752component_test_full_no_ccm () {
18011753 msg " build: full no PSA_WANT_ALG_CCM"
18021754
@@ -1850,60 +1802,6 @@ component_test_full_no_ccm_star_no_tag() {
18501802 make test
18511803}
18521804
1853- component_test_full_no_bignum () {
1854- msg " build: full minus bignum"
1855- scripts/config.py full
1856- scripts/config.py unset MBEDTLS_BIGNUM_C
1857- # Direct dependencies of bignum
1858- scripts/config.py unset MBEDTLS_ECP_C
1859- scripts/config.py unset MBEDTLS_RSA_C
1860- scripts/config.py unset MBEDTLS_DHM_C
1861- # Direct dependencies of ECP
1862- scripts/config.py unset MBEDTLS_ECDH_C
1863- scripts/config.py unset MBEDTLS_ECDSA_C
1864- scripts/config.py unset MBEDTLS_ECJPAKE_C
1865- scripts/config.py unset MBEDTLS_ECP_RESTARTABLE
1866- # Disable what auto-enables ECP_LIGHT
1867- scripts/config.py unset MBEDTLS_PK_PARSE_EC_EXTENDED
1868- scripts/config.py unset MBEDTLS_PK_PARSE_EC_COMPRESSED
1869- # Indirect dependencies of ECP
1870- scripts/config.py unset MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED
1871- scripts/config.py unset MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED
1872- scripts/config.py unset MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED
1873- scripts/config.py unset MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED
1874- scripts/config.py unset MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
1875- scripts/config.py unset MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED
1876- scripts/config.py unset MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED
1877- scripts/config.py unset MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED
1878- # Direct dependencies of DHM
1879- scripts/config.py unset MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED
1880- # Direct dependencies of RSA
1881- scripts/config.py unset MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED
1882- scripts/config.py unset MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED
1883- scripts/config.py unset MBEDTLS_KEY_EXCHANGE_RSA_ENABLED
1884- scripts/config.py unset MBEDTLS_X509_RSASSA_PSS_SUPPORT
1885- # PK and its dependencies
1886- scripts/config.py unset MBEDTLS_PK_C
1887- scripts/config.py unset MBEDTLS_PK_PARSE_C
1888- scripts/config.py unset MBEDTLS_PK_WRITE_C
1889- scripts/config.py unset MBEDTLS_X509_USE_C
1890- scripts/config.py unset MBEDTLS_X509_CRT_PARSE_C
1891- scripts/config.py unset MBEDTLS_X509_CRL_PARSE_C
1892- scripts/config.py unset MBEDTLS_X509_CSR_PARSE_C
1893- scripts/config.py unset MBEDTLS_X509_CREATE_C
1894- scripts/config.py unset MBEDTLS_X509_CRT_WRITE_C
1895- scripts/config.py unset MBEDTLS_X509_CSR_WRITE_C
1896- scripts/config.py unset MBEDTLS_PKCS7_C
1897- scripts/config.py unset MBEDTLS_SSL_SERVER_NAME_INDICATION
1898- scripts/config.py unset MBEDTLS_SSL_ASYNC_PRIVATE
1899- scripts/config.py unset MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK
1900-
1901- make
1902-
1903- msg " test: full minus bignum"
1904- make test
1905- }
1906-
19071805component_test_tls1_2_default_stream_cipher_only () {
19081806 msg " build: default with only stream cipher use psa"
19091807
@@ -4479,15 +4377,22 @@ component_test_ssl_alloc_buffer_and_mfl () {
44794377
44804378component_test_when_no_ciphersuites_have_mac () {
44814379 msg " build: when no ciphersuites have MAC"
4380+ scripts/config.py set MBEDTLS_PSA_CRYPTO_CONFIG
4381+ scripts/config.py -f " $CRYPTO_CONFIG_H " unset PSA_WANT_ALG_CBC_NO_PADDING
4382+ scripts/config.py -f " $CRYPTO_CONFIG_H " unset PSA_WANT_ALG_CBC_PKCS7
4383+ scripts/config.py -f " $CRYPTO_CONFIG_H " unset PSA_WANT_ALG_CMAC
4384+ scripts/config.py -f " $CRYPTO_CONFIG_H " unset PSA_WANT_ALG_PBKDF2_AES_CMAC_PRF_128
4385+
44824386 scripts/config.py unset MBEDTLS_CIPHER_NULL_CIPHER
44834387 scripts/config.py unset MBEDTLS_CIPHER_MODE_CBC
44844388 scripts/config.py unset MBEDTLS_CMAC_C
4389+
44854390 make
44864391
4487- msg " test: !MBEDTLS_SSL_SOME_MODES_USE_MAC "
4392+ msg " test: !MBEDTLS_SSL_SOME_SUITES_USE_MAC "
44884393 make test
44894394
4490- msg " test ssl-opt.sh: !MBEDTLS_SSL_SOME_MODES_USE_MAC "
4395+ msg " test ssl-opt.sh: !MBEDTLS_SSL_SOME_SUITES_USE_MAC "
44914396 tests/ssl-opt.sh -f ' Default\|EtM' -e ' without EtM'
44924397}
44934398
0 commit comments