wolfPSA
wolfPSA implements the PSA Crypto API on wolfCrypt and serves wolfTrust guests from a TrustZone Secure image. I added tests and fixes, and trimmed it to fit.
Main changes
- Shrank wolfPSA for a Secure image: compile only provided algorithms, use SP P-256 directly, stream multipart AEAD.#63
- Shared duplicated cipher, AEAD, signing and key storage paths with no behavior change, saving about 1.6 KB.#74
- Ran one-shot AES-CCM through streaming CCM code and added an opt-in GCM stream path.#81
- Fixed TLS 1.2 PRF key derivation to pass a MAC algorithm id to wc_PRF_TLS.#24
- Added testing, validation and fixes from security review findings.#9
One design choice
One-shot GCM through the GCM stream is opt-in, because ports that run GCM as one whole message cannot support it. Those ports stop the build with an #error when the option is set, so the failure is loud instead of silent.
A bug I fixed
The TLS 1.2 PRF code passed a hash enum to wc_PRF_TLS, which expects a MAC enum, so SHA-256 picked the wrong hash. I added a mapping function that accepts only SHA-256, SHA-384 and SHA-512, and fixed the tests' reference calls. (#24)
How it was checked
| PR | Evidence |
|---|---|
| #24 | test_tls12_prf compares output with wc_PRF_TLS(sha256_mac); found by PSA-Arch dev_apis on M33MU. |
| #63 | New secure-set CI build under -Werror and ASAN rejects six malformed ECC keys. |
| #74 | Measured 1,636 B saved on STM32L562 and 1,604 B on STM32H563, RAM unchanged. |
What is not done yet
The GCM stream option is off by default and only helps builds using software GCM. Size numbers come from wolfTrust Secure images on STM32L562 and STM32H563.
All my merged pull requests 5 in wolfSSL/wolfPSA
- #81Trim the Secure PSA build with shared AEAD paths and narrower gates
- #74Share duplicated cipher, AEAD, signing and key storage paths
- #63Shrink wolfPSA for a Secure image and restore ECC import checks without XMSS
- #24Fix TLS 1.2 PRF KDFs to pass a MAC algorithm id to wc_PRF_TLS
- #9Add Testing Validation and Fixes for wolfPSA