Skip to content

v3.4.0

Latest

Choose a tag to compare

@miladrahimi miladrahimi released this 01 Aug 14:37
fb06348

What's Changed

Added

  • Support for the RFC 9864 fully-specified EdDSA algorithms Ed25519 and Ed448 (#69)
    • Ed25519 uses the same libsodium keys and signatures as the existing EdDSA support — only the token's alg header differs, so it needs the sodium extension too.
    • Ed448 is EdDSA over Curve448 and runs on OpenSSL instead of Sodium. It requires PHP 8.4 or later; on older versions, constructing Ed448PrivateKey / Ed448PublicKey throws.

Changed

  • The EdDSA signer and verifier now throw SigningException / InvalidSignatureException instead of RuntimeException when the Sodium functions are unavailable, so every failure stays inside the JwtException hierarchy (#68)
  • RSA-PSS verification raises one shared "The signature is not valid." message on every inconsistency, so the outcome reveals nothing about which check failed (#68)
  • Internal maintainability cleanups surfaced by SonarQube (#68)

Documentation

  • README sections and runnable examples for both new algorithms — examples/ed25519.php and examples/ed448.php (#69)
  • docs/ARCHITECTURE.md, docs/ADDING_AN_ALGORITHM.md, and docs/TESTING.md updated for the Curve448 path (#69)

Tests

  • Unit, example, and cross-library interop coverage for Ed25519 and Ed448 (#69)
  • RSA-PSS encode vectors now pin emBits and the MGF1 masking behaviour, killing the last surviving mutants (#70)

CI & Tooling

  • Scrutinizer replaced with SonarQube Cloud automatic analysis, plus stricter phpcs and PHPStan (level 10) configuration (#67)
  • GitHub Actions pinned to full commit SHAs (#67)

Upgrading

Existing EdDSA tokens remain valid and keep verifying — adopt Ed25519 only if you want the RFC 9864 alg name.
One nuance: on the "Sodium functions unavailable" path the EdDSA signer and verifier no longer throw RuntimeException. If you catch that type there, catch JwtException instead.

Full Changelog: v3.3.1...v3.4.0