mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8265765: DomainKeyStore may stop enumerating aliases if a constituting KeyStore is empty
Reviewed-by: weijun
This commit is contained in:
parent
c5c8c0644d
commit
178b962e01
2 changed files with 134 additions and 7 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2013, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2013, 2022, 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
|
||||
|
@ -419,20 +419,22 @@ abstract class DomainKeyStore extends KeyStoreSpi {
|
|||
if (aliases.hasMoreElements()) {
|
||||
return true;
|
||||
} else {
|
||||
if (iterator.hasNext()) {
|
||||
while (iterator.hasNext()) {
|
||||
keystoresEntry = iterator.next();
|
||||
prefix = keystoresEntry.getKey() +
|
||||
entryNameSeparator;
|
||||
entryNameSeparator;
|
||||
aliases = keystoresEntry.getValue().aliases();
|
||||
} else {
|
||||
return false;
|
||||
if (aliases.hasMoreElements()) {
|
||||
return true;
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
} catch (KeyStoreException e) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return aliases.hasMoreElements();
|
||||
}
|
||||
|
||||
public String nextElement() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue