diff options
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/authentication/t/001_password.pl | 14 | ||||
-rw-r--r-- | src/test/authentication/t/002_saslprep.pl | 4 | ||||
-rw-r--r-- | src/test/regress/expected/password.out | 8 | ||||
-rw-r--r-- | src/test/regress/sql/password.sql | 6 |
4 files changed, 16 insertions, 16 deletions
diff --git a/src/test/authentication/t/001_password.pl b/src/test/authentication/t/001_password.pl index d7bc13bd58e..216bdc031c8 100644 --- a/src/test/authentication/t/001_password.pl +++ b/src/test/authentication/t/001_password.pl @@ -51,7 +51,7 @@ SKIP: # Create 3 roles with different password methods for each one. The same # password is used for all of them. - $node->safe_psql('postgres', "SET password_encryption='scram'; CREATE ROLE scram_role LOGIN PASSWORD 'pass';"); + $node->safe_psql('postgres', "SET password_encryption='scram-sha-256'; CREATE ROLE scram_role LOGIN PASSWORD 'pass';"); $node->safe_psql('postgres', "SET password_encryption='md5'; CREATE ROLE md5_role LOGIN PASSWORD 'pass';"); $node->safe_psql('postgres', "SET password_encryption='plain'; CREATE ROLE plain_role LOGIN PASSWORD 'pass';"); $ENV{"PGPASSWORD"} = 'pass'; @@ -68,12 +68,12 @@ SKIP: test_role($node, 'md5_role', 'password', 0); test_role($node, 'plain_role', 'password', 0); - # For "scram" method, user "plain_role" and "scram_role" should be able to - # connect. - reset_pg_hba($node, 'scram'); - test_role($node, 'scram_role', 'scram', 0); - test_role($node, 'md5_role', 'scram', 2); - test_role($node, 'plain_role', 'scram', 0); + # For "scram-sha-256" method, user "plain_role" and "scram_role" should + # be able to connect. + reset_pg_hba($node, 'scram-sha-256'); + test_role($node, 'scram_role', 'scram-sha-256', 0); + test_role($node, 'md5_role', 'scram-sha-256', 2); + test_role($node, 'plain_role', 'scram-sha-256', 0); # For "md5" method, all users should be able to connect (SCRAM # authentication will be performed for the user with a scram verifier.) diff --git a/src/test/authentication/t/002_saslprep.pl b/src/test/authentication/t/002_saslprep.pl index 7e373ed7bf4..67ba92cdd9b 100644 --- a/src/test/authentication/t/002_saslprep.pl +++ b/src/test/authentication/t/002_saslprep.pl @@ -63,7 +63,7 @@ SKIP: # Create test roles. $node->safe_psql('postgres', -"SET password_encryption='scram'; +"SET password_encryption='scram-sha-256'; SET client_encoding='utf8'; CREATE ROLE saslpreptest1_role LOGIN PASSWORD 'IX'; CREATE ROLE saslpreptest4a_role LOGIN PASSWORD 'a'; @@ -73,7 +73,7 @@ SKIP: "); # Require password from now on. - reset_pg_hba($node, 'scram'); + reset_pg_hba($node, 'scram-sha-256'); # Check that #1 and #5 are treated the same as just 'IX' test_login($node, 'saslpreptest1_role', "I\xc2\xadX", 0); diff --git a/src/test/regress/expected/password.out b/src/test/regress/expected/password.out index c503e43abeb..676b3e6ff3f 100644 --- a/src/test/regress/expected/password.out +++ b/src/test/regress/expected/password.out @@ -4,11 +4,11 @@ -- Tests for GUC password_encryption SET password_encryption = 'novalue'; -- error ERROR: invalid value for parameter "password_encryption": "novalue" -HINT: Available values: plain, md5, scram, off, on. +HINT: Available values: plain, md5, scram-sha-256, off, on. SET password_encryption = true; -- ok SET password_encryption = 'md5'; -- ok SET password_encryption = 'plain'; -- ok -SET password_encryption = 'scram'; -- ok +SET password_encryption = 'scram-sha-256'; -- ok -- consistency of password entries SET password_encryption = 'plain'; CREATE ROLE regress_passwd1 PASSWORD 'role_pwd1'; @@ -16,7 +16,7 @@ SET password_encryption = 'md5'; CREATE ROLE regress_passwd2 PASSWORD 'role_pwd2'; SET password_encryption = 'on'; CREATE ROLE regress_passwd3 PASSWORD 'role_pwd3'; -SET password_encryption = 'scram'; +SET password_encryption = 'scram-sha-256'; CREATE ROLE regress_passwd4 PASSWORD 'role_pwd4'; SET password_encryption = 'plain'; CREATE ROLE regress_passwd5 PASSWORD NULL; @@ -60,7 +60,7 @@ ALTER ROLE regress_passwd2 UNENCRYPTED PASSWORD 'md5dfa155cadd5f4ad57860162f3fab SET password_encryption = 'md5'; ALTER ROLE regress_passwd3 ENCRYPTED PASSWORD 'foo'; -- encrypted with MD5 ALTER ROLE regress_passwd4 ENCRYPTED PASSWORD 'scram-sha-256:VLK4RMaQLCvNtQ==:4096:3ded2376f7aafa93b1bdbd71bcc18b7d6ee50ed018029cc583d152ef3fc7d430:a6dd36dfc94c181956a6ae95f05e01b1864f0a22a2657d1de4ba84d2a24dc438'; -- client-supplied SCRAM verifier, use as it is -SET password_encryption = 'scram'; +SET password_encryption = 'scram-sha-256'; ALTER ROLE regress_passwd5 ENCRYPTED PASSWORD 'foo'; -- create SCRAM verifier CREATE ROLE regress_passwd6 ENCRYPTED PASSWORD 'md53725413363ab045e20521bf36b8d8d7f'; -- encrypted with MD5, use as it is SELECT rolname, regexp_replace(rolpassword, '(scram-sha-256):([a-zA-Z0-9+/]+==):(\d+):(\w+):(\w+)', '\1:<salt>:\3:<storedkey>:<serverkey>') as rolpassword_masked diff --git a/src/test/regress/sql/password.sql b/src/test/regress/sql/password.sql index f4b3a9ac3a1..95557e45660 100644 --- a/src/test/regress/sql/password.sql +++ b/src/test/regress/sql/password.sql @@ -7,7 +7,7 @@ SET password_encryption = 'novalue'; -- error SET password_encryption = true; -- ok SET password_encryption = 'md5'; -- ok SET password_encryption = 'plain'; -- ok -SET password_encryption = 'scram'; -- ok +SET password_encryption = 'scram-sha-256'; -- ok -- consistency of password entries SET password_encryption = 'plain'; @@ -16,7 +16,7 @@ SET password_encryption = 'md5'; CREATE ROLE regress_passwd2 PASSWORD 'role_pwd2'; SET password_encryption = 'on'; CREATE ROLE regress_passwd3 PASSWORD 'role_pwd3'; -SET password_encryption = 'scram'; +SET password_encryption = 'scram-sha-256'; CREATE ROLE regress_passwd4 PASSWORD 'role_pwd4'; SET password_encryption = 'plain'; CREATE ROLE regress_passwd5 PASSWORD NULL; @@ -50,7 +50,7 @@ ALTER ROLE regress_passwd3 ENCRYPTED PASSWORD 'foo'; -- encrypted with MD5 ALTER ROLE regress_passwd4 ENCRYPTED PASSWORD 'scram-sha-256:VLK4RMaQLCvNtQ==:4096:3ded2376f7aafa93b1bdbd71bcc18b7d6ee50ed018029cc583d152ef3fc7d430:a6dd36dfc94c181956a6ae95f05e01b1864f0a22a2657d1de4ba84d2a24dc438'; -- client-supplied SCRAM verifier, use as it is -SET password_encryption = 'scram'; +SET password_encryption = 'scram-sha-256'; ALTER ROLE regress_passwd5 ENCRYPTED PASSWORD 'foo'; -- create SCRAM verifier CREATE ROLE regress_passwd6 ENCRYPTED PASSWORD 'md53725413363ab045e20521bf36b8d8d7f'; -- encrypted with MD5, use as it is |