This document is temporary; it lists tasks to achieve G1 as described in strategy.md while the strategy is being reviewed - once that's done, corresponding github issues will be created and this document removed.
For all of the tasks here, no specific testing is expected to be required, beyond passing the existing tests in a build with MBEDTLS_USE_PSA_ENABLED, see testing.md.
psa_hash in all of X.509Conditionally on MBEDTLS_USE_PSA_CRYPTO, replace all remaining calls to mbedtls_md() or mbedtls_sha1_ret() by calls psa_hash functions, namely:
mbedtls_md() in x509_crt_verifycrl() in x509_crt.cmbedtls_md() in mbedtls_x509write_crt_der() in x509write_crt.cmbedtls_sha1_ret() in mbedtls_x509write_crt_set_subject_key_identifier()inx509write_crt.c`mbedtls_sha1_ret() in mbedtls_x509write_crt_set_authority_key_identifier()inx509write_crt.c`x509_crt_check_signature() in x509_crt.c, but might want to replace multi-part with single-part.mbedtls_x509write_csr_der_internal() in x509write_csr.c, but might want to replace multi-part with single-part.mbedtls_md_hmac_xxx() in mbedtls_ssl_decrypt_buf() and mbedtls_ssl_encrypt_buf(), but excludes the call in mbedtls_ssl_cf_hmad() (which it its own task).transform structure to hold a PSA context instead of an MD context. Note: might keep the MD context in parallel until the constant-time part is done as well.TODO: study this better so it can be estimated.
This is mbedtls_ssl_cf_hmac(). The PSA code might look a bit different as we'll probably need to store the HMAC key somewhere and compute the ipad/opad explicitly instead of using (the internals of) the MD layers for that.
TODO: study this better so it can be estimated.
mbedtls_cipher_setup_psa() and related code to support other ciphers than AES that can be used in TLS: ARIA (depends on #4959), Camellia, ChachaPoly.test_suite_cipher to test those new ciphers as AES-based cipher are already testedcipher_setup_psa() is called from TLS coderun_test_psa() in ssl-opt.shmbedtls_pk_sign() use PSA for ECDSA operationsPK_OPAQUE contexts, but this task is about doing it for regulard ECKEY/ECDSA contexts.PK_OPAQUE contextsmbedtls_pk_sign() use PSA for RSA operationsPK_RSA contextmbedtls_pk_verify() use PSA for RSA operationsPK_RSA contextmbedtls_pk_verify_ext() use PSA for RSA operationsPK_RSA context!MBEDTLS_USE_PSA_CRYPTORISK: see psa-limitations.md
mbedtls_pk_encrypt() use PSA for RSA operationsPK_RSA contextmbedtls_pk_decrypt() use PSA for RSA operationsPK_RSA contextNote: future task in this section depend on this one, but not on each other.
This may be hard, see psa-limitations.md
Use PSA for all EC J-PAKE operations in TLS (both sides). (TODO: consider how this could be split.)