]> granicus.if.org Git - postgresql/commitdiff
Add underscores to SSL CERT macro names, for clarity and consistency
authorBruce Momjian <bruce@momjian.us>
Thu, 27 Apr 2006 14:01:46 +0000 (14:01 +0000)
committerBruce Momjian <bruce@momjian.us>
Thu, 27 Apr 2006 14:01:46 +0000 (14:01 +0000)
with be-secure.c.

src/interfaces/libpq/fe-secure.c

index 8d2f7ccb7dd5f6825caf981c288e5aa1b8c48a92..346570ce6623622f31e01a31f5cfe0e6892ec6df 100644 (file)
@@ -11,7 +11,7 @@
  *
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/interfaces/libpq/fe-secure.c,v 1.77 2006/04/27 00:53:58 momjian Exp $
+ *       $PostgreSQL: pgsql/src/interfaces/libpq/fe-secure.c,v 1.78 2006/04/27 14:01:46 momjian Exp $
  *
  * NOTES
  *       [ Most of these notes are wrong/obsolete, but perhaps not all ]
 #ifdef USE_SSL
 
 #ifndef WIN32
-#define USERCERTFILE   ".postgresql/postgresql.crt"
-#define USERKEYFILE            ".postgresql/postgresql.key"
-#define ROOTCERTFILE   ".postgresql/root.crt"
+#define USER_CERT_FILE ".postgresql/postgresql.crt"
+#define USER_KEY_FILE          ".postgresql/postgresql.key"
+#define ROOT_CERT_FILE ".postgresql/root.crt"
 #else
 /* On Windows, the "home" directory is already PostgreSQL-specific */
-#define USERCERTFILE   "postgresql.crt"
-#define USERKEYFILE            "postgresql.key"
-#define ROOTCERTFILE   "root.crt"
+#define USER_CERT_FILE "postgresql.crt"
+#define USER_KEY_FILE          "postgresql.key"
+#define ROOT_CERT_FILE "root.crt"
 #endif
 
 #ifdef NOT_USED
@@ -589,7 +589,7 @@ client_cert_cb(SSL *ssl, X509 **x509, EVP_PKEY **pkey)
        }
 
        /* read the user certificate */
-       snprintf(fnbuf, sizeof(fnbuf), "%s/%s", homedir, USERCERTFILE);
+       snprintf(fnbuf, sizeof(fnbuf), "%s/%s", homedir, USER_CERT_FILE);
        if ((fp = fopen(fnbuf, "r")) == NULL)
        {
                printfPQExpBuffer(&conn->errorMessage,
@@ -611,7 +611,7 @@ client_cert_cb(SSL *ssl, X509 **x509, EVP_PKEY **pkey)
        fclose(fp);
 
        /* read the user key */
-       snprintf(fnbuf, sizeof(fnbuf), "%s/%s", homedir, USERKEYFILE);
+       snprintf(fnbuf, sizeof(fnbuf), "%s/%s", homedir, USER_KEY_FILE);
        if (stat(fnbuf, &buf) == -1)
        {
                printfPQExpBuffer(&conn->errorMessage,
@@ -781,7 +781,7 @@ initialize_SSL(PGconn *conn)
        /* Set up to verify server cert, if root.crt is present */
        if (pqGetHomeDirectory(homedir, sizeof(homedir)))
        {
-               snprintf(fnbuf, sizeof(fnbuf), "%s/%s", homedir, ROOTCERTFILE);
+               snprintf(fnbuf, sizeof(fnbuf), "%s/%s", homedir, ROOT_CERT_FILE);
                if (stat(fnbuf, &buf) == 0)
                {
                        if (!SSL_CTX_load_verify_locations(SSL_context, fnbuf, NULL))