All notable changes to this project are documented in this file.
This release introduces the extension points needed to perform RSA signing and RSA key-transport decryption through a remote Private Key Agent (PKA), so that private keys are never loaded into the PHP process on those paths. No existing public method signatures changed, but see the behavior change below.
EncryptedKey::decrypt() now reads and enforces the <ds:DigestMethod> and
<xenc11:MGF> children of the <xenc:EncryptionMethod> element. Previously these
children were ignored:
- A non-SHA-1 digest/MGF is now either delegated to the PKA backend or
explicitly rejected with
UnsupportedAlgorithmException(localOpenSSLbackend), instead of silently weakening to SHA-1 or failing with an opaque OpenSSL error. - Peers that today send inconsistent-but-ignored digest/MGF children on otherwise-working SHA-1 ciphertext will now get an explicit error.
- Private Key Agent backends (
SimpleSAML\XMLSecurity\Backend\PrivateKeyAgent\):PrivateKeyAgentSignatureBackend(implementsSignatureBackend), hashes locally and delegates the raw RSA signature to the agent;verify()runs locally.PrivateKeyAgentEncryptionBackend(implementsEncryptionBackendand the newOAEPParametersAware), delegates RSA key-transport decryption to the agent;encrypt()runs locally. The agent's algorithms couple the OAEP digest and MGF1 hash one-to-one, so only matched pairs are supported and the default for a parameterlessxmlenc11#rsa-oaepdeviates from the W3C default of SHA-1, see "Operational requirements and limitations" in the README before deploying.- Supporting contracts and helpers:
TokenProvider,KeyNameResolver,StaticKeyNameResolver,FingerprintKeyNameResolver, and the internalAlgorithmMap/PrivateKeyAgentHttpClient.
- Capability interface
SimpleSAML\XMLSecurity\Backend\OAEPParametersAware(setOAEPParams(?string $digestAlg, ?string $mgf)) to carry OAEP digest/MGF to backends without changing theEncryptionBackendinterface. Implemented byOpenSSL,PrivateKeyAgentEncryptionBackend, andAbstractKeyTransporter. - Algorithm-factory closure registration
SignatureAlgorithmFactory::registerAlgorithmFactory()andKeyTransportAlgorithmFactory::registerAlgorithmFactory(), register a\Closure(KeyInterface, string): AlgorithmInterface. The existing blacklist applies unchanged;registerAlgorithm()is untouched. - Registrable algorithm wrappers
Alg\Signature\PrivateKeyAgentRSAandAlg\KeyTransport\PrivateKeyAgentRSAwith deterministic key-type routing: anX509Certificateroutes to the agent backend, anAsymmetricKey(PrivateKey/PublicKey) keeps the localOpenSSLbackend, any otherKeyInterfacefails closed. Routing is never a fallback-on-error. The injected PKA backend is treated as a prototype: each wrapper clones it, so one backend registered at boot safely serves any number of concurrent algorithm instances. - A dedicated marker interface
Exception\PrivateKeyAgentExceptionInterfaceand the agent-interaction exceptionsAuthenticationException,AuthorizationException,UnknownKeyException,AgentUnavailableException,AgentProtocolException,InvalidRequestException,MissingTokenException. - New hard dependencies for the HTTP transport:
psr/http-client,psr/http-message,psr/http-factory(PSR-18/PSR-17, injected via the constructor; no auto-discovery). - New hard dependency on the
ext-filterPHP extension. It is required byPrivateKeyAgentHttpClient, which usesfilter_var()withFILTER_VALIDATE_IP/FILTER_FLAG_IPV4to determine whether the configured agent URL points at a loopback address, so that plain HTTP is only accepted for local agents.ext-filteris enabled by default in PHP, but is now declared explicitly because the library depends on it.
OpenSSLnow implementsOAEPParametersAwareand fails closed withUnsupportedAlgorithmExceptionon any non-SHA-1 OAEP digest/MGF (on all PHP versions), instead of silently using SHA-1.
- Insecure algorithms stay blocked by default. SHA-1 signing
(
SIG_RSA_SHA1) and RSA v1.5 key transport (KEY_TRANSPORT_RSA_1_5) remain in each factory'sDEFAULT_BLACKLIST. Because the PKA wrappers are only built viagetAlgorithm(), a blacklisted algorithm throwsBlacklistedAlgorithmExceptionbefore any backend is reached. Unblocking them requires an explicit, operator-configured blacklist on the factory. - Transport security. The agent base URL must be
https://. Plainhttp://is only allowed via the explicitallowInsecureHttp: trueconstructor flag and is then further restricted to loopback hosts (localhost,127.0.0.0/8,::1), so the bearer token can never leave the host in cleartext. Both checks are validated fail-closed at construction. - Bearer tokens never appear in exception messages or logs; token parameters
carry
#[\SensitiveParameter]. - No fallback. When the agent is unreachable or fails, the operation raises a controlled exception and never falls back to a local private-key operation.