mirror of
https://github.com/nsacyber/HIRS.git
synced 2025-04-07 19:34:27 +00:00
Log an error instead of throwing an exception when a signing key cannot be located in the provided truststore
This commit is contained in:
parent
ed44f7ad61
commit
2a88b22ae1
@ -257,6 +257,11 @@ public class ReferenceManifestValidator {
|
||||
X509Certificate signingCert = null;
|
||||
try {
|
||||
signingCert = getCertFromTruststore();
|
||||
if (signingCert == null) {
|
||||
log.error("Unable to locate the signing cert in the provided truststore "
|
||||
+ trustStoreFile);
|
||||
return false;
|
||||
}
|
||||
} catch (IOException e) {
|
||||
log.warn("Error while parsing signing cert from truststore: " + e.getMessage());
|
||||
return false;
|
||||
|
@ -53,7 +53,11 @@ public class Main {
|
||||
System.out.println("A single cert cannot be used for verification. " +
|
||||
"The signing cert will be searched for in the trust store.");
|
||||
}
|
||||
validator.validateSwidtagFile(verifyFile);
|
||||
if (validator.validateSwidtagFile(verifyFile)) {
|
||||
System.out.println("Successfully verified " + verifyFile);
|
||||
} else {
|
||||
System.out.println("Failed to verify " + verifyFile);
|
||||
}
|
||||
} else {
|
||||
System.out.println("Need a RIM file to validate!");
|
||||
System.exit(1);
|
||||
|
Loading…
x
Reference in New Issue
Block a user