8264554: X509KeyManagerImpl calls getProtectionParameter with incorrect alias

Reviewed-by: mullan
This commit is contained in:
Xue-Lei Andrew Fan 2021-04-06 15:43:08 +00:00
parent 114e3c3e2d
commit 2f5169965d

View File

@ -269,8 +269,8 @@ final class X509KeyManagerImpl extends X509ExtendedKeyManager
String keyStoreAlias = alias.substring(secondDot + 1); String keyStoreAlias = alias.substring(secondDot + 1);
Builder builder = builders.get(builderIndex); Builder builder = builders.get(builderIndex);
KeyStore ks = builder.getKeyStore(); KeyStore ks = builder.getKeyStore();
Entry newEntry = ks.getEntry Entry newEntry = ks.getEntry(keyStoreAlias,
(keyStoreAlias, builder.getProtectionParameter(alias)); builder.getProtectionParameter(keyStoreAlias));
if (!(newEntry instanceof PrivateKeyEntry)) { if (!(newEntry instanceof PrivateKeyEntry)) {
// unexpected type of entry // unexpected type of entry
return null; return null;