Skip to content

Fixes from static analyzer#5

Merged
rizlik merged 25 commits intowolfSSL:masterfrom
danielinux:fixes-20260310
Mar 11, 2026
Merged

Fixes from static analyzer#5
rizlik merged 25 commits intowolfSSL:masterfrom
danielinux:fixes-20260310

Conversation

@danielinux
Copy link
Member

  • 20d9e39 F/011 Guard NULL in psa_key_derivation_get_capacity
  • b04e6c3 F/003 Reject AES keys for ChaCha20-Poly1305
  • 04f5550 F/014 Fix EdDSA length handling on 64-bit
  • e9b00d2 F/009 Fix LMS and XMSS output lengths on 64-bit
  • 44005a6 F/001 Zeroize AEAD keys before free
  • 8cf6e69 F/002 Zeroize KDF secret buffers before free
  • 7d6b0ac F/007 Guard AEAD buffer growth overflow
  • 3f80c28 F/008 Guard KDF buffer growth overflow
  • 8070a3a F/013 Free volatile key data on export rejection
  • 003627c F/015 Fix PQ key-type switch fallthrough
  • b964bd9 F/012 Fix RSA-PSS MGF and verify handling
  • 8e947b8 F/004 Use constant-time compare for MAC verify
  • a826de8 F/005 Use constant-time compare for KDF verify
  • d500173 F/006 Use constant-time compare for RSA verify
  • b720999 F/010 Use constant-time compare for hash verify
  • ba7aea9 F/016 Use Dilithium export APIs for ML-DSA keys

Copilot AI review requested due to automatic review settings March 11, 2026 09:15
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Addresses a set of static-analyzer findings across the wolfPSA PSA engine implementation, focusing on correctness on 64-bit platforms, constant-time verification, buffer overflow/zeroization hardening, and added regression tests.

Changes:

  • Harden crypto verification and secret handling (constant-time compares, key/secret zeroization, overflow guards).
  • Fix algorithm/key-type correctness and size/length handling (RSA-PSS MGF/padding, AEAD key-type checks, EdDSA/LMS/XMSS 64-bit length fixes, PQ key-type switch fix).
  • Add/extend PSA server tests, including a new RSA-PSS interop test and additional negative/regression cases.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
test/psa_server/psa_rsa_pss_interop_test.c New RSA-PSS interop/regression test between PSA and wolfCrypt.
test/psa_server/psa_api_test.c Adds skipped-test reporting and new regression tests (ChaCha20/AES key rejection, Ed25519 signature length, KDF NULL capacity).
test/Makefile Builds and links the new RSA-PSS interop test binary.
src/psa_rsa.c Fixes RSA-PSS MGF selection and verification flow; switches to constant-time compare for PKCS#1 v1.5 path.
src/psa_pq.c Fixes key-type support/size checks for LMS/XMSS to return success instead of falling through.
src/psa_mldsa.c Exports ML-DSA keys via Dilithium export APIs (instead of copying internal buffers).
src/psa_mac.c Switches MAC verification to constant-time compare.
src/psa_lms_xmss.c Fixes 64-bit length handling by avoiding size_t*word32* casts.
src/psa_key_storage.c Frees volatile key material when public-key export rejects unsupported types.
src/psa_key_derivation.c Adds NULL guard, overflow guard, buffer zeroization, and constant-time compare for derivation verification.
src/psa_hash_engine.c Switches hash verification/compare to constant-time compare.
src/psa_ed25519_ed448.c Fixes Ed25519/Ed448 length handling by avoiding size_t*word32* casts.
src/psa_aead.c Adds overflow guard and key zeroization; tightens ChaCha20-Poly1305 key-type checks.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@danielinux
Copy link
Member Author

All comments addressed

@danielinux danielinux requested a review from rizlik March 11, 2026 11:46
@rizlik rizlik merged commit 8c17d86 into wolfSSL:master Mar 11, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants