diff options
author | Magnus Hagander <magnus@hagander.net> | 2008-12-03 20:04:26 +0000 |
---|---|---|
committer | Magnus Hagander <magnus@hagander.net> | 2008-12-03 20:04:26 +0000 |
commit | 4e816286533dd34c10b368487d4079595a3e1418 (patch) | |
tree | bb6f8c63b5ca2445084cafc2455317f50658bba2 /src/backend | |
parent | c37951ebe945184bd71645c307407b4ecd587a13 (diff) | |
download | postgresql-4e816286533dd34c10b368487d4079595a3e1418.tar.gz postgresql-4e816286533dd34c10b368487d4079595a3e1418.zip |
Properly unregister OpenSSL callbacks when libpq is done with
it's connection. This is required for applications that unload
the libpq library (such as PHP) in which case we'd otherwise
have pointers to these functions when they no longer exist.
This needs a bit more testing before we can consider a backpatch,
so not doing that yet.
In passing, remove unused functions in backend/libpq.
Bruce Momjian and Magnus Hagander, per report and analysis
by Russell Smith.
Diffstat (limited to 'src/backend')
-rw-r--r-- | src/backend/libpq/be-secure.c | 27 |
1 files changed, 1 insertions, 26 deletions
diff --git a/src/backend/libpq/be-secure.c b/src/backend/libpq/be-secure.c index fd7e703c526..db41179b78e 100644 --- a/src/backend/libpq/be-secure.c +++ b/src/backend/libpq/be-secure.c @@ -11,7 +11,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/libpq/be-secure.c,v 1.86 2008/11/20 09:29:36 mha Exp $ + * $PostgreSQL: pgsql/src/backend/libpq/be-secure.c,v 1.87 2008/12/03 20:04:26 mha Exp $ * * Since the server static private key ($DataDir/server.key) * will normally be stored unencrypted so that the database @@ -88,7 +88,6 @@ static DH *tmp_dh_cb(SSL *s, int is_export, int keylength); static int verify_cb(int, X509_STORE_CTX *); static void info_cb(const SSL *ssl, int type, int args); static void initialize_SSL(void); -static void destroy_SSL(void); static int open_server_SSL(Port *); static void close_SSL(Port *); static const char *SSLerrmessage(void); @@ -193,17 +192,6 @@ secure_initialize(void) } /* - * Destroy global context - */ -void -secure_destroy(void) -{ -#ifdef USE_SSL - destroy_SSL(); -#endif -} - -/* * Indicate if we have loaded the root CA store to verify certificates */ bool @@ -844,19 +832,6 @@ initialize_SSL(void) } /* - * Destroy global SSL context. - */ -static void -destroy_SSL(void) -{ - if (SSL_context) - { - SSL_CTX_free(SSL_context); - SSL_context = NULL; - } -} - -/* * Attempt to negotiate SSL connection. */ static int |