11
11
*
12
12
*
13
13
* 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 $
15
15
*
16
16
* NOTES
17
17
* [ Most of these notes are wrong/obsolete, but perhaps not all ]
122
122
#ifdef USE_SSL
123
123
124
124
#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"
128
128
#else
129
129
/* 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"
133
133
#endif
134
134
135
135
#ifdef NOT_USED
@@ -589,7 +589,7 @@ client_cert_cb(SSL *ssl, X509 **x509, EVP_PKEY **pkey)
589
589
}
590
590
591
591
/* read the user certificate */
592
- snprintf (fnbuf , sizeof (fnbuf ), "%s/%s" , homedir , USERCERTFILE );
592
+ snprintf (fnbuf , sizeof (fnbuf ), "%s/%s" , homedir , USER_CERT_FILE );
593
593
if ((fp = fopen (fnbuf , "r" )) == NULL )
594
594
{
595
595
printfPQExpBuffer (& conn -> errorMessage ,
@@ -611,7 +611,7 @@ client_cert_cb(SSL *ssl, X509 **x509, EVP_PKEY **pkey)
611
611
fclose (fp );
612
612
613
613
/* read the user key */
614
- snprintf (fnbuf , sizeof (fnbuf ), "%s/%s" , homedir , USERKEYFILE );
614
+ snprintf (fnbuf , sizeof (fnbuf ), "%s/%s" , homedir , USER_KEY_FILE );
615
615
if (stat (fnbuf , & buf ) == -1 )
616
616
{
617
617
printfPQExpBuffer (& conn -> errorMessage ,
@@ -781,7 +781,7 @@ initialize_SSL(PGconn *conn)
781
781
/* Set up to verify server cert, if root.crt is present */
782
782
if (pqGetHomeDirectory (homedir , sizeof (homedir )))
783
783
{
784
- snprintf (fnbuf , sizeof (fnbuf ), "%s/%s" , homedir , ROOTCERTFILE );
784
+ snprintf (fnbuf , sizeof (fnbuf ), "%s/%s" , homedir , ROOT_CERT_FILE );
785
785
if (stat (fnbuf , & buf ) == 0 )
786
786
{
787
787
if (!SSL_CTX_load_verify_locations (SSL_context , fnbuf , NULL ))
0 commit comments