2011-08-30 [colin] 3.7.10cvs9
authorColin Leroy <colin@colino.net>
Tue, 30 Aug 2011 06:25:59 +0000 (06:25 +0000)
committerColin Leroy <colin@colino.net>
Tue, 30 Aug 2011 06:25:59 +0000 (06:25 +0000)
* src/etpan/imap-thread.c
* src/etpan/nntp-thread.c
Remove dead openSSL code

ChangeLog
PATCHSETS
configure.ac
src/etpan/imap-thread.c
src/etpan/nntp-thread.c

index 604330e..8680f7a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2011-08-30 [colin]     3.7.10cvs9
+
+       * src/etpan/imap-thread.c
+       * src/etpan/nntp-thread.c
+               Remove dead openSSL code
+
 2011-08-30 [colin]     3.7.10cvs8
 
        * src/ssl_manager.c
index 8283460..d98d059 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.1.2.12 -r 1.1.2.13 src/plugins/pgpcore/Makefile.am;  cvs diff -u -r 1.1.2.9 -r 1.1.2.10 src/plugins/pgpinline/Makefile.am;  cvs diff -u -r 1.1.2.12 -r 1.1.2.13 src/plugins/pgpmime/Makefile.am;  cvs diff -u -r 1.1.2.3 -r 1.1.2.4 src/plugins/smime/Makefile.am;  ) > 3.7.10cvs6.patchset
 ( cvs diff -u -r 1.105.2.167 -r 1.105.2.168 src/prefs_account.c;  ) > 3.7.10cvs7.patchset
 ( cvs diff -u -r 1.3.2.34 -r 1.3.2.35 src/ssl_manager.c;  cvs diff -u -r 1.9.2.44 -r 1.9.2.45 src/common/ssl.c;  cvs diff -u -r 1.4.2.39 -r 1.4.2.40 src/common/ssl_certificate.c;  cvs diff -u -r 1.1.4.15 -r 1.1.4.16 src/common/ssl_certificate.h;  cvs diff -u -r 1.1.4.115 -r 1.1.4.116 src/etpan/imap-thread.c;  cvs diff -u -r 1.1.2.17 -r 1.1.2.18 src/etpan/nntp-thread.c;  ) > 3.7.10cvs8.patchset
+( cvs diff -u -r 1.1.4.116 -r 1.1.4.117 src/etpan/imap-thread.c;  cvs diff -u -r 1.1.2.18 -r 1.1.2.19 src/etpan/nntp-thread.c;  ) > 3.7.10cvs9.patchset
index 3fc09b7..b4305f9 100644 (file)
@@ -12,7 +12,7 @@ MINOR_VERSION=7
 MICRO_VERSION=10
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=8
+EXTRA_VERSION=9
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index d78db3a..7dafdc4 100644 (file)
@@ -523,27 +523,7 @@ int imap_threaded_connect(Folder * folder, const char * server, int port)
 
 static int etpan_certificate_check(const unsigned char *certificate, int len, void *data)
 {
-#ifdef USE_OPENSSL
-       struct connect_param *param = (struct connect_param *)data;
-       X509 *cert = NULL;
-       
-       if (certificate == NULL || len < 0) {
-               g_warning("no cert presented.\n");
-               return 0;
-       }
-       cert = d2i_X509(NULL, (const unsigned char **)&certificate, len);
-       if (cert == NULL) {
-               g_warning("IMAP: can't get cert\n");
-               return 0;
-       } else if (ssl_certificate_check(cert, (gchar *)param->server,
-                       (gushort)param->port) == TRUE) {
-               X509_free(cert);
-               return 0;
-       } else {
-               X509_free(cert);
-               return -1;
-       }
-#elif USE_GNUTLS
+#ifdef USE_GNUTLS
        struct connect_param *param = (struct connect_param *)data;
        gnutls_x509_crt cert = NULL;
        gnutls_datum tmp;
@@ -574,17 +554,12 @@ static int etpan_certificate_check(const unsigned char *certificate, int len, vo
 
 static void connect_ssl_context_cb(struct mailstream_ssl_context * ssl_context, void * data)
 {
-#if (defined(USE_OPENSSL) || defined(USE_GNUTLS))
+#ifdef USE_GNUTLS
        PrefsAccount *account = (PrefsAccount *)data;
        const gchar *cert_path = NULL;
        const gchar *password = NULL;
-#ifdef USE_OPENSSL
-       X509 *x509 = NULL;
-       EVP_PKEY *pkey = NULL;
-#else
        gnutls_x509_crt x509 = NULL;
        gnutls_x509_privkey pkey = NULL;
-#endif
 
        if (account->in_ssl_client_cert_file && *account->in_ssl_client_cert_file)
                cert_path = account->in_ssl_client_cert_file;
@@ -604,13 +579,8 @@ static void connect_ssl_context_cb(struct mailstream_ssl_context * ssl_context,
                unsigned char *x509_der = NULL, *pkey_der = NULL;
                size_t x509_len, pkey_len;
                
-#ifndef USE_GNUTLS
-               x509_len = (size_t)i2d_X509(x509, &x509_der);
-               pkey_len = (size_t)i2d_PrivateKey(pkey, &pkey_der);
-#else
                x509_len = (size_t)gnutls_i2d_X509(x509, &x509_der);
                pkey_len = (size_t)gnutls_i2d_PrivateKey(pkey, &pkey_der);
-#endif
                if (x509_len > 0 && pkey_len > 0) {
                        if (mailstream_ssl_set_client_certificate_data(ssl_context, x509_der, x509_len) < 0 ||
                            mailstream_ssl_set_client_private_key_data(ssl_context, pkey_der, pkey_len) < 0) 
@@ -618,10 +588,8 @@ static void connect_ssl_context_cb(struct mailstream_ssl_context * ssl_context,
                        g_free(x509_der);
                        g_free(pkey_der);
                }
-#ifdef USE_GNUTLS
                gnutls_x509_crt_deinit(x509);
                gnutls_x509_privkey_deinit(pkey);
-#endif
        }
 #endif
 }
index 048842e..5267669 100644 (file)
@@ -374,27 +374,7 @@ int nntp_threaded_connect(Folder * folder, const char * server, int port)
 
 static int etpan_certificate_check(const unsigned char *certificate, int len, void *data)
 {
-#ifdef USE_OPENSSL
-       struct connect_param *param = (struct connect_param *)data;
-       X509 *cert = NULL;
-       
-       if (certificate == NULL || len < 0) {
-               g_warning("no cert presented.\n");
-               return 0;
-       }
-       cert = d2i_X509(NULL, (const unsigned char **)&certificate, len);
-       if (cert == NULL) {
-               g_warning("nntp: can't get cert\n");
-               return 0;
-       } else if (ssl_certificate_check(cert,
-               (gchar *)param->server, (gushort)param->port) == TRUE) {
-               X509_free(cert);
-               return 0;
-       } else {
-               X509_free(cert);
-               return -1;
-       }
-#elif USE_GNUTLS
+#ifdef USE_GNUTLS
        struct connect_param *param = (struct connect_param *)data;
        gnutls_x509_crt cert = NULL;
        gnutls_datum tmp;
@@ -425,17 +405,12 @@ static int etpan_certificate_check(const unsigned char *certificate, int len, vo
 
 static void connect_ssl_context_cb(struct mailstream_ssl_context * ssl_context, void * data)
 {
-#if (defined(USE_OPENSSL) || defined(USE_GNUTLS))
+#ifdef USE_GNUTLS
        PrefsAccount *account = (PrefsAccount *)data;
        const gchar *cert_path = NULL;
        const gchar *password = NULL;
-#ifdef USE_OPENSSL
-       X509 *x509 = NULL;
-       EVP_PKEY *pkey = NULL;
-#else
        gnutls_x509_crt x509 = NULL;
        gnutls_x509_privkey pkey = NULL;
-#endif
 
        if (account->in_ssl_client_cert_file && *account->in_ssl_client_cert_file)
                cert_path = account->in_ssl_client_cert_file;
@@ -455,13 +430,8 @@ static void connect_ssl_context_cb(struct mailstream_ssl_context * ssl_context,
                unsigned char *x509_der = NULL, *pkey_der = NULL;
                size_t x509_len, pkey_len;
                
-#ifndef USE_GNUTLS
-               x509_len = (size_t)i2d_X509(x509, &x509_der);
-               pkey_len = (size_t)i2d_PrivateKey(pkey, &pkey_der);
-#else
                x509_len = (size_t)gnutls_i2d_X509(x509, &x509_der);
                pkey_len = (size_t)gnutls_i2d_PrivateKey(pkey, &pkey_der);
-#endif
                if (x509_len > 0 && pkey_len > 0) {
                        if (mailstream_ssl_set_client_certificate_data(ssl_context, x509_der, x509_len) < 0 ||
                            mailstream_ssl_set_client_private_key_data(ssl_context, pkey_der, pkey_len) < 0) 
@@ -469,10 +439,8 @@ static void connect_ssl_context_cb(struct mailstream_ssl_context * ssl_context,
                        g_free(x509_der);
                        g_free(pkey_der);
                }
-#ifdef USE_GNUTLS
                gnutls_x509_crt_deinit(x509);
                gnutls_x509_privkey_deinit(pkey);
-#endif
        }
 #endif
 }