Skip to content

Commit 317ce62

Browse files
committed
Add underscores to SSL CERT macro names, for clarity and consistency
with be-secure.c.
1 parent 2882241 commit 317ce62

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/interfaces/libpq/fe-secure.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*
1212
*
1313
* IDENTIFICATION
14-
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-secure.c,v 1.77 2006/04/27 00:53:58 momjian Exp $
14+
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-secure.c,v 1.78 2006/04/27 14:01:46 momjian Exp $
1515
*
1616
* NOTES
1717
* [ Most of these notes are wrong/obsolete, but perhaps not all ]
@@ -122,14 +122,14 @@
122122
#ifdef USE_SSL
123123

124124
#ifndef WIN32
125-
#define USERCERTFILE ".postgresql/postgresql.crt"
126-
#define USERKEYFILE ".postgresql/postgresql.key"
127-
#define ROOTCERTFILE ".postgresql/root.crt"
125+
#define USER_CERT_FILE ".postgresql/postgresql.crt"
126+
#define USER_KEY_FILE ".postgresql/postgresql.key"
127+
#define ROOT_CERT_FILE ".postgresql/root.crt"
128128
#else
129129
/* On Windows, the "home" directory is already PostgreSQL-specific */
130-
#define USERCERTFILE "postgresql.crt"
131-
#define USERKEYFILE "postgresql.key"
132-
#define ROOTCERTFILE "root.crt"
130+
#define USER_CERT_FILE "postgresql.crt"
131+
#define USER_KEY_FILE "postgresql.key"
132+
#define ROOT_CERT_FILE "root.crt"
133133
#endif
134134

135135
#ifdef NOT_USED
@@ -589,7 +589,7 @@ client_cert_cb(SSL *ssl, X509 **x509, EVP_PKEY **pkey)
589589
}
590590

591591
/* read the user certificate */
592-
snprintf(fnbuf, sizeof(fnbuf), "%s/%s", homedir, USERCERTFILE);
592+
snprintf(fnbuf, sizeof(fnbuf), "%s/%s", homedir, USER_CERT_FILE);
593593
if ((fp = fopen(fnbuf, "r")) == NULL)
594594
{
595595
printfPQExpBuffer(&conn->errorMessage,
@@ -611,7 +611,7 @@ client_cert_cb(SSL *ssl, X509 **x509, EVP_PKEY **pkey)
611611
fclose(fp);
612612

613613
/* read the user key */
614-
snprintf(fnbuf, sizeof(fnbuf), "%s/%s", homedir, USERKEYFILE);
614+
snprintf(fnbuf, sizeof(fnbuf), "%s/%s", homedir, USER_KEY_FILE);
615615
if (stat(fnbuf, &buf) == -1)
616616
{
617617
printfPQExpBuffer(&conn->errorMessage,
@@ -781,7 +781,7 @@ initialize_SSL(PGconn *conn)
781781
/* Set up to verify server cert, if root.crt is present */
782782
if (pqGetHomeDirectory(homedir, sizeof(homedir)))
783783
{
784-
snprintf(fnbuf, sizeof(fnbuf), "%s/%s", homedir, ROOTCERTFILE);
784+
snprintf(fnbuf, sizeof(fnbuf), "%s/%s", homedir, ROOT_CERT_FILE);
785785
if (stat(fnbuf, &buf) == 0)
786786
{
787787
if (!SSL_CTX_load_verify_locations(SSL_context, fnbuf, NULL))

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