8242565: Policy initialization issues when the denyAfter constraint is enabled

Reviewed-by: weijun
This commit is contained in:
Sean Mullan 2020-04-16 09:48:32 -04:00
parent 3cc1fdf2b6
commit 3efd000036
6 changed files with 18 additions and 14 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -87,6 +87,7 @@ public class Providers {
// Note: when SunEC is in a signed JAR file, it's not signed
// by EC algorithms. So it's still safe to be listed here.
"SunEC",
"SunJCE",
};
// Return Sun provider.

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -48,6 +48,7 @@ import java.util.Arrays;
import java.util.List;
import java.util.Locale;
import java.util.Properties;
import java.util.ResourceBundle;
import java.util.ServiceLoader;
import sun.security.util.PropertyExpander;
@ -63,12 +64,6 @@ public class KeyStoreUtil {
// this class is not meant to be instantiated
}
private static final Collator collator = Collator.getInstance();
static {
// this is for case insensitive string comparisons
collator.setStrength(Collator.PRIMARY);
};
/**
* Returns true if the certificate is self-signed, false otherwise.
*/
@ -133,7 +128,8 @@ public class KeyStoreUtil {
}
public static char[] getPassWithModifier(String modifier, String arg,
java.util.ResourceBundle rb) {
ResourceBundle rb,
Collator collator) {
if (modifier == null) {
return arg.toCharArray();
} else if (collator.compare(modifier, "env") == 0) {

View file

@ -4802,7 +4802,8 @@ public final class Main {
}
private char[] getPass(String modifier, String arg) {
char[] output = KeyStoreUtil.getPassWithModifier(modifier, arg, rb);
char[] output =
KeyStoreUtil.getPassWithModifier(modifier, arg, rb, collator);
if (output != null) return output;
tinyHelp();
return null; // Useless, tinyHelp() already exits.