8236671: NullPointerException in JKS keystore

Reviewed-by: hchao, xuelei
This commit is contained in:
Sean Coffey 2021-04-30 09:32:40 +00:00
parent e9370a13b6
commit 276a1bf767
3 changed files with 17 additions and 3 deletions

View file

@ -281,6 +281,9 @@ public abstract class JavaKeyStore extends KeyStoreSpi {
if (!(key instanceof java.security.PrivateKey)) {
throw new KeyStoreException("Cannot store non-PrivateKeys");
}
if (password == null) {
throw new KeyStoreException("password can't be null");
}
try {
synchronized(entries) {
KeyEntry entry = new KeyEntry();