Skip to content

Commit 499b3fe

Browse files
committed
JCE: fix null trust anchor bug in WolfCryptPKIXCertPathValidator.engineValidate()
1 parent 2b7780a commit 499b3fe

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/main/java/com/wolfssl/provider/jce/WolfCryptPKIXCertPathValidator.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1185,9 +1185,11 @@ public CertPathValidatorResult engineValidate(
11851185
certs.get(certs.size() - 1));
11861186

11871187
/* Check trust anchor public key constraints */
1188-
if (trustAnchor != null) {
1189-
checkTrustAnchorConstraints(trustAnchor);
1188+
if (trustAnchor == null) {
1189+
throw new CertPathValidatorException(
1190+
"Unable to find matching trust anchor");
11901191
}
1192+
checkTrustAnchorConstraints(trustAnchor);
11911193

11921194
} finally {
11931195
/* Free native WolfSSLCertManager resources */

0 commit comments

Comments
 (0)