mirror of
https://github.com/nsacyber/HIRS.git
synced 2025-02-06 11:10:15 +00:00
Add error handling to clarify endorsement validation error
This commit is contained in:
parent
d183504a3f
commit
d5fcd06902
@ -1629,11 +1629,18 @@ public final class SupplyChainCredentialValidator implements CredentialValidator
|
|||||||
try {
|
try {
|
||||||
cert.verify(signingCert.getPublicKey(), BouncyCastleProvider.PROVIDER_NAME);
|
cert.verify(signingCert.getPublicKey(), BouncyCastleProvider.PROVIDER_NAME);
|
||||||
return true;
|
return true;
|
||||||
} catch (InvalidKeyException | CertificateException | NoSuchAlgorithmException
|
} catch (InvalidKeyException e) {
|
||||||
| NoSuchProviderException | SignatureException e) {
|
LOGGER.warn("Incorrect key given to validate this cert's signature");
|
||||||
LOGGER.error("Exception thrown while verifying certificate", e);
|
} catch (CertificateException e) {
|
||||||
return false;
|
LOGGER.warn("Encoding error while validating this cert's signature");
|
||||||
|
} catch (NoSuchAlgorithmException e) {
|
||||||
|
LOGGER.warn("Unsupported signature algorithm found during validation");
|
||||||
|
} catch (NoSuchProviderException e) {
|
||||||
|
LOGGER.warn("Incorrect provider for cert signature validation");
|
||||||
|
} catch (SignatureException e) {
|
||||||
|
LOGGER.warn("Exception thrown while verifying certificate", e);
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user