handle having no trust anchors more gracefully.
This commit is contained in:
parent
f17ea4256e
commit
fd31e22d92
@ -203,6 +203,12 @@ public class DNSSECValTool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Log our set of trusted keys
|
// Log our set of trusted keys
|
||||||
|
List<String> trustedKeys = validator.listTrustedKeys();
|
||||||
|
if (trustedKeys.size() == 0) {
|
||||||
|
System.err.println("ERROR: no trusted keys found/provided.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
for (String key : validator.listTrustedKeys()) {
|
for (String key : validator.listTrustedKeys()) {
|
||||||
System.out.println("Trusted Key: " + key);
|
System.out.println("Trusted Key: " + key);
|
||||||
}
|
}
|
||||||
|
@ -86,6 +86,10 @@ public class TrustAnchorStore {
|
|||||||
public List<String> listTrustAnchors() {
|
public List<String> listTrustAnchors() {
|
||||||
List<String> res = new ArrayList<String>();
|
List<String> res = new ArrayList<String>();
|
||||||
|
|
||||||
|
if (mMap == null) {
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
for (Map.Entry<String, SRRset> entry : mMap.entrySet()) {
|
for (Map.Entry<String, SRRset> entry : mMap.entrySet()) {
|
||||||
for (Iterator<Record> i = entry.getValue().rrs(); i.hasNext();) {
|
for (Iterator<Record> i = entry.getValue().rrs(); i.hasNext();) {
|
||||||
DNSKEYRecord r = (DNSKEYRecord) i.next();
|
DNSKEYRecord r = (DNSKEYRecord) i.next();
|
||||||
|
Loading…
Reference in New Issue
Block a user