aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNathan Bossart <nathan@postgresql.org>2024-10-07 17:17:39 -0500
committerNathan Bossart <nathan@postgresql.org>2024-10-07 17:17:39 -0500
commitc3b80a7e98456904a2bf8f06a0cbf10f8dae1e83 (patch)
tree777344b3d50c457114db4e4c46e0d94fccbcc15f /src
parent8318f2b170d81e6792b90f2aa2b491a2b7add441 (diff)
downloadpostgresql-c3b80a7e98456904a2bf8f06a0cbf10f8dae1e83.tar.gz
postgresql-c3b80a7e98456904a2bf8f06a0cbf10f8dae1e83.zip
Fix test for password hash length limit.
In commit 8275325a06, I forgot to update password_1.out (an alternative expected test output file added by commit 3c44e7d8d4), so this test began failing on machines with FIPS mode enabled.
Diffstat (limited to 'src')
-rw-r--r--src/test/regress/expected/password_1.out7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/test/regress/expected/password_1.out b/src/test/regress/expected/password_1.out
index 9d2cc94f371..bd0c2e48de0 100644
--- a/src/test/regress/expected/password_1.out
+++ b/src/test/regress/expected/password_1.out
@@ -128,6 +128,13 @@ SELECT rolname, rolpassword not like '%A6xHKoH/494E941doaPOYg==%' as is_rolpassw
regress_passwd_sha_len2 | t
(3 rows)
+-- Test that valid hashes that are too long are rejected
+CREATE ROLE regress_passwd10 PASSWORD 'SCRAM-SHA-256$000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004096:wNFxNSk1hAXBkgub8py3bg==$65zC6E+R0U7tiYTC9+Wtq4Thw6gUDj3eDCINij8TflU=:rC1I7tcVugrHEY2DT0iPjGyjM4aJxkMM9n8WBxtUtHU=';
+ERROR: encrypted password is too long
+DETAIL: Encrypted passwords must be no longer than 512 bytes.
+ALTER ROLE regress_passwd9 PASSWORD 'SCRAM-SHA-256$000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004096:wNFxNSk1hAXBkgub8py3bg==$65zC6E+R0U7tiYTC9+Wtq4Thw6gUDj3eDCINij8TflU=:rC1I7tcVugrHEY2DT0iPjGyjM4aJxkMM9n8WBxtUtHU=';
+ERROR: encrypted password is too long
+DETAIL: Encrypted passwords must be no longer than 512 bytes.
DROP ROLE regress_passwd1;
DROP ROLE regress_passwd2;
DROP ROLE regress_passwd3;