]> granicus.if.org Git - postgresql/commitdiff
Move SCRAM-related name definitions to scram-common.h
authorPeter Eisentraut <peter_e@gmx.net>
Mon, 18 Dec 2017 21:59:10 +0000 (16:59 -0500)
committerPeter Eisentraut <peter_e@gmx.net>
Mon, 18 Dec 2017 21:59:48 +0000 (16:59 -0500)
Mechanism names for SCRAM and channel binding names have been included
in scram.h by the libpq frontend code, and this header references a set
of routines which are only used by the backend.  scram-common.h is on
the contrary usable by both the backend and libpq, so getting those
names from there seems more reasonable.

Author: Michael Paquier <michael.paquier@gmail.com>

src/backend/libpq/auth.c
src/include/common/scram-common.h
src/include/libpq/scram.h
src/interfaces/libpq/fe-auth-scram.c
src/interfaces/libpq/fe-auth.c

index 19a91ca67d231b930bd963e6c132f889e23930ad..b7f9bb1669e467cb720a53e48b8e5d4fbe04b652 100644 (file)
@@ -26,6 +26,7 @@
 #include "commands/user.h"
 #include "common/ip.h"
 #include "common/md5.h"
+#include "common/scram-common.h"
 #include "libpq/auth.h"
 #include "libpq/crypt.h"
 #include "libpq/libpq.h"
index 0c5ee04f263cc29e8bd1a7d238f8c2330c05129b..857a60e71f4097bfdbb02cef85cd08cc87df7c8a 100644 (file)
 
 #include "common/sha2.h"
 
+/* Name of SCRAM mechanisms per IANA */
+#define SCRAM_SHA256_NAME "SCRAM-SHA-256"
+#define SCRAM_SHA256_PLUS_NAME "SCRAM-SHA-256-PLUS" /* with channel binding */
+
+/* Channel binding types */
+#define SCRAM_CHANNEL_BINDING_TLS_UNIQUE    "tls-unique"
+
 /* Length of SCRAM keys (client and server) */
 #define SCRAM_KEY_LEN                          PG_SHA256_DIGEST_LENGTH
 
index 91f1e0f2c7e12ed655882eae9f6f66100d7e006d..2c245813d65e7bc456a47c9195cf98a77dc5ac03 100644 (file)
 #ifndef PG_SCRAM_H
 #define PG_SCRAM_H
 
-/* Name of SCRAM mechanisms per IANA */
-#define SCRAM_SHA256_NAME "SCRAM-SHA-256"
-#define SCRAM_SHA256_PLUS_NAME "SCRAM-SHA-256-PLUS" /* with channel binding */
-
-/* Channel binding types */
-#define SCRAM_CHANNEL_BINDING_TLS_UNIQUE       "tls-unique"
-
 /* Status codes for message exchange */
 #define SASL_EXCHANGE_CONTINUE         0
 #define SASL_EXCHANGE_SUCCESS          1
index 5b783bc3136ec33caae327ef2a4cf19495ae09ef..4cad93c24adb51f25872bb196adee240f468d15d 100644 (file)
@@ -17,7 +17,6 @@
 #include "common/base64.h"
 #include "common/saslprep.h"
 #include "common/scram-common.h"
-#include "libpq/scram.h"
 #include "fe-auth.h"
 
 /* These are needed for getpid(), in the fallback implementation */
index f54ad8e0cc6fb0dd29bf02c70d9ed918c40352c6..2cfdb7c125c52b65017574fc687346bd17330c8b 100644 (file)
@@ -39,8 +39,8 @@
 #endif
 
 #include "common/md5.h"
+#include "common/scram-common.h"
 #include "libpq-fe.h"
-#include "libpq/scram.h"
 #include "fe-auth.h"