Skip to content
This repository was archived by the owner on Sep 2, 2022. It is now read-only.
/ jdk17 Public archive

Commit 8554fe6

Browse files
author
Jamil Nimeh
committed
8253866: Security Libs Terminology Refresh
Reviewed-by: erikj, weijun, mullan
1 parent c2a3c7e commit 8554fe6

File tree

15 files changed

+72
-70
lines changed

15 files changed

+72
-70
lines changed

Diff for: make/ToolsJdk.gmk

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2011, 2021, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -67,9 +67,9 @@ TOOL_GENERATECURRENCYDATA = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_
6767
TOOL_TZDB = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \
6868
build.tools.tzdb.TzdbZoneRulesCompiler
6969

70-
TOOL_BLACKLISTED_CERTS = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \
70+
TOOL_BLOCKED_CERTS = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \
7171
--add-exports java.base/sun.security.util=ALL-UNNAMED \
72-
build.tools.blacklistedcertsconverter.BlacklistedCertsConverter
72+
build.tools.blockedcertsconverter.BlockedCertsConverter
7373

7474
TOOL_MAKEJAVASECURITY = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \
7575
build.tools.makejavasecurity.MakeJavaSecurity

Diff for: make/data/blacklistedcertsconverter/blacklisted.certs.pem renamed to make/data/blockedcertsconverter/blocked.certs.pem

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#! java BlacklistedCertsConverter SHA-256
1+
#! java BlockedCertsConverter SHA-256
22

33
# The line above must be the first line of this file. Do not
44
# remove it.

Diff for: make/jdk/src/classes/build/tools/blacklistedcertsconverter/BlacklistedCertsConverter.java renamed to make/jdk/src/classes/build/tools/blockedcertsconverter/BlockedCertsConverter.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2013, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
2323
* questions.
2424
*/
2525

26-
package build.tools.blacklistedcertsconverter;
26+
package build.tools.blockedcertsconverter;
2727

2828
import java.io.IOException;
2929
import java.math.BigInteger;
@@ -45,15 +45,15 @@
4545
import sun.security.util.DerValue;
4646

4747
/**
48-
* Converts blacklisted.certs.pem from System.in to blacklisted.certs in
48+
* Converts blocked.certs.pem from System.in to blocked.certs in
4949
* System.out. The input must start with a #! line including the fingerprint
5050
* algorithm. The output is sorted and unique.
5151
*/
52-
public class BlacklistedCertsConverter {
52+
public class BlockedCertsConverter {
5353

5454
public static void main(String[] args) throws Exception {
5555

56-
byte[] pattern = "#! java BlacklistedCertsConverter ".getBytes();
56+
byte[] pattern = "#! java BlockedCertsConverter ".getBytes();
5757
String mdAlg = "";
5858

5959
for (int i=0; ; i++) {

Diff for: make/modules/java.base/Gendata.gmk

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2011, 2021, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -29,7 +29,7 @@ include gendata/GendataBreakIterator.gmk
2929

3030
include gendata/GendataTZDB.gmk
3131

32-
include gendata/GendataBlacklistedCerts.gmk
32+
include gendata/GendataBlockedCerts.gmk
3333

3434
include gendata/GendataCryptoPolicy.gmk
3535

Diff for: make/modules/java.base/gendata/GendataBlacklistedCerts.gmk renamed to make/modules/java.base/gendata/GendataBlockedCerts.gmk

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -23,12 +23,12 @@
2323
# questions.
2424
#
2525

26-
GENDATA_BLACKLISTED_CERTS_SRC += $(TOPDIR)/make/data/blacklistedcertsconverter/blacklisted.certs.pem
27-
GENDATA_BLACKLISTED_CERTS := $(SUPPORT_OUTPUTDIR)/modules_libs/$(MODULE)/security/blacklisted.certs
26+
GENDATA_BLOCKED_CERTS_SRC += $(TOPDIR)/make/data/blockedcertsconverter/blocked.certs.pem
27+
GENDATA_BLOCKED_CERTS := $(SUPPORT_OUTPUTDIR)/modules_libs/$(MODULE)/security/blocked.certs
2828

29-
$(GENDATA_BLACKLISTED_CERTS): $(BUILD_TOOLS_JDK) $(GENDATA_BLACKLISTED_CERTS_SRC)
30-
$(call LogInfo, Generating blacklisted certs)
29+
$(GENDATA_BLOCKED_CERTS): $(BUILD_TOOLS_JDK) $(GENDATA_BLOCKED_CERTS_SRC)
30+
$(call LogInfo, Generating blocked certs)
3131
$(call MakeDir, $(@D))
32-
($(CAT) $(GENDATA_BLACKLISTED_CERTS_SRC) | $(TOOL_BLACKLISTED_CERTS) > $@) || exit 1
32+
($(CAT) $(GENDATA_BLOCKED_CERTS_SRC) | $(TOOL_BLOCKED_CERTS) > $@) || exit 1
3333

34-
TARGETS += $(GENDATA_BLACKLISTED_CERTS)
34+
TARGETS += $(GENDATA_BLOCKED_CERTS)

Diff for: make/scripts/compare.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22
#
3-
# Copyright (c) 2012, 2020, Oracle and/or its affiliates. All rights reserved.
3+
# Copyright (c) 2012, 2021, Oracle and/or its affiliates. All rights reserved.
44
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
#
66
# This code is free software; you can redistribute it and/or modify it
@@ -1084,7 +1084,7 @@ compare_all_execs() {
10841084
-o -name '*.zip' -o -name '*.jimage' -o -name '*.java' -o -name '*.mf' \
10851085
-o -name '*.jpg' -o -name '*.wsdl' -o -name '*.js' -o -name '*.sh' \
10861086
-o -name '*.bat' -o -name '*LICENSE' -o -name '*.d' -o -name '*store' \
1087-
-o -name 'blacklist' -o -name '*certs' -o -name '*.ttf' \
1087+
-o -name 'blocked' -o -name '*certs' -o -name '*.ttf' \
10881088
-o -name '*.jfc' -o -name '*.dat' -o -name 'release' -o -name '*.dir'\
10891089
-o -name '*.sym' -o -name '*.idl' -o -name '*.h' -o -name '*.access' \
10901090
-o -name '*.template' -o -name '*.policy' -o -name '*.security' \

Diff for: src/java.base/share/classes/com/sun/crypto/provider/JceKeyStore.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1998, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -551,7 +551,7 @@ public void engineStore(OutputStream stream, char[] password)
551551
* }
552552
*
553553
* ended by a keyed SHA1 hash (bytes only) of
554-
* { password + whitener + preceding body }
554+
* { password + extra data + preceding body }
555555
*/
556556

557557
// password is mandatory when storing
@@ -897,7 +897,7 @@ public void engineLoad(InputStream stream, char[] password)
897897

898898
/**
899899
* To guard against tampering with the keystore, we append a keyed
900-
* hash with a bit of whitener.
900+
* hash with a bit of extra data.
901901
*/
902902
private MessageDigest getPreKeyedHash(char[] password)
903903
throws NoSuchAlgorithmException

Diff for: src/java.base/share/classes/java/util/jar/JarVerifier.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -90,7 +90,7 @@ class JarVerifier {
9090
/** makes code source singleton instances unique to us */
9191
private Object csdomain = new Object();
9292

93-
/** collect -DIGEST-MANIFEST values for blacklist */
93+
/** collect -DIGEST-MANIFEST values for deny list */
9494
private List<Object> manifestDigests;
9595

9696
public JarVerifier(byte rawBytes[]) {

Diff for: src/java.base/share/classes/sun/security/provider/JavaKeyStore.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -551,7 +551,7 @@ public void engineStore(OutputStream stream, char[] password)
551551
* }
552552
*
553553
* ended by a keyed SHA1 hash (bytes only) of
554-
* { password + whitener + preceding body }
554+
* { password + extra data + preceding body }
555555
*/
556556

557557
// password is mandatory when storing
@@ -817,7 +817,7 @@ public void engineLoad(InputStream stream, char[] password)
817817

818818
/**
819819
* To guard against tampering with the keystore, we append a keyed
820-
* hash with a bit of whitener.
820+
* hash with a bit of extra data.
821821
*/
822822
private MessageDigest getPreKeyedHash(char[] password)
823823
throws NoSuchAlgorithmException

Diff for: src/java.base/share/classes/sun/security/util/UntrustedCertificates.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2012, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2012, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -55,12 +55,12 @@ public final class UntrustedCertificates {
5555
@Override
5656
public Void run() {
5757
File f = new File(StaticProperty.javaHome(),
58-
"lib/security/blacklisted.certs");
58+
"lib/security/blocked.certs");
5959
try (FileInputStream fin = new FileInputStream(f)) {
6060
props.load(fin);
6161
} catch (IOException fnfe) {
6262
if (debug != null) {
63-
debug.println("Error parsing blacklisted.certs");
63+
debug.println("Error parsing blocked.certs");
6464
}
6565
}
6666
return null;

Diff for: src/java.base/share/conf/security/java.security

+11-10
Original file line numberDiff line numberDiff line change
@@ -441,21 +441,22 @@ networkaddress.cache.negative.ttl=10
441441
# Policy for failed Kerberos KDC lookups:
442442
#
443443
# When a KDC is unavailable (network error, service failure, etc), it is
444-
# put inside a blacklist and accessed less often for future requests. The
444+
# put inside a secondary list and accessed less often for future requests. The
445445
# value (case-insensitive) for this policy can be:
446446
#
447447
# tryLast
448-
# KDCs in the blacklist are always tried after those not on the list.
448+
# KDCs in the secondary list are always tried after those not on the list.
449449
#
450450
# tryLess[:max_retries,timeout]
451-
# KDCs in the blacklist are still tried by their order in the configuration,
452-
# but with smaller max_retries and timeout values. max_retries and timeout
453-
# are optional numerical parameters (default 1 and 5000, which means once
454-
# and 5 seconds). Please notes that if any of the values defined here is
455-
# more than what is defined in krb5.conf, it will be ignored.
456-
#
457-
# Whenever a KDC is detected as available, it is removed from the blacklist.
458-
# The blacklist is reset when krb5.conf is reloaded. You can add
451+
# KDCs in the secondary list are still tried by their order in the
452+
# configuration, but with smaller max_retries and timeout values.
453+
# max_retries and timeout are optional numerical parameters (default 1 and
454+
# 5000, which means once and 5 seconds). Please note that if any of the
455+
# values defined here are more than what is defined in krb5.conf, it will be
456+
# ignored.
457+
#
458+
# Whenever a KDC is detected as available, it is removed from the secondary
459+
# list. The secondary list is reset when krb5.conf is reloaded. You can add
459460
# refreshKrb5Config=true to a JAAS configuration file so that krb5.conf is
460461
# reloaded whenever a JAAS authentication is attempted.
461462
#

Diff for: src/java.security.jgss/share/classes/sun/security/krb5/Config.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -1330,7 +1330,7 @@ private static String checkRealm(String mapRealm) {
13301330
/**
13311331
* Locate KDC using DNS
13321332
*
1333-
* @param realm the realm for which the master KDC is desired
1333+
* @param realm the realm for which the primary KDC is desired
13341334
* @return the KDC
13351335
*/
13361336
private String getKDCFromDNS(String realm) throws KrbException {

Diff for: src/java.security.jgss/share/classes/sun/security/krb5/KdcComm.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -490,12 +490,12 @@ private static int parsePositiveIntString(String intString) {
490490

491491
/**
492492
* Maintains a KDC accessible list. Unavailable KDCs are put into a
493-
* blacklist, when a KDC in the blacklist is available, it's removed
494-
* from there. No insertion order in the blacklist.
493+
* secondary KDC list. When a KDC in the secondary list is available,
494+
* it is removed from there. No insertion order in the secondary KDC list.
495495
*
496-
* There are two methods to deal with KDCs in the blacklist. 1. Only try
497-
* them when there's no KDC not on the blacklist. 2. Still try them, but
498-
* with lesser number of retries and smaller timeout value.
496+
* There are two methods to deal with KDCs in the secondary KDC list.
497+
* 1. Only try them when they are the only known KDCs.
498+
* 2. Still try them, but with fewer retries and a smaller timeout value.
499499
*/
500500
static class KdcAccessibility {
501501
// Known bad KDCs

Diff for: test/jdk/sun/security/krb5/auto/BogusKDC.java

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -34,8 +34,8 @@
3434
/*
3535
* @test
3636
* @bug 4515853 8075297 8194486
37-
* @summary Checks that Kerberos client tries slave KDC
38-
* if master KDC is not responding
37+
* @summary Checks that Kerberos client tries replica KDC
38+
* if primary KDC is not responding
3939
* @library /test/lib
4040
* @run main jdk.test.lib.FileInstaller TestHosts TestHosts
4141
* @run main/othervm -Djdk.net.hosts.file=TestHosts BogusKDC
@@ -80,8 +80,8 @@ public static void main(String[] args) throws LoginException, IOException {
8080
CallbackHandler handler = new Helper.UserPasswordHandler(
8181
USER, USER_PASSWORD);
8282

83-
// create a krb5 config with non-existing host for master KDC,
84-
// and wrong port for slave KDC
83+
// create a krb5 config with non-existing host for primary KDC,
84+
// and wrong port for replica KDC
8585
try (PrintWriter w = new PrintWriter(new FileWriter(KRB5_CONF))) {
8686
w.write(String.format(KRB5_CONF_TEMPLATE,
8787
KDC.NOT_EXISTING_HOST, WRONG_KDC_PORT));
@@ -96,8 +96,8 @@ public static void main(String[] args) throws LoginException, IOException {
9696
System.out.println("Expected login failure: " + le);
9797
}
9898

99-
// create a krb5 config with non-existing host for master KDC,
100-
// but correct port for slave KDC
99+
// create a krb5 config with non-existing host for primary KDC,
100+
// but correct port for replica KDC
101101
try (PrintWriter w = new PrintWriter(new FileWriter(KRB5_CONF))) {
102102
w.write(String.format(KRB5_CONF_TEMPLATE,
103103
KDC.NOT_EXISTING_HOST, kdc.getPort()));

Diff for: test/jdk/sun/security/lib/CheckBlacklistedCerts.java renamed to test/jdk/sun/security/lib/CheckBlockedCerts.java

+15-14
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2013, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -35,7 +35,7 @@
3535
import java.security.cert.*;
3636
import java.util.*;
3737

38-
public class CheckBlacklistedCerts {
38+
public class CheckBlockedCerts {
3939
public static void main(String[] args) throws Exception {
4040

4141
String home = System.getProperty("java.home");
@@ -57,29 +57,30 @@ public static void main(String[] args) throws Exception {
5757
}
5858

5959
// All certs in the pem files
60-
Set<Certificate> blacklisted = new HashSet<>();
60+
Set<Certificate> blocked = new HashSet<>();
6161

6262
// Assumes the full src is available
63-
File blacklist = new File(System.getProperty("test.src"),
64-
"../../../../../make/data/blacklistedcertsconverter/blacklisted.certs.pem");
63+
File blockedCertsFile = new File(System.getProperty("test.src"),
64+
"../../../../../make/data/blockedcertsconverter/blocked.certs.pem");
6565

6666
CertificateFactory cf = CertificateFactory.getInstance("X.509");
67-
try (FileInputStream fis = new FileInputStream(blacklist)) {
67+
try (FileInputStream fis = new FileInputStream(blockedCertsFile)) {
6868
Collection<? extends Certificate> certs
6969
= cf.generateCertificates(fis);
7070
System.out.println(certs.size());
7171
for (Certificate c: certs) {
72-
blacklisted.add(c);
72+
blocked.add(c);
7373
X509Certificate cert = ((X509Certificate)c);
7474
if (!UntrustedCertificates.isUntrusted(cert)) {
75-
System.out.println(cert.getSubjectDN() + " is trusted");
75+
System.out.println(cert.getSubjectX500Principal() +
76+
" is trusted");
7677
failed = true;
7778
}
7879
}
7980
}
8081

81-
// Check the blacklisted.certs file itself
82-
file = new File(home, "lib/security/blacklisted.certs");
82+
// Check the blocked.certs file itself
83+
file = new File(home, "lib/security/blocked.certs");
8384
System.out.print("Check for " + file + ": ");
8485
try (BufferedReader reader = new BufferedReader(
8586
new InputStreamReader(new FileInputStream(file)))) {
@@ -100,11 +101,11 @@ public static void main(String[] args) throws Exception {
100101
failed = true;
101102
}
102103
// There are two unique fingerprints for each RSA certificate
103-
if (ccount != blacklisted.size() * 2
104-
&& !blacklisted.isEmpty()) {
105-
System.out.println("Wrong blacklisted.certs size: "
104+
if (ccount != blocked.size() * 2
105+
&& !blocked.isEmpty()) {
106+
System.out.println("Wrong blocked.certs size: "
106107
+ ccount + " fingerprints, "
107-
+ blacklisted.size() + " certs");
108+
+ blocked.size() + " certs");
108109
failed = true;
109110
}
110111
}

0 commit comments

Comments
 (0)