Skip to content

v3.5

Latest

Choose a tag to compare

@Xor-el Xor-el released this 31 Oct 10:17
· 1 commit to master since this release

What's New

  • HPKE (RFC 9180): all four modes, five DHKEM suites, AES-GCM, ChaCha20-Poly1305 and export-only (#198)
  • Trust anchor name constraints are enforced in path validation (#208)
  • Path validation and path building report a machine-readable failure reason: expired, revoked, no trust anchor, path too long, ... (#215, #217)
  • IPkcs12Store.GetCertificates, and GetCertificateChain from any certificate entry (#203)
  • Callers can inject the RNG used by the constant-time EC multipliers (#202)
  • TCryptoLibConfig.Pkcs12.StoreIterationCount sets the PKCS#12 write iteration count; the MAC uses twice that (#216)
  • OpenSSL TRUSTED CERTIFICATE PEM blocks can be read and written (#206)

Security Hardening

  • RSA PKCS#1 v1.5 verification rejects a DigestInfo without NULL parameters by default, including certificate, CRL, OCSP, CMS and PKCS#10 signatures (#208-#210)
  • RSA signatures must be exactly the modulus length (RFC 8017 8.1.2, 8.2.2) (#211)
  • PKCS#12 stores are written with 300,000 iterations and a 600,000-iteration MAC (was 1,024); re-saving a loaded store keeps its MAC settings (#216)
  • Raw-byte private keys (Ed25519, Ed448, X25519, X448, BIP-340, ML-DSA, ML-KEM, SLH-DSA) are zeroized on destroy; the HMAC k-calculator wipes the private scalar (#201, #216)
  • CRL signers are validated against the supplied trust anchors only; path length ignores self-issued intermediates; excluded certificates are honoured when building (#206)
  • Path building no longer loops when no CRL is found for a shared issuer name (#206), and reports a bad signature on a certificate issued by a trust anchor (#217)
  • Indirect CRL entries are matched by issuer as well as serial number (#215)

Fixes

  • Equals through IAsymmetricKeyParameter compared only the public/private flag; it now compares key material (#204)
  • Encrypted PKCS#8 (PBES2) and DEK-Info PEM keys derive from the passphrase's UTF-8 bytes, matching OpenSSL (#205)
  • Empty encodings raise instead of dereferencing nil, which crashed FPC libraries on Android (#213)
  • DerEnumerated accepts negative values (#216)
  • The ECDH KEK generator includes the user keying material (entityUInfo) in the shared info, per RFC 5753 7.2 (#206)

Breaking Changes

Before (v3.4) Now
A DigestInfo without NULL parameters verified Rejected by default. Set TCryptoLibConfig.Pkcs1.StrictDigestInfo := False to accept it (#210)
An RSA signature shorter than the modulus (leading zeros stripped) verified Rejected for PKCS#1 v1.5 and PSS (#211)
TPkcs1Encoding.StrictLengthEnabled TCryptoLibConfig.Pkcs1.StrictLength (#209)
TTrustAnchor.Create(ACaName: String, ...) and ITrustAnchor.CAName TTrustAnchor.Create(ACaPrincipal: IX509Name, ...); compare or print the CA with CA.ToString() (#206)
Keys encrypted (PBES2 or DEK-Info) with a non-ASCII passphrase, derived from code-page bytes Derived from UTF-8. Decrypt with v3.4 and re-encrypt. ASCII passphrases are unchanged (#205)
PKCS#12 written with 1,024 iterations 300,000 (MAC 600,000), so saving is slower. Change it with TCryptoLibConfig.Pkcs12.StoreIterationCount (#216)
KEKs derived with user keying material Differ from v3.4 (see Fixes) (#206)
ICertStatus.Status / SetStatus and TCertStatus.Unrevoked / Undetermined IsRevoked, ReasonCode, Reason, SetRevoked, SetUnrevoked (#215)
IECCTMultiplierFactory with one CreateCTMultiplier Custom factories also implement CreateCTMultiplier(ARandom, ABlindBits) and CreateBasePointCTMultiplier(ARandom) (#202)

Custom implementations of IHkdfBytesGenerator, IPkixParameters, IPkixBuilderParameters, IX509Crl and IDerEnumerated must add the new members (interface GUIDs are unchanged).

Other

  • FreePascal tests run on Android (#214); Android and iOS test host fixes, PowerPC64 QEMU CI fix, expanded test coverage

Full Changelog: v3.4...v3.5