mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
Add underscores to SSL CERT macro names, for clarity and consistency
with be-secure.c.
This commit is contained in:
@ -11,7 +11,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* 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
|
* NOTES
|
||||||
* [ Most of these notes are wrong/obsolete, but perhaps not all ]
|
* [ Most of these notes are wrong/obsolete, but perhaps not all ]
|
||||||
@ -122,14 +122,14 @@
|
|||||||
#ifdef USE_SSL
|
#ifdef USE_SSL
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
#define USERCERTFILE ".postgresql/postgresql.crt"
|
#define USER_CERT_FILE ".postgresql/postgresql.crt"
|
||||||
#define USERKEYFILE ".postgresql/postgresql.key"
|
#define USER_KEY_FILE ".postgresql/postgresql.key"
|
||||||
#define ROOTCERTFILE ".postgresql/root.crt"
|
#define ROOT_CERT_FILE ".postgresql/root.crt"
|
||||||
#else
|
#else
|
||||||
/* On Windows, the "home" directory is already PostgreSQL-specific */
|
/* On Windows, the "home" directory is already PostgreSQL-specific */
|
||||||
#define USERCERTFILE "postgresql.crt"
|
#define USER_CERT_FILE "postgresql.crt"
|
||||||
#define USERKEYFILE "postgresql.key"
|
#define USER_KEY_FILE "postgresql.key"
|
||||||
#define ROOTCERTFILE "root.crt"
|
#define ROOT_CERT_FILE "root.crt"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef NOT_USED
|
#ifdef NOT_USED
|
||||||
@ -589,7 +589,7 @@ client_cert_cb(SSL *ssl, X509 **x509, EVP_PKEY **pkey)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* read the user certificate */
|
/* 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)
|
if ((fp = fopen(fnbuf, "r")) == NULL)
|
||||||
{
|
{
|
||||||
printfPQExpBuffer(&conn->errorMessage,
|
printfPQExpBuffer(&conn->errorMessage,
|
||||||
@ -611,7 +611,7 @@ client_cert_cb(SSL *ssl, X509 **x509, EVP_PKEY **pkey)
|
|||||||
fclose(fp);
|
fclose(fp);
|
||||||
|
|
||||||
/* read the user key */
|
/* 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)
|
if (stat(fnbuf, &buf) == -1)
|
||||||
{
|
{
|
||||||
printfPQExpBuffer(&conn->errorMessage,
|
printfPQExpBuffer(&conn->errorMessage,
|
||||||
@ -781,7 +781,7 @@ initialize_SSL(PGconn *conn)
|
|||||||
/* Set up to verify server cert, if root.crt is present */
|
/* Set up to verify server cert, if root.crt is present */
|
||||||
if (pqGetHomeDirectory(homedir, sizeof(homedir)))
|
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 (stat(fnbuf, &buf) == 0)
|
||||||
{
|
{
|
||||||
if (!SSL_CTX_load_verify_locations(SSL_context, fnbuf, NULL))
|
if (!SSL_CTX_load_verify_locations(SSL_context, fnbuf, NULL))
|
||||||
|
Reference in New Issue
Block a user