You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit e8b5cf1
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: docs/releasenotes.html
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -131,6 +131,7 @@ <h3>2.1.2 Defects Fixed</h3>
131
131
<li>An OCSP response carrying no nextUpdate could be cached and reused as though it stated a validity interval, so a response could go on answering for a certificate after the responder had newer information about it - after a revocation, in particular. Any such reuse was bounded only by garbage collection rather than by an interval: OcspCache holds each responder's response map through a WeakReference, itself in a WeakHashMap, and nothing else refers to that map once the call returns, so entries last until the next collection. That is unpredictable rather than long - short on a busy JVM, potentially much longer on a large heap that collects rarely - and it is not a window the responder or the caller had any say in. RFC 6960 sec. 4.2.2.1 says the opposite of what that assumes: "if nextUpdate is not set, the responder is indicating that newer revocation information is available all the time", which is a statement that there is no interval to reuse the response over, not that it never expires. OcspCache now separates the two questions it had been asking with one method: a response arriving from the responder is accepted as before, whether or not it states a nextUpdate, while only a response that states one may be served from the cache afterwards. Nothing is rejected that was previously accepted - a responder that omits nextUpdate simply costs another request per validation, which is what "available all the time" asks for. Additionally, both the cached and the caller-supplied (stapled) paths now apply RFC 6960 sec. 4.2.2.1's other freshness rule, "responses whose thisUpdate time is later than the local system time SHOULD be considered unreliable", which neither had checked: a response dated ahead of the time being validated for by more than a 15 minute clock-skew allowance is treated as unreliable, raising "OCSP response not yet valid" on the stapled path.</li>
132
132
<li>None of the javax.crypto.KEM encapsulators destroyed the SecretWithEncapsulation the mechanism handed them, so each left the mechanism's own session key live in the heap for as long as the KEM.Encapsulator object was reachable - ML-KEM, HQC, NTRU, NTRU Prime and SM9 were all affected. Clearing the derived key was not enough to cover it: SecretWithEncapsulationImpl.getSecret() and getEncapsulation() hand back clones of their internal arrays, so KdfUtil.makeKeyBytes clearing the secret clone it is passed never reached the session key inside, and only destroy() does. Each encapsulator now takes the encapsulation and the shared secret and then destroys the SecretWithEncapsulation in a finally block, as the sibling Cipher services in the same packages already did, and as the ISO/IEC 18033-2 FrodoKEM and Classic McEliece encapsulators added in this release do. The order matters, since destroy() clears the encapsulation as well as the session key. Nothing observable changes for a caller - the shared secret and encapsulation returned are the same as before, and are the caller's own copies.</li>
133
133
<li>The KEM KeyGenerator services had the same missing key-size check as the javax.crypto.KEM ones described under Additional Features below, and are corrected here for the older API too: a KEMGenerateSpec or KEMExtractSpec built withNoKdf() and given a key size larger than the mechanism's session key overran the shared secret and threw ArrayIndexOutOfBoundsException out of KeyGenerator.generateKey(), which has no way to describe such a failure. The conventional 256-bit request failed that way for FrodoKEM's 976 parameter sets, whose session key is 192 bits, as did any request above 256 bits for ML-KEM, Classic McEliece and the composite KEMs, whose session keys are 256 bits. These services take a KEMKDFSpec rather than a KTSParameterSpec and so never pass through KdfUtil.resolveKemSpec, where the KEM services now have their spec validated up front; the check therefore sits in KdfUtil.makeKeyBytes itself, which covers them and any future caller of it. The request is refused with an IllegalArgumentException naming both sizes rather than quietly met at the shorter length, since a caller that asked for a 256-bit AES key and was handed a 192-bit one has no way of telling. A request the session key can satisfy is unaffected and produces exactly the key material it did before, and the Cipher and KTS key-wrapping paths were never affected - there the requested size is only an upper bound on a wrapping key both parties derive the same way from the same secret, so WrapUtil clamps it to the secret it has.</li>
134
+
<li>The PKIX certification path builders - CertPathBuilder "PKIX" / "RFC3280" and the "RFC3281" attribute certificate path builder - kept the failure cause of a build in an instance field that was never cleared, so a CertPathBuilder reused for a further build could report a stale diagnostic: a build that found no certification path while recording no failure of its own, for example with the target certificate excluded or every candidate path cut off by the maximum path length, reported the previous build's failure instead of "Unable to find certificate chain.". The exception type and the result of a successful build were unaffected, as was any build with a freshly obtained CertPathBuilder. The field is now cleared at the start of each build, and the recursive search now removes each certificate from its working path in a finally block, so every exit - a successful build included, the returned certification path being built from a copy of the working path - restores the path for the next candidate, where previously only the exits without a result did.</li>
134
135
<li>The BCJSSE provider now only computes active early key share groups for clients offering TLS 1.3+. Previously it was computed for all connections, which was mostly harmless, but could generate misleading log messages (at WARNING level) for servers or pre-TLS1.3 clients where the logged condition was irrelevant (github #2392).</li>
135
136
<li>Initialising a BC signature, cipher or key-agreement service with a private key from another provider whose key material is not accessible - a hardware-backed key whose getModulus() / getX() / getS() / getParams() throws, as an IBM CCA RSAPrivateHWKey does with "Hardware error, function getModulus has no meaning in hardware" - let that provider-specific unchecked UnsupportedOperationException escape a method declared to throw only InvalidKeyException, so an mTLS handshake failed with a raw hardware error rather than the documented type. The key-parameter helpers that examine a key through a java.security.interfaces or javax.crypto.interfaces type a foreign provider may implement - RSAUtil, DSAUtil, ECUtil (its java.security.interfaces.ECPrivateKey branch), both DHUtil copies and ElGamalUtil - now catch a failure to read the key's parameters and raise InvalidKeyException with the original exception chained as its cause. A caller, or a JSSE layer that keys its provider fallback on InvalidKeyException, sees the declared type and a clear message. This does not let BC sign or decrypt with a non-exportable hardware key, which is not possible; it makes the refusal in contract. BC's own keys and any exportable key are unaffected (github #1440).</li>
136
137
<li>org.bouncycastle.operator.DefaultKemEncapsulationLengthProvider.getEncapsulationLength() looked its argument up in a table of the KEMs whose encapsulation lengths are registered - ML-KEM, NTRU, HQC, FrodoKEM and composite ML-KEM - and dereferenced the result without checking it. A CMS RFC 9629 KEMRecipientInfo recipient using any other KEM which does register a key wrapping cipher, BIKE, NTRU+ or SMAUG-T, got as far as the wrap and then failed with a NullPointerException carrying no indication of which algorithm was at fault. The lookup now throws IllegalArgumentException naming the KEM's OID, as the sibling DefaultKemAlgorithmIdentifierFinder does, and the contract is documented on the KemEncapsulationLengthProvider interface (github #2398).</li>
0 commit comments