summaryrefslogtreecommitdiff
path: root/mail/qpopper/files/patch-popper__pop_tls_openssl.c
blob: 90a78a32443c74760eded627bbf1ff10a8c2db9e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
--- popper/pop_tls_openssl.c.orig	2011-05-30 19:13:40 UTC
+++ popper/pop_tls_openssl.c
@@ -89,7 +89,7 @@
 /* ---- Globals ---- */
 extern volatile BOOL poptimeout;
 extern int           pop_timeout;
-jmp_buf              env;
+static jmp_buf	env;
 
 
 
@@ -312,21 +312,31 @@ openssl_init ( pop_tls *pTLS, POP *pPOP 
      * concern. 
      */
     switch ( pPOP->tls_version ) {
+#ifdef OPENSSL_NO_SSL2
+        case QPOP_SSLv2:
+#endif
+#ifdef OPENSSL_NO_SSL3_METHOD
+        case QPOP_SSLv3:
+#endif
         case QPOP_TLSvDEFAULT:  /* unspecified */
         case QPOP_SSLv23:
             DEBUG_LOG0 ( pPOP, "...setting method to SSLv23_server_method" );
             pTLS->m_OpenSSLmeth = SSLv23_server_method();
             break;
 
+#ifndef OPENSSL_NO_SSL2
         case QPOP_SSLv2:       /* SSL version 2 only */
             DEBUG_LOG0 ( pPOP, "...setting method to SSLv2_server_method" );
             pTLS->m_OpenSSLmeth = SSLv2_server_method();
             break;
+#endif
 
+#ifndef OPENSSL_NO_SSL3_METHOD
         case QPOP_SSLv3:       /* SSL version 3 only */
             DEBUG_LOG0 ( pPOP, "...setting method to SSLv3_server_method" );
             pTLS->m_OpenSSLmeth = SSLv3_server_method();
             break;
+#endif
 
         case QPOP_TLSv1:       /* TLS version 1 only */
             DEBUG_LOG0 ( pPOP, "...setting method to TLSv1_server_method" );
@@ -537,7 +547,8 @@ openssl_handshake ( pop_tls *pTLS )
                           "%s session-id; cipher: %s (%s), %d bits",
                           VERSION, SSL_CIPHER_get_version(ciph),
                           pTLS->m_pPOP->client, pTLS->m_pPOP->ipaddr,
-                          ( pTLS->m_OpenSSLconn->hit ? "reused" : "new" ),
+                          ( SSL_session_reused(pTLS->m_OpenSSLconn) ?
+                            "reused" : "new" ),
                           ( ciph_name != NULL ? ciph_name : "(none)" ),
                           get_cipher_description ( ciph, buf, sizeof(buf) ),
                           SSL_CIPHER_get_bits    ( ciph, &al_bits ) );