From 46651ce6fe013220ed397add242004d764fc0153 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 4 May 2024 14:15:05 +0200 Subject: Adding upstream version 14.5. Signed-off-by: Daniel Baumann --- contrib/pgcrypto/sql/crypt-md5.sql | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 contrib/pgcrypto/sql/crypt-md5.sql (limited to 'contrib/pgcrypto/sql/crypt-md5.sql') diff --git a/contrib/pgcrypto/sql/crypt-md5.sql b/contrib/pgcrypto/sql/crypt-md5.sql new file mode 100644 index 0000000..ba7befb --- /dev/null +++ b/contrib/pgcrypto/sql/crypt-md5.sql @@ -0,0 +1,17 @@ +-- +-- crypt() and gen_salt(): md5 +-- + +SELECT crypt('', '$1$Szzz0yzz'); + +SELECT crypt('foox', '$1$Szzz0yzz'); + +CREATE TABLE ctest (data text, res text, salt text); +INSERT INTO ctest VALUES ('password', '', ''); + +UPDATE ctest SET salt = gen_salt('md5'); +UPDATE ctest SET res = crypt(data, salt); +SELECT res = crypt(data, res) AS "worked" +FROM ctest; + +DROP TABLE ctest; -- cgit v1.2.3