fix: add support for sha256 and sha512 in htpasswd (#3497)

feat: add support for sha256 and sha512 htpasswd formats

Fixes issue #3495

We currently support only bcrypt htpasswd hashes, however bcrypt is not
FIPS-140 approved since it uses Blowfish.

This PR adds support for sha256 and sha512 formats and enforces that
bcrypt be disabled when fips140 mode is enabled.

Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>
This commit is contained in:
Ramkumar Chinchani
2025-11-09 05:28:29 -08:00
committed by GitHub
parent aaba362b4f
commit 04ae0a9409
26 changed files with 673 additions and 131 deletions
+2 -2
View File
@@ -28,8 +28,8 @@ func TestProfilingAuthz(t *testing.T) {
password, seedPass := test.GenerateRandomString()
authorizationAllRepos := test.AuthorizationAllRepos
testCreds := test.GetCredString(adminUsername, adminPassword) +
test.GetCredString(username, password)
testCreds := test.GetBcryptCredString(adminUsername, adminPassword) +
test.GetBcryptCredString(username, password)
htpasswdPath := test.MakeHtpasswdFileFromString(testCreds)
defer os.Remove(htpasswdPath)