mirror of
https://github.com/nsacyber/HIRS.git
synced 2024-12-18 20:47:58 +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
3fbc0e743c
commit
f6f1ab4ee7
@ -257,6 +257,11 @@ public class ReferenceManifestValidator {
|
|||||||
X509Certificate signingCert = null;
|
X509Certificate signingCert = null;
|
||||||
try {
|
try {
|
||||||
signingCert = getCertFromTruststore();
|
signingCert = getCertFromTruststore();
|
||||||
|
if (signingCert == null) {
|
||||||
|
log.error("Unable to locate the signing cert in the provided truststore "
|
||||||
|
+ trustStoreFile);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
log.warn("Error while parsing signing cert from truststore: " + e.getMessage());
|
log.warn("Error while parsing signing cert from truststore: " + e.getMessage());
|
||||||
return false;
|
return false;
|
||||||
|
@ -62,7 +62,11 @@ public class Main {
|
|||||||
System.out.println("A single cert cannot be used for verification. " +
|
System.out.println("A single cert cannot be used for verification. " +
|
||||||
"The signing cert will be searched for in the trust store.");
|
"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 {
|
} else {
|
||||||
gateway = new SwidTagGateway();
|
gateway = new SwidTagGateway();
|
||||||
if (commander.isVerbose()) {
|
if (commander.isVerbose()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user