From: Ari Johnson Date: Wed, 27 Apr 2011 02:32:12 +0000 (-0400) Subject: Detect whether to use const SSL_METHOD * in myssl.c X-Git-Url: https://git.theari.com/?a=commitdiff_plain;h=782b4e6ff02af895ba5dd450f3bc612a83b6e071;p=cobramush.git Detect whether to use const SSL_METHOD * in myssl.c --- diff --git a/src/myssl.c b/src/myssl.c index e521c8f..c14560b 100644 --- a/src/myssl.c +++ b/src/myssl.c @@ -70,6 +70,7 @@ void shutdown_checkpoint(void); #include #endif +#include #include #include #include @@ -98,6 +99,12 @@ void shutdown_checkpoint(void); #define ssl_debugdump(x) #endif +#if OPENSSL_VERSION_NUMBER >= 0x10000000L +#define SSL_METHOD_CONST const +#else +#define SSL_METHOD_CONST +#endif + static void ssl_errordump(const char *msg); static int client_verify_callback(int preverify_ok, X509_STORE_CTX * x509_ctx); static DH *get_dh1024(void); @@ -112,7 +119,7 @@ static SSL_CTX *ctx = NULL; SSL_CTX * ssl_init(void) { - SSL_METHOD *meth; + SSL_METHOD_CONST SSL_METHOD *meth; unsigned char context[128]; DH *dh; unsigned int reps = 1;