Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Vladimir Sitnikov <[email protected]>
  • Loading branch information
loosebazooka and vlsi authored Apr 21, 2022
1 parent 8bc998d commit 8ffeba2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 3 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ dependencies {
implementation("com.google.api-client:google-api-client-gson:1.31.5")

implementation("com.google.code.gson:gson:2.8.9")
implementation("org.conscrypt:conscrypt-openjdk-uber:2.5.2") // contains library code for all platforms
implementation("org.conscrypt:conscrypt-openjdk-uber:2.5.2") {
because("contains library code for all platforms")
}

testImplementation("junit:junit:4.12")
testImplementation("com.nimbusds:oauth2-oidc-sdk:6.21.2")
Expand Down
10 changes: 4 additions & 6 deletions src/main/java/dev/sigstore/fulcio/client/FulcioValidator.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class FulcioValidator {
private final CTLogInfo ctLogInfo;
private final TrustAnchor fulcioRoot;

public static FulcioValidator NewFulcioValidator(byte[] ctfePublicKey, byte[] fulcioRoot)
public static FulcioValidator newFulcioValidator(byte[] ctfePublicKey, byte[] fulcioRoot)
throws InvalidKeySpecException, NoSuchAlgorithmException, CertificateException, IOException,
InvalidAlgorithmParameterException {
KeyFactory keyFactory = KeyFactory.getInstance("EC");
Expand Down Expand Up @@ -91,17 +91,15 @@ public void validateCertChain(SigningCertificate sc) throws FulcioValidationExce
try {
cpv = CertPathValidator.getInstance("PKIX");
} catch (NoSuchAlgorithmException e) {
// no PKIX, we probably shouldn't be here, but this seems to be a system library error
// not a program control flow issue
throw new RuntimeException(e);
//
throw new RuntimeException("No PKIX CertPathValidator, we probably shouldn't be here, but this seems to be a system library error not a program control flow issue", e);
}

PKIXParameters pkixParams;
try {
pkixParams = new PKIXParameters(Collections.singleton(fulcioRoot));
} catch (InvalidAlgorithmParameterException e) {
// this should have been checked when generating a validator instance
throw new RuntimeException(e);
throw new RuntimeException("Can't create PKIX parameters for fulcioRoot. This should have been checked when generating a validator instance", e);
}
pkixParams.setRevocationEnabled(false);

Expand Down

0 comments on commit 8ffeba2

Please sign in to comment.