Skip to content

Commit 7a5e5db

Browse files
Nibedita Jenacoffeys
authored andcommitted
8350498: Remove two Camerfirma root CA certificates
Backport-of: 4c6dec6
1 parent bdf3133 commit 7a5e5db

File tree

7 files changed

+24
-233
lines changed

7 files changed

+24
-233
lines changed

src/java.base/share/classes/sun/security/validator/CamerfirmaTLSPolicy.java

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -43,26 +43,14 @@ final class CamerfirmaTLSPolicy {
4343

4444
private static final Debug debug = Debug.getInstance("certpath");
4545

46-
// SHA-256 certificate fingerprints of distrusted roots
47-
private static final Set<String> FINGERPRINTS = Set.of(
48-
// cacerts alias: camerfirmachamberscommerceca
49-
// DN: CN=Chambers of Commerce Root,
50-
// OU=http://www.chambersign.org,
51-
// O=AC Camerfirma SA CIF A82743287, C=EU
52-
"0C258A12A5674AEF25F28BA7DCFAECEEA348E541E6F5CC4EE63B71B361606AC3",
53-
// cacerts alias: camerfirmachambersca
54-
// DN: CN=Chambers of Commerce Root - 2008,
55-
// O=AC Camerfirma S.A., SERIALNUMBER=A82743287,
56-
// L=Madrid (see current address at www.camerfirma.com/address),
57-
// C=EU
58-
"063E4AFAC491DFD332F3089B8542E94617D893D7FE944E10A7937EE29D9693C0",
59-
// cacerts alias: camerfirmachambersignca
60-
// DN: CN=Global Chambersign Root - 2008,
61-
// O=AC Camerfirma S.A., SERIALNUMBER=A82743287,
62-
// L=Madrid (see current address at www.camerfirma.com/address),
63-
// C=EU
64-
"136335439334A7698016A0D324DE72284E079D7B5220BB8FBD747816EEBEBACA"
65-
);
46+
// SHA-256 certificate fingerprint of distrusted root for TLS
47+
// cacerts alias: camerfirmachambersca
48+
// DN: CN=Chambers of Commerce Root - 2008,
49+
// O=AC Camerfirma S.A., SERIALNUMBER=A82743287,
50+
// L=Madrid (see current address at www.camerfirma.com/address),
51+
// C=EU
52+
private static final String FINGERPRINT =
53+
"063E4AFAC491DFD332F3089B8542E94617D893D7FE944E10A7937EE29D9693C0";
6654

6755
// Any TLS Server certificate that is anchored by one of the Camerfirma
6856
// roots above and is issued after this date will be distrusted.
@@ -85,7 +73,7 @@ static void checkDistrust(X509Certificate[] chain)
8573
throw new ValidatorException("Cannot generate fingerprint for "
8674
+ "trust anchor of TLS server certificate");
8775
}
88-
if (FINGERPRINTS.contains(fp)) {
76+
if (FINGERPRINT.equalsIgnoreCase(fp)) {
8977
Date notBefore = chain[0].getNotBefore();
9078
LocalDate ldNotBefore = LocalDate.ofInstant(notBefore.toInstant(),
9179
ZoneOffset.UTC);

src/java.base/share/data/cacerts/camerfirmachamberscommerceca

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

src/java.base/share/data/cacerts/camerfirmachambersignca

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

test/jdk/sun/security/lib/cacerts/VerifyCACerts.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
* 8223499 8225392 8232019 8234245 8233223 8225068 8225069 8243321 8243320
2929
* 8243559 8225072 8258630 8259312 8256421 8225081 8225082 8225083 8245654
3030
* 8305975 8304760 8307134 8295894 8314960 8317373 8317374 8318759 8319187
31-
* 8321408 8316138 8341057 8303770
31+
* 8321408 8316138 8341057 8303770 8350498
3232
* @summary Check root CA entries in cacerts file
3333
*/
3434
import java.io.ByteArrayInputStream;
@@ -47,12 +47,12 @@ public class VerifyCACerts {
4747
+ File.separator + "security" + File.separator + "cacerts";
4848

4949
// The numbers of certs now.
50-
private static final int COUNT = 111;
50+
private static final int COUNT = 109;
5151

5252
// SHA-256 of cacerts, can be generated with
5353
// shasum -a 256 cacerts | sed -e 's/../&:/g' | tr '[:lower:]' '[:upper:]' | cut -c1-95
5454
private static final String CHECKSUM
55-
= "F1:A9:C7:FE:48:ED:D7:AF:84:C8:9D:C3:88:8D:A3:C8:45:E5:37:4D:B9:18:86:97:AE:CF:6D:41:E6:0E:FB:1B";
55+
= "BD:6B:AB:BB:17:87:0D:D5:8D:53:D3:63:A5:DD:70:57:0F:4E:D3:57:4F:E5:FB:05:41:1C:A9:6E:B0:BF:79:38";
5656

5757
// Hex formatter to upper case with ":" delimiter
5858
private static final HexFormat HEX = HexFormat.ofDelimiter(":").withUpperCase();
@@ -69,10 +69,6 @@ public class VerifyCACerts {
6969
"ED:F7:EB:BC:A2:7A:2A:38:4D:38:7B:7D:40:10:C6:66:E2:ED:B4:84:3E:4C:29:B4:AE:1D:5B:93:32:E6:B2:4D");
7070
put("camerfirmachambersca [jdk]",
7171
"06:3E:4A:FA:C4:91:DF:D3:32:F3:08:9B:85:42:E9:46:17:D8:93:D7:FE:94:4E:10:A7:93:7E:E2:9D:96:93:C0");
72-
put("camerfirmachambersignca [jdk]",
73-
"13:63:35:43:93:34:A7:69:80:16:A0:D3:24:DE:72:28:4E:07:9D:7B:52:20:BB:8F:BD:74:78:16:EE:BE:BA:CA");
74-
put("camerfirmachamberscommerceca [jdk]",
75-
"0C:25:8A:12:A5:67:4A:EF:25:F2:8B:A7:DC:FA:EC:EE:A3:48:E5:41:E6:F5:CC:4E:E6:3B:71:B3:61:60:6A:C3");
7672
put("certumca [jdk]",
7773
"D8:E0:FE:BC:1D:B2:E3:8D:00:94:0F:37:D2:7D:41:34:4D:99:3E:73:4B:99:D5:65:6D:97:78:D4:D8:14:36:24");
7874
put("certumtrustednetworkca [jdk]",

test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/Camerfirma.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,19 @@
2121
* questions.
2222
*/
2323

24+
import javax.net.ssl.X509TrustManager;
2425
import java.io.File;
2526
import java.security.Security;
26-
import java.time.*;
27-
import java.util.*;
28-
import javax.net.ssl.*;
27+
import java.time.LocalDate;
28+
import java.time.ZoneOffset;
29+
import java.time.ZonedDateTime;
30+
import java.util.Date;
2931

30-
/**
32+
/*
3133
* @test
32-
* @bug 8346587
34+
* @bug 8346587 8350498
3335
* @summary Check that TLS Server certificates chaining back to distrusted
34-
* Camerfirma roots are invalid
36+
* Camerfirma root are invalid
3537
* @library /test/lib
3638
* @modules java.base/sun.security.validator
3739
* @run main/othervm Camerfirma after policyOn invalid
@@ -42,21 +44,19 @@
4244

4345
public class Camerfirma {
4446

45-
private static final String certPath = "chains" + File.separator + "camerfirma";
47+
private static final String CERT_PATH = "chains" + File.separator + "camerfirma";
4648

4749
// Each of the roots have a test certificate chain stored in a file
4850
// named "<root>-chain.pem".
49-
private static String[] rootsToTest = new String[] {
50-
"camerfirmachamberscommerceca", "camerfirmachambersca",
51-
"camerfirmachambersignca"};
51+
private static final String ROOT_TO_TEST = "camerfirmachambersca";
5252

5353
// Date after the restrictions take effect
5454
private static final ZonedDateTime DISTRUST_DATE =
5555
LocalDate.of(2025, 04, 16).atStartOfDay(ZoneOffset.UTC);
5656

5757
public static void main(String[] args) throws Exception {
5858

59-
// All of the test certificates are signed with SHA-1 so we need
59+
// All the test certificates are signed with SHA-1, so we need
6060
// to remove the constraint that disallows SHA-1 certificates.
6161
String prop = Security.getProperty("jdk.certpath.disabledAlgorithms");
6262
String newProp = prop.replace(", SHA1 jdkCA & usage TLSServer", "");
@@ -70,6 +70,6 @@ public static void main(String[] args) throws Exception {
7070
};
7171

7272
Date notBefore = distrust.getNotBefore(DISTRUST_DATE);
73-
distrust.testCertificateChain(certPath, notBefore, tms, rootsToTest);
73+
distrust.testCertificateChain(CERT_PATH, notBefore, tms, ROOT_TO_TEST);
7474
}
7575
}

test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/camerfirma/camerfirmachamberscommerceca-chain.pem

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

test/jdk/sun/security/ssl/X509TrustManagerImpl/distrust/chains/camerfirma/camerfirmachambersignca-chain.pem

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

0 commit comments

Comments
 (0)