Fix compiler warnings with OpenSSL 1.0.0
authorDavid Woodhouse <David.Woodhouse@intel.com>
Sat, 3 Oct 2009 09:54:19 +0000 (10:54 +0100)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Sat, 3 Oct 2009 09:54:19 +0000 (10:54 +0100)
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
dtls.c
openconnect.h
ssl.c

diff --git a/dtls.c b/dtls.c
index f88c3f5..99274e0 100644 (file)
--- a/dtls.c
+++ b/dtls.c
@@ -106,7 +106,7 @@ static unsigned char hex(const char *data)
 int connect_dtls_socket(struct openconnect_info *vpninfo)
 {
        STACK_OF(SSL_CIPHER) *ciphers;
-       SSL_METHOD *dtls_method;
+       method_const SSL_METHOD *dtls_method;
        SSL_CIPHER *dtls_cipher;
        SSL *dtls_ssl;
        BIO *dtls_bio;
index 77932b4..9755afb 100644 (file)
@@ -254,6 +254,12 @@ struct openconnect_info {
 #define AC_PKT_COMPRESSED      8       /* Compressed data */
 #define AC_PKT_TERM_SERVER     9       /* Server kick */
 
+/* Ick */
+#if OPENSSL_VERSION_NUMBER >= 0x10000000L
+#define method_const const
+#else
+#define method_const
+#endif
 
 /****************************************************************************/
 
diff --git a/ssl.c b/ssl.c
index 2e67634..741fba8 100644 (file)
--- a/ssl.c
+++ b/ssl.c
@@ -470,7 +470,7 @@ void workaround_openssl_certchain_bug(struct openconnect_info *vpninfo,
 
 int openconnect_open_https(struct openconnect_info *vpninfo)
 {
-       SSL_METHOD *ssl3_method;
+       method_const SSL_METHOD *ssl3_method;
        SSL *https_ssl;
        BIO *https_bio;
        int ssl_sock = -1;