From a93e7432cff306dad75dcd242ced9f80436cecc1 Mon Sep 17 00:00:00 2001 From: Magnus Hagander Date: Tue, 23 Jun 2009 18:13:23 +0000 Subject: Properly initialize SSL engines when used from libpq. This is required for most external engines. Per report and initial code from Lars Kanis --- src/interfaces/libpq/libpq-int.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/interfaces/libpq/libpq-int.h') 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 #include + +#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 */ -- cgit v1.2.3