Commit 25d53269 authored by Peter Eisentraut's avatar Peter Eisentraut

Move SCRAM-related name definitions to scram-common.h

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>
parent 53cba77b
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include "commands/user.h" #include "commands/user.h"
#include "common/ip.h" #include "common/ip.h"
#include "common/md5.h" #include "common/md5.h"
#include "common/scram-common.h"
#include "libpq/auth.h" #include "libpq/auth.h"
#include "libpq/crypt.h" #include "libpq/crypt.h"
#include "libpq/libpq.h" #include "libpq/libpq.h"
......
...@@ -15,6 +15,13 @@ ...@@ -15,6 +15,13 @@
#include "common/sha2.h" #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) */ /* Length of SCRAM keys (client and server) */
#define SCRAM_KEY_LEN PG_SHA256_DIGEST_LENGTH #define SCRAM_KEY_LEN PG_SHA256_DIGEST_LENGTH
......
...@@ -13,13 +13,6 @@ ...@@ -13,13 +13,6 @@
#ifndef PG_SCRAM_H #ifndef PG_SCRAM_H
#define 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 */ /* Status codes for message exchange */
#define SASL_EXCHANGE_CONTINUE 0 #define SASL_EXCHANGE_CONTINUE 0
#define SASL_EXCHANGE_SUCCESS 1 #define SASL_EXCHANGE_SUCCESS 1
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
#include "common/base64.h" #include "common/base64.h"
#include "common/saslprep.h" #include "common/saslprep.h"
#include "common/scram-common.h" #include "common/scram-common.h"
#include "libpq/scram.h"
#include "fe-auth.h" #include "fe-auth.h"
/* These are needed for getpid(), in the fallback implementation */ /* These are needed for getpid(), in the fallback implementation */
......
...@@ -39,8 +39,8 @@ ...@@ -39,8 +39,8 @@
#endif #endif
#include "common/md5.h" #include "common/md5.h"
#include "common/scram-common.h"
#include "libpq-fe.h" #include "libpq-fe.h"
#include "libpq/scram.h"
#include "fe-auth.h" #include "fe-auth.h"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment