Skip to content

Commit

Permalink
prefer IllegalArgumentException when escapeHatchEnabled in FIPS mode
Browse files Browse the repository at this point in the history
Signed-off-by: Olivier Lamy <[email protected]>
  • Loading branch information
olamy committed Oct 10, 2024
1 parent 74ad0ec commit df6e4dd
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -320,9 +320,15 @@ protected Object readResolve() throws ObjectStreamException {
this.setTokenFieldToCheckKey(this.tokenFieldToCheckKey);
// ensure escapeHatchSecret is encrypted
this.setEscapeHatchSecret(this.escapeHatchSecret);

// validate this option in FIPS env or not
try {
// validate this option in FIPS env or not
this.setEscapeHatchEnabled(this.escapeHatchEnabled);
} catch (FormException e) {
throw new IllegalArgumentException(e);

Check warning on line 328 in src/main/java/org/jenkinsci/plugins/oic/OicSecurityRealm.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/jenkinsci/plugins/oic/OicSecurityRealm.java#L327-L328

Added lines #L327 - L328 were not covered by tests
}

try {
if (automanualconfigure != null) {
if ("auto".equals(automanualconfigure)) {
OicServerWellKnownConfiguration conf =
Expand Down

0 comments on commit df6e4dd

Please sign in to comment.