You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by jp...@apache.org on 2012/02/19 18:51:43 UTC
git commit: Better SSL_METHOD type insulation
Updated Branches:
refs/heads/master 235bdf1c0 -> f753ff583
Better SSL_METHOD type insulation
Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/f753ff58
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/f753ff58
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/f753ff58
Branch: refs/heads/master
Commit: f753ff5837137d7c9a13ff02aba156248da2e4a4
Parents: 235bdf1
Author: James Peach <jp...@apache.org>
Authored: Sun Feb 19 09:51:01 2012 -0800
Committer: James Peach <jp...@apache.org>
Committed: Sun Feb 19 09:51:01 2012 -0800
----------------------------------------------------------------------
iocore/net/SSLCertLookup.cc | 12 +++++++-----
iocore/net/SSLNetProcessor.cc | 14 ++++++++------
2 files changed, 15 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/f753ff58/iocore/net/SSLCertLookup.cc
----------------------------------------------------------------------
diff --git a/iocore/net/SSLCertLookup.cc b/iocore/net/SSLCertLookup.cc
index 78a87fa..0fbd0ef 100644
--- a/iocore/net/SSLCertLookup.cc
+++ b/iocore/net/SSLCertLookup.cc
@@ -26,6 +26,12 @@
#include "P_SSLCertLookup.h"
#include "P_UnixNet.h"
+#if (OPENSSL_VERSION_NUMBER >= 0x10000000L) // openssl returns a const SSL_METHOD
+typedef const SSL_METHOD * ink_ssl_method_t;
+#else
+typedef SSL_METHOD * ink_ssl_method_t;
+#endif
+
SSLCertLookup sslCertLookup;
#define SSL_IP_TAG "dest_ip"
@@ -211,11 +217,7 @@ SSLCertLookup::addInfoToHash(
const char *strAddr, const char *cert,
const char *caCert, const char *serverPrivateKey) const
{
-#if (OPENSSL_VERSION_NUMBER >= 0x10000000L) // openssl returns a const SSL_METHOD
- const SSL_METHOD *meth = NULL;
-#else
- SSL_METHOD *meth = NULL;
-#endif
+ ink_ssl_method_t meth = NULL;
meth = SSLv23_server_method();
SSL_CTX *ctx = SSL_CTX_new(meth);
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/f753ff58/iocore/net/SSLNetProcessor.cc
----------------------------------------------------------------------
diff --git a/iocore/net/SSLNetProcessor.cc b/iocore/net/SSLNetProcessor.cc
index f1fc51e..89c31b0 100644
--- a/iocore/net/SSLNetProcessor.cc
+++ b/iocore/net/SSLNetProcessor.cc
@@ -25,6 +25,12 @@
#include "I_Layout.h"
#include "openssl/engine.h"
+#if (OPENSSL_VERSION_NUMBER >= 0x10000000L) // openssl returns a const SSL_METHOD
+typedef const SSL_METHOD * ink_ssl_method_t;
+#else
+typedef SSL_METHOD * ink_ssl_method_t;
+#endif
+
//
// Global Data
//
@@ -215,11 +221,7 @@ SSLNetProcessor::logSSLError(const char *errStr, int critical)
int
SSLNetProcessor::initSSL(const SslConfigParams * param)
{
-#if (OPENSSL_VERSION_NUMBER >= 0x10000000L) // openssl returns a const SSL_METHOD
- const SSL_METHOD *meth = NULL;
-#else
- SSL_METHOD *meth = NULL;
-#endif
+ ink_ssl_method_t meth = NULL;
// Note that we do not call RAND_seed() explicitly here, we depend on OpenSSL
// to do the seeding of the PRNG for us. This is the case for all platforms that
@@ -384,7 +386,7 @@ SSLNetProcessor::initSSLServerCTX(SSL_CTX * lCtx, const SslConfigParams * param,
int
SSLNetProcessor::initSSLClient(const SslConfigParams * param)
{
- const SSL_METHOD *meth = NULL;
+ ink_ssl_method_t meth = NULL;
int client_verify_server;
char *clientKeyPtr = NULL;