Skip to content

Commit 4ad54eb

Browse files
suzannajiwanicopybara-github
authored andcommitted
Add cause to VerificationResult.PathValidationFailure
PiperOrigin-RevId: 780683473
1 parent a1105af commit 4ad54eb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/kotlin/Verifier.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ sealed interface VerificationResult {
4545

4646
data object ChallengeMismatch : VerificationResult
4747

48-
data object PathValidationFailure : VerificationResult
48+
data class PathValidationFailure(val cause: CertPathValidatorException) : VerificationResult
4949

5050
data object ChainParsingFailure : VerificationResult
5151

@@ -118,7 +118,7 @@ open class Verifier(
118118
try {
119119
certPathValidator.validate(certPath, certPathParameters) as PKIXCertPathValidatorResult
120120
} catch (e: CertPathValidatorException) {
121-
return VerificationResult.PathValidationFailure
121+
return VerificationResult.PathValidationFailure(e)
122122
}
123123

124124
val keyDescription =

0 commit comments

Comments
 (0)