File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed
src/main/java/com/wolfssl/provider/jce Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -520,6 +520,17 @@ the current system time by wolfSSL. This means that preloaded OCSP responses
520520thisUpdate and nextUpdate dates. Historical OCSP responses with expired dates
521521cannot be used, even with a date override.
522522
523+ #### TrustAnchor Name Constraints
524+
525+ Name constraints specified directly on a TrustAnchor (via the
526+ ` TrustAnchor(X509Certificate, byte[]) ` constructor) are not supported.
527+ wolfJCE throws ` InvalidAlgorithmParameterException ` if any TrustAnchor in
528+ PKIXParameters has name constraints set. This matches SunJCE behavior.
529+
530+ Applications should use TrustAnchors without explicit name constraints; if
531+ name constraint enforcement is needed, the constraints should be embedded in
532+ the trust anchor certificate itself.
533+
523534### Behavior Discrepancies with SunJCE
524535---------
525536
Original file line number Diff line number Diff line change @@ -926,6 +926,18 @@ public CertPathValidatorResult engineValidate(
926926
927927 pkixParams = (PKIXParameters )params ;
928928
929+ /* Check if any TrustAnchors have name constraints. Native wolfSSL
930+ * does not apply TrustAnchor name constraints during chain
931+ * verification, only name constraints from certificates in the
932+ * chain. To match SunJCE behavior, throw InvalidAlgorithmParameter
933+ * Exception if TrustAnchors have name constraints. */
934+ for (TrustAnchor anchor : pkixParams .getTrustAnchors ()) {
935+ if (anchor .getNameConstraints () != null ) {
936+ throw new InvalidAlgorithmParameterException (
937+ "TrustAnchors with name constraints are not supported" );
938+ }
939+ }
940+
929941 /* If we are in FIPS mode, verify wolfJCE is the Signature provider
930942 * to help maintain FIPS compliance */
931943 if (Fips .enabled && pkixParams .getSigProvider () != "wolfJCE" ) {
You can’t perform that action at this time.
0 commit comments