diff options
author | Magnus Hagander <magnus@hagander.net> | 2009-06-23 18:13:23 +0000 |
---|---|---|
committer | Magnus Hagander <magnus@hagander.net> | 2009-06-23 18:13:23 +0000 |
commit | a93e7432cff306dad75dcd242ced9f80436cecc1 (patch) | |
tree | 2d497d0d7fbb8b84eda6f12c3e08c827088bb6d6 /src/interfaces/libpq/libpq-int.h | |
parent | b087b018a11f4bbff6eb2a7e3f6f30cc8d0a03c9 (diff) | |
download | postgresql-a93e7432cff306dad75dcd242ced9f80436cecc1.tar.gz postgresql-a93e7432cff306dad75dcd242ced9f80436cecc1.zip |
Properly initialize SSL engines when used from libpq. This is required for
most external engines.
Per report and initial code from Lars Kanis
Diffstat (limited to 'src/interfaces/libpq/libpq-int.h')
-rw-r--r-- | src/interfaces/libpq/libpq-int.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/interfaces/libpq/libpq-int.h b/src/interfaces/libpq/libpq-int.h index f4d6315a569..51b7128b862 100644 --- a/src/interfaces/libpq/libpq-int.h +++ b/src/interfaces/libpq/libpq-int.h @@ -12,7 +12,7 @@ * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/interfaces/libpq/libpq-int.h,v 1.142 2009/06/11 14:49:14 momjian Exp $ + * $PostgreSQL: pgsql/src/interfaces/libpq/libpq-int.h,v 1.143 2009/06/23 18:13:23 mha Exp $ * *------------------------------------------------------------------------- */ @@ -76,8 +76,13 @@ typedef struct #ifdef USE_SSL #include <openssl/ssl.h> #include <openssl/err.h> + +#if (SSLEAY_VERSION_NUMBER >= 0x00907000L) && !defined(OPENSSL_NO_ENGINE) +#define USE_SSL_ENGINE #endif +#endif /* USE_SSL */ + /* * POSTGRES backend dependent Constants. */ @@ -383,7 +388,13 @@ struct pg_conn X509 *peer; /* X509 cert of server */ char peer_dn[256 + 1]; /* peer distinguished name */ char peer_cn[SM_USER + 1]; /* peer common name */ +#ifdef USE_SSL_ENGINE + ENGINE *engine; /* SSL engine, if any */ +#else + void *engine; /* dummy field to keep struct the same + if OpenSSL version changes */ #endif +#endif /* USE_SSL */ #ifdef ENABLE_GSS gss_ctx_id_t gctx; /* GSS context */ |