summaryrefslogtreecommitdiff
path: root/src/include/common
diff options
context:
space:
mode:
authorHeikki Linnakangas2017-05-03 08:19:07 +0000
committerHeikki Linnakangas2017-05-03 08:19:07 +0000
commit8f8b9be51fd788bb11276df89606bc653163524e (patch)
tree4d2daef287c2adb74da34bd6fcdbd47febbb47df /src/include/common
parentaf2c5aa88d38573724e40fa029499b4db20b0eb2 (diff)
Add PQencryptPasswordConn function to libpq, use it in psql and createuser.
The new function supports creating SCRAM verifiers, in addition to md5 hashes. The algorithm is chosen based on password_encryption, by default. This fixes the issue reported by Jeff Janes, that there was previously no way to create a SCRAM verifier with "\password". Michael Paquier and me Discussion: https://www.postgresql.org/message-id/CAMkU%3D1wfBgFPbfAMYZQE78p%3DVhZX7nN86aWkp0QcCp%3D%2BKxZ%3Dbg%40mail.gmail.com
Diffstat (limited to 'src/include/common')
-rw-r--r--src/include/common/scram-common.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/include/common/scram-common.h b/src/include/common/scram-common.h
index 656d9e1e6b..307f92b54a 100644
--- a/src/include/common/scram-common.h
+++ b/src/include/common/scram-common.h
@@ -53,4 +53,7 @@ extern void scram_H(const uint8 *str, int len, uint8 *result);
extern void scram_ClientKey(const uint8 *salted_password, uint8 *result);
extern void scram_ServerKey(const uint8 *salted_password, uint8 *result);
+extern char *scram_build_verifier(const char *salt, int saltlen, int iterations,
+ const char *password);
+
#endif /* SCRAM_COMMON_H */