Skip to content

pkcs7: add RSA-PSS support for SignedData#9742

Open
sameehj wants to merge 1 commit intowolfSSL:masterfrom
sameehj:pkcs7-rsa-pss
Open

pkcs7: add RSA-PSS support for SignedData#9742
sameehj wants to merge 1 commit intowolfSSL:masterfrom
sameehj:pkcs7-rsa-pss

Conversation

@sameehj
Copy link
Contributor

@sameehj sameehj commented Feb 5, 2026

Add full RSA-PSS (RSASSA-PSS) support to PKCS#7 SignedData encoding and verification.

This change enables SignerInfo.signatureAlgorithm to use id-RSASSA-PSS with explicit RSASSA-PSS-params (hash, MGF1, salt length), as required by RFC 4055 and CMS profiles.

Key changes:

  • Add RSA-PSS encode and verify paths for PKCS7 SignedData
  • Encode full RSASSA-PSS AlgorithmIdentifier parameters
  • Decode RSA-PSS parameters from SignerInfo for verification
  • Treat RSA-PSS like ECDSA (sign raw digest, not DigestInfo)
  • Fix certificate signatureAlgorithm parameter length handling
  • Add API test coverage for RSA-PSS SignedData

This resolves failures when using RSA-PSS signer certificates (e.g. -173 invalid signature algorithm) and maintains backward compatibility with RSA PKCS#1 v1.5 and ECDSA.


Testing

  • API: New test test_wc_PKCS7_EncodeSignedData_RSA_PSS (guarded by HAVE_PKCS7, WC_RSA_PSS, RSA, filesystem, SHA-256). Uses certs/rsapss/client-rsapss.der and client-rsapss-priv.der; encodes SignedData and optionally round-trip verifies.
  • CI: os-check.yml updated with build --enable-pkcs7 CPPFLAGS=-DWC_RSA_PSS.
  • Manual: Encode/verify with RSA-PSS signer cert; existing RSA and ECDSA SignedData tests unchanged.

Checklist

  • added tests
  • updated/added doxygen (PKCS7_RSA_PSS page; cryptocb RSA-PSS notes; pkcs7.h EncodeSignedData \ref)
  • updated appropriate READMEs (examples/configs/README.md; user_settings_pkcs7.h with WC_RSA_PSS)
  • Updated manual and documentation (doxygen; main README/ChangeLog at merge time)

@sameehj sameehj force-pushed the pkcs7-rsa-pss branch 6 times, most recently from c4749c5 to 38bcb07 Compare February 6, 2026 10:15
@sameehj
Copy link
Contributor Author

sameehj commented Feb 6, 2026

retest this please

@sameehj sameehj force-pushed the pkcs7-rsa-pss branch 3 times, most recently from 75dec4a to ba4a84f Compare February 6, 2026 14:10
Add full RSA-PSS (RSASSA-PSS) support to PKCS#7 SignedData
encoding and verification.

This change enables SignerInfo.signatureAlgorithm to use
id-RSASSA-PSS with explicit RSASSA-PSS-params (hash, MGF1,
salt length), as required by RFC 4055 and CMS profiles.

Key changes:
- Add RSA-PSS encode and verify paths for PKCS7 SignedData
- Encode full RSASSA-PSS AlgorithmIdentifier parameters
- Decode RSA-PSS parameters from SignerInfo for verification
- Treat RSA-PSS like ECDSA (sign raw digest, not DigestInfo)
- Fix certificate signatureAlgorithm parameter length handling
- Add API test coverage for RSA-PSS SignedData

This resolves failures when using RSA-PSS signer certificates
(e.g. -173 invalid signature algorithm) and maintains backward
compatibility with RSA PKCS#1 v1.5 and ECDSA.

Signed-off-by: Sameeh Jubran <sameeh@wolfssl.com>
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.

1 participant