Skip to content

Commit 9e26803

Browse files
authored
Merge pull request #1064 from sigstore/ref-exceptions
ref: Simplify hashedrekord and DSSE parsing exceptions
2 parents 36d4586 + 26b41cf commit 9e26803

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

sigstore-java/src/main/java/dev/sigstore/KeylessVerifier.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -305,8 +305,7 @@ private void checkMessageSignature(
305305
builder);
306306
logEntrySpec = builder.build();
307307
} catch (InvalidProtocolBufferException ipbe) {
308-
throw new KeylessVerificationException(
309-
"Could not parse HashedRekordLogEntryV002 from log entry body");
308+
throw new KeylessVerificationException("Could not parse hashedrekord from log entry body");
310309
}
311310

312311
if (!logEntrySpec.getData().getAlgorithm().equals(HashAlgorithm.SHA2_256)) {
@@ -460,8 +459,7 @@ private void checkDsseEnvelope(
460459
builder);
461460
logEntrySpec = builder.build();
462461
} catch (InvalidProtocolBufferException ipbe) {
463-
throw new KeylessVerificationException(
464-
"Could not parse DSSELogEntryV002 from log entry body", ipbe);
462+
throw new KeylessVerificationException("Could not parse DSSE from log entry body", ipbe);
465463
}
466464

467465
if (!logEntrySpec.getPayloadHash().getAlgorithm().equals(HashAlgorithm.SHA2_256)) {

sigstore-java/src/test/java/dev/sigstore/KeylessVerifierTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ public void testVerify_mismatchedCertificate_rekorV2() throws Exception {
270270
Bundle.from(new StringReader(modifiedBundleFile)),
271271
VerificationOptions.empty()));
272272
Assertions.assertEquals(
273-
"Could not parse HashedRekordLogEntryV002 from log entry body", thrown.getMessage());
273+
"Could not parse hashedrekord from log entry body", thrown.getMessage());
274274
}
275275

276276
@Test

0 commit comments

Comments
 (0)