Skip to content

Commit

Permalink
added validation of FIPS password length
Browse files Browse the repository at this point in the history
  • Loading branch information
Santhosh-CloudB committed Nov 15, 2023
1 parent dd04e33 commit b7c61de
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,11 @@ private SignupInfo validateAccountCreationForm(StaplerRequest req, boolean valid
si.errors.put("password1", Messages.HudsonPrivateSecurityRealm_CreateAccount_PasswordRequired());
}

if (FIPS140.useCompliantAlgorithms()) {

Check warning on line 455 in core/src/main/java/hudson/security/HudsonPrivateSecurityRealm.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Partially covered line

Line 455 is only partially covered, one branch is missing
if (si.password1.length() < 14) {
si.errors.put("password1", Messages.HudsonPrivateSecurityRealm_CreateAccount_FIPS_PasswordLengthInvalid());

Check warning on line 457 in core/src/main/java/hudson/security/HudsonPrivateSecurityRealm.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered lines

Lines 456-457 are not covered by tests
}
}
if (si.fullname == null || si.fullname.isEmpty()) {
si.fullname = si.username;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ HudsonPrivateSecurityRealm.ManageUserLinks.Description=Create/delete/modify user

HudsonPrivateSecurityRealm.CreateAccount.TextNotMatchWordInImage=Text didn''t match the word shown in the image
HudsonPrivateSecurityRealm.CreateAccount.PasswordNotMatch=Password didn''t match
HudsonPrivateSecurityRealm.CreateAccount.FIPS.PasswordLengthInvalid=Password should be atleast 112 bits(14 Characters in FIPS mode)
HudsonPrivateSecurityRealm.CreateAccount.PasswordRequired=Password is required
HudsonPrivateSecurityRealm.CreateAccount.UserNameRequired=User name is required
HudsonPrivateSecurityRealm.CreateAccount.UserNameInvalidCharacters=User name must only contain alphanumeric characters, underscore and dash
Expand Down

0 comments on commit b7c61de

Please sign in to comment.