Skip to content

Commit 113a0b7

Browse files
committed
Remove the unreachable RFC 3281 attribute certificate cert-path services - the RFC3281 CertPathBuilder and CertPathValidator registrations, PKIXAttrCertPathBuilderSpi, PKIXAttrCertPathValidatorSpi, RFC3281CertPathUtilities and the attribute certificate signature check left with no caller - which have been uncallable since 1.52 because the X509AttributeCertStoreSelector they require cannot be carried by the PKIXExtendedParameters they read it back from.
1 parent 84e53bc commit 113a0b7

10 files changed

Lines changed: 1 addition & 1236 deletions

File tree

‎docs/releasenotes.html‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ <h3>2.1.4 Additional Notes</h3>
205205
<li>As announced in the 1.85 release notes, the deprecated ML-KEM (FIPS 203) implementation under org.bouncycastle.pqc.crypto.mlkem has been removed. Use the standardised implementation under org.bouncycastle.crypto instead (crypto.params.MLKEM* / crypto.generators.MLKEMKeyPairGenerator / crypto.kems.MLKEMGenerator and MLKEMExtractor), which is registered in the BC provider. The org.bouncycastle.pqc.crypto.util key-factory entries and org.bouncycastle.pqc.crypto.util.PQCOtherInfoGenerator - the only production callers still on the deprecated package - now use the canonical classes instead; PQCOtherInfoGenerator.PartyU/PartyV widen their constructor parameter from the pqc-side KEMParameters marker interface to CipherParameters so a canonical MLKEMParameters (which does not implement that marker interface) is still accepted alongside NTRUParameters, which does. No object identifiers are affected and existing ML-KEM certificates and keys decode exactly as before.</li>
206206
<li>As announced in the 1.85 release notes, the deprecated SLH-DSA (FIPS 205) implementation under org.bouncycastle.pqc.crypto.slhdsa has been removed. Use the standardised implementation under org.bouncycastle.crypto instead (crypto.params.SLHDSA* / crypto.generators.SLHDSAKeyPairGenerator / crypto.signers.SLHDSASigner and HashSLHDSASigner), which is registered in the BC provider. The org.bouncycastle.pqc.crypto.util key-factory entries - the only production callers still on the deprecated package - now use the canonical classes instead; no object identifiers are affected and existing SLH-DSA certificates and keys decode exactly as before.</li>
207207
<li>BCJSSE: server-side OCSP stapling is configured by the same system properties as SunJSSE, and like SunJSSE they are read per SSLContext rather than once per class load, so one process can host a context that staples and a context that does not. jdk.tls.server.enableStatusRequestExtension (default false) enables it; jdk.tls.stapling.cacheSize (256), jdk.tls.stapling.cacheLifetime (3600 seconds), jdk.tls.stapling.responseTimeout (5000 milliseconds), jdk.tls.stapling.responderURI, jdk.tls.stapling.responderOverride (false) and jdk.tls.stapling.ignoreExtensions configure it, with exactly zero for either cache setting meaning no limit of that kind rather than no caching. The response timeout is the exception to that reading: it bounds a handshake thread, where "no limit" is not something to configure by accident, so its minimum is one millisecond and a zero is refused with a warning and the default used in its place. A negative value is refused the same way whichever of these properties it is given to, the default being used instead, as it is for a value that is not a number. Two differences from SunJSSE are deliberate. First, jdk.tls.stapling.ignoreExtensions defaults to true here: the OCSP request extensions in question are the client's to choose and a nonce among them makes every response single-use, so honouring them would let a client force an outbound OCSP request per handshake, which is what the cache exists to prevent - RFC 6066 sec. 8 has the client naming extensions it "wishes the server to include" rather than extensions it is owed, and setting the property to false restores parity. What that forwards is the nonce, and only the nonce: an extension a client asks to have passed on is not one this server can promise anything about, and a response shaped by one client's extensions would be cached under the certificate alone and then relayed to clients that asked with different ones. A nonced request is answered outside the cache accordingly - neither served from it nor put into it - which is why honouring extensions costs an outbound request per handshake, and a nonced lookup that fails is not recorded against the shared request the other clients use. Second, a response stating no nextUpdate is never cached, where SunJSSE holds one for cacheLifetime; this matches how the CertPath validator side of the library already reads RFC 6960 sec. 4.2.2.1. One further property is specific to this implementation: org.bouncycastle.jsse.server.stapling.failureLifetime (60 seconds) sets how long a failed lookup suppresses further attempts for the same certificate, so an unreachable responder costs one attempt per interval rather than one per handshake. Note also that fetches are made on the handshake thread within the responseTimeout budget rather than on a background thread pool as SunJSSE uses, so the first handshake needing a given response pays for retrieving it.</li>
208+
<li>Unreachable classes for RFC 3281 cert-path services have been removed.</li>
208209
</ul>
209210

210211
<a id="r1rv85v2"><h3>2.2.1 Version</h3></a>

‎prov/src/main/java/org/bouncycastle/jce/provider/BouncyCastleProvider.java‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -255,17 +255,13 @@ private void setup()
255255
// Certification Path API
256256
if (revChkClass != null)
257257
{
258-
put("CertPathValidator.RFC3281", "org.bouncycastle.jce.provider.PKIXAttrCertPathValidatorSpi");
259-
put("CertPathBuilder.RFC3281", "org.bouncycastle.jce.provider.PKIXAttrCertPathBuilderSpi");
260258
put("CertPathValidator.RFC3280", "org.bouncycastle.jce.provider.PKIXCertPathValidatorSpi_8");
261259
put("CertPathBuilder.RFC3280", "org.bouncycastle.jce.provider.PKIXCertPathBuilderSpi_8");
262260
put("CertPathValidator.PKIX", "org.bouncycastle.jce.provider.PKIXCertPathValidatorSpi_8");
263261
put("CertPathBuilder.PKIX", "org.bouncycastle.jce.provider.PKIXCertPathBuilderSpi_8");
264262
}
265263
else
266264
{
267-
put("CertPathValidator.RFC3281", "org.bouncycastle.jce.provider.PKIXAttrCertPathValidatorSpi");
268-
put("CertPathBuilder.RFC3281", "org.bouncycastle.jce.provider.PKIXAttrCertPathBuilderSpi");
269265
put("CertPathValidator.RFC3280", "org.bouncycastle.jce.provider.PKIXCertPathValidatorSpi");
270266
put("CertPathBuilder.RFC3280", "org.bouncycastle.jce.provider.PKIXCertPathBuilderSpi");
271267
put("CertPathValidator.PKIX", "org.bouncycastle.jce.provider.PKIXCertPathValidatorSpi");

‎prov/src/main/java/org/bouncycastle/jce/provider/CertPathValidatorUtilities.java‎

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1273,18 +1273,6 @@ static Collection findIssuerCerts(
12731273
return certs;
12741274
}
12751275

1276-
protected static void verifyX509AttributeCertificate(X509AttributeCertificate attrCert, PublicKey publicKey,
1277-
String sigProvider) throws GeneralSecurityException
1278-
{
1279-
if (sigProvider == null)
1280-
{
1281-
attrCert.verify(publicKey, BouncyCastleProvider.PROVIDER_NAME);
1282-
}
1283-
else
1284-
{
1285-
attrCert.verify(publicKey, sigProvider);
1286-
}
1287-
}
12881276

12891277
protected static void verifyX509Certificate(X509Certificate cert, PublicKey publicKey, String sigProvider)
12901278
throws GeneralSecurityException

‎prov/src/main/java/org/bouncycastle/jce/provider/PKIXAttrCertPathBuilderSpi.java‎

Lines changed: 0 additions & 349 deletions
This file was deleted.

0 commit comments

Comments
 (0)