Skip to content

Commit 25d5326

Browse files
committed
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>
1 parent 53cba77 commit 25d5326

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

src/backend/libpq/auth.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include "commands/user.h"
2727
#include "common/ip.h"
2828
#include "common/md5.h"
29+
#include "common/scram-common.h"
2930
#include "libpq/auth.h"
3031
#include "libpq/crypt.h"
3132
#include "libpq/libpq.h"

src/include/common/scram-common.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@
1515

1616
#include "common/sha2.h"
1717

18+
/* Name of SCRAM mechanisms per IANA */
19+
#define SCRAM_SHA256_NAME "SCRAM-SHA-256"
20+
#define SCRAM_SHA256_PLUS_NAME "SCRAM-SHA-256-PLUS" /* with channel binding */
21+
22+
/* Channel binding types */
23+
#define SCRAM_CHANNEL_BINDING_TLS_UNIQUE "tls-unique"
24+
1825
/* Length of SCRAM keys (client and server) */
1926
#define SCRAM_KEY_LEN PG_SHA256_DIGEST_LENGTH
2027

src/include/libpq/scram.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,6 @@
1313
#ifndef PG_SCRAM_H
1414
#define PG_SCRAM_H
1515

16-
/* Name of SCRAM mechanisms per IANA */
17-
#define SCRAM_SHA256_NAME "SCRAM-SHA-256"
18-
#define SCRAM_SHA256_PLUS_NAME "SCRAM-SHA-256-PLUS" /* with channel binding */
19-
20-
/* Channel binding types */
21-
#define SCRAM_CHANNEL_BINDING_TLS_UNIQUE "tls-unique"
22-
2316
/* Status codes for message exchange */
2417
#define SASL_EXCHANGE_CONTINUE 0
2518
#define SASL_EXCHANGE_SUCCESS 1

src/interfaces/libpq/fe-auth-scram.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
#include "common/base64.h"
1818
#include "common/saslprep.h"
1919
#include "common/scram-common.h"
20-
#include "libpq/scram.h"
2120
#include "fe-auth.h"
2221

2322
/* These are needed for getpid(), in the fallback implementation */

src/interfaces/libpq/fe-auth.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@
3939
#endif
4040

4141
#include "common/md5.h"
42+
#include "common/scram-common.h"
4243
#include "libpq-fe.h"
43-
#include "libpq/scram.h"
4444
#include "fe-auth.h"
4545

4646

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy