RFR: 6447816: Provider filtering (getProviders) is not working with OR'd conditions [v2]
Valerie Peng
valeriep at openjdk.org
Thu Aug 25 20:03:09 UTC 2022
On Thu, 25 Aug 2022 14:30:01 GMT, Weijun Wang <weijun at openjdk.org> wrote:
>> Valerie Peng has updated the pull request incrementally with one additional commit since the last revision:
>>
>> update test to use SHA256 and DSA throughout.
>
> src/java.base/share/classes/java/security/Security.java line 599:
>
>> 597: // Returns all installed providers
>> 598: // if the selection criteria is null.
>> 599: if ((keySet == null) || (allProviders == null)) {
>
> I'm not sure, but can `keySet` or `allProviders` be null? Or you meant `isEmpty()`?
Both may be null as their javadoc didn't state explicitly what is returned.
This is existing code and it returns null upon empty keySet which I keep the same behavior.
Perhaps for consistency sake, it should also check for the empty keySet condition and return allProviders.
-------------
PR: https://git.openjdk.org/jdk/pull/10008
More information about the security-dev
mailing list