RFR: 6447816: Provider filtering (getProviders) is not working with OR'd conditions [v5]

Weijun Wang weijun at openjdk.org
Tue Sep 6 14:40:04 UTC 2022


On Mon, 29 Aug 2022 20:13:42 GMT, Valerie Peng <valeriep at openjdk.org> wrote:

>> Existing provider filtering code only handles two standard attribute "KeySize" and "ImplementedIn", the rest are compared by exact match. Over time, more standard attributes are added which contain multiple values separated by "|". We should enhance the provider filtering code to better compare these.
>> 
>> Documentation update for this is tracked separately under https://bugs.openjdk.org/browse/JDK-6447817.
>> 
>> Thanks in advance for review~
>
> Valerie Peng has updated the pull request incrementally with one additional commit since the last revision:
> 
>   more refactoring.

src/java.base/share/classes/java/security/Security.java line 919:

> 917:     }
> 918: 
> 919:     private static boolean isKnownComposite(String attr) {

You can move this method and the next method inside the `Criteria` class. In fact, I think the `isConstraintSatisfied` method can be combined into the `isCriterionSatisfied` method.

src/java.base/share/classes/java/security/Security.java line 947:

> 945:         if (isKnownComposite(attribute)) {
> 946:             value = value.toUpperCase();
> 947:             prop = prop.toUpperCase();

Use `toUpperCase(Locale.ENGLISH)`.

-------------

PR: https://git.openjdk.org/jdk/pull/10008



More information about the security-dev mailing list