Changeset 4622:296e096c6331

Show
Ignore:
Timestamp:
2006-04-28 01:35:02 (3 years ago)
Author:
Rocco Rutte <pdmef@…>
Branch:
HEAD
Message:

pdmef+fix+sslinterface. Triggered by a warning when compiling
with POP and GNUTLS, I noticed the SSL interfaces for OpenSSL
and GNUTLS internally are different which doesn't make sense.

Files:
13 modified

Legend:

Unmodified
Added
Removed
  • buffy.c

    r4475 r4622  
    310310#ifdef USE_IMAP 
    311311    if (tmp->magic != M_IMAP) 
     312    { 
    312313#endif 
    313314#ifdef USE_POP 
     
    328329      continue; 
    329330    } 
     331#ifdef USE_IMAP 
     332    } 
     333#endif 
    330334 
    331335    /* check to see if the folder is the currently selected folder 
  • configure.in

    r4620 r4622  
    588588 
    589589          AC_DEFINE(USE_SSL,1,[ Define if you want support for SSL. ]) 
     590          AC_DEFINE(USE_SSL_OPENSSL,1,[ Define if you want support for SSL via OpenSSL. ]) 
    590591          LIBS="$saved_LIBS" 
    591592          MUTTLIBS="$MUTTLIBS -lssl -lcrypto" 
     
    598599AC_ARG_WITH([gnutls], AC_HELP_STRING([--with-gnutls[=PFX]], [Enable SSL support using gnutls]), 
    599600    [gnutls_prefix="$withval"], [gnutls_prefix="no"]) 
    600 if test "$gnutls_prefix" != "no" 
     601if test "$gnutls_prefix" != "no" -a x"$need_ssl" != xyes 
    601602then 
    602603  if test "$need_socket" != "yes" 
     
    608609    CPPFLAGS="$CPPFLAGS $LIBGNUTLS_CFLAGS" 
    609610    MUTTLIBS="$MUTTLIBS $LIBGNUTLS_LIBS" 
    610     AC_DEFINE(USE_GNUTLS, 1, [Define if you want support for SSL via the gnutls library.]) 
     611 
     612    AC_DEFINE(USE_SSL,1,[ Define if you want support for SSL. ]) 
     613    AC_DEFINE(USE_SSL_GNUTLS,1,[ Define if you want support for SSL via GNUTLS. ]) 
    611614 
    612615    MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS mutt_ssl_gnutls.o" 
  • globals.h

    r4556 r4622  
    116116WHERE char *Spoolfile; 
    117117WHERE char *SpamSep; 
    118 #if defined(USE_SSL) || defined(USE_GNUTLS) 
     118#if defined(USE_SSL) 
    119119WHERE char *SslCertFile INITVAL (NULL); 
    120120#endif 
    121 #ifdef USE_SSL 
     121#ifdef USE_SSL_OPENSSL 
    122122WHERE char *SslClientCert INITVAL (NULL); 
    123123WHERE LIST *SslSessionCerts INITVAL (NULL); 
     
    126126WHERE char *SslEntropyFile INITVAL (NULL); 
    127127#endif 
    128 #ifdef USE_GNUTLS 
     128#ifdef USE_SSL_GNUTLS 
    129129WHERE short SslDHPrimeBits; 
    130130WHERE char *SslCACertFile INITVAL (NULL); 
  • imap/imap.c

    r4574 r4622  
    3333#include "message.h" 
    3434#include "imap_private.h" 
    35 #if defined(USE_SSL) || defined(USE_GNUTLS) 
     35#if defined(USE_SSL) 
    3636# include "mutt_ssl.h" 
    3737#endif 
     
    410410        && imap_check_capabilities (idata)) 
    411411      goto bail; 
    412 #if defined(USE_SSL) || defined(USE_GNUTLS) 
     412#if defined(USE_SSL) 
    413413    /* Attempt STARTTLS if available and desired. */ 
    414414    if (!idata->conn->ssf && (option(OPTSSLFORCETLS) || 
     
    427427        if (rc != -2) 
    428428        { 
    429 #ifdef USE_SSL 
    430429          if (mutt_ssl_starttls (idata->conn)) 
    431 #elif USE_GNUTLS 
    432           if (mutt_gnutls_starttls (idata->conn)) 
    433 #endif 
    434430          { 
    435431            mutt_error (_("Could not negotiate TLS connection")); 
     
    470466  return 0; 
    471467 
     468#if defined(USE_SSL) 
    472469 err_close_conn: 
    473470  mutt_socket_close (idata->conn); 
    474471  idata->state = IMAP_DISCONNECTED; 
     472#endif 
    475473 bail: 
    476474  FREE (&idata->capstr); 
  • init.c

    r4572 r4622  
    3232#include "mutt_idna.h" 
    3333 
    34 #if defined(USE_SSL) || defined(USE_GNUTLS) 
     34#if defined(USE_SSL) 
    3535#include "mutt_ssl.h" 
    3636#endif 
  • init.h

    r4606 r4622  
    9393#  define USE_POP 
    9494# endif 
     95# ifndef USE_SSL_OPENSSL 
     96#  define USE_SSL_OPENSSL 
     97# endif 
     98# ifndef USE_SSL_GNUTLS 
     99#  define USE_SSL_GNUTLS 
     100# endif 
    95101# ifndef USE_SSL 
    96102#  define USE_SSL 
    97 # endif 
    98 # ifndef USE_GNUTLS 
    99 #  define USE_GNUTLS 
    100103# endif 
    101104# ifndef USE_SOCKET 
     
    19151918  */ 
    19161919   
    1917 #if defined(USE_SSL) || defined(USE_GNUTLS) 
    1918 #ifdef USE_SSL 
     1920#if defined(USE_SSL) 
     1921#ifdef USE_SSL_OPENSSL 
    19191922  { "ssl_client_cert", DT_PATH, R_NONE, UL &SslClientCert, 0 }, 
    19201923  /* 
     
    19231926  ** key. 
    19241927  */ 
    1925 #endif /* USE_SSL */ 
     1928#endif /* USE_SSL_OPENSSL */ 
    19261929  { "ssl_force_tls",            DT_BOOL, R_NONE, OPTSSLFORCETLS, 0 }, 
    19271930  /* 
     
    19551958  ** Example: set certificate_file=~/.mutt/certificates 
    19561959  */ 
    1957 # if defined _MAKEDOC || !defined(USE_GNUTLS) 
     1960# if defined _MAKEDOC || !defined(USE_SSL_GNUTLS) 
    19581961  { "ssl_usesystemcerts", DT_BOOL, R_NONE, OPTSSLSYSTEMCERTS, 1 }, 
    19591962  /* 
     
    19751978  ** SSL authentication process. 
    19761979  */ 
    1977 # endif /* defined _MAKEDOC || !defined(USE_GNUTLS) */ 
     1980# endif /* defined _MAKEDOC || !defined(USE_SSL_GNUTLS) */ 
    19781981  { "ssl_use_sslv3", DT_BOOL, R_NONE, OPTSSLV3, 1 }, 
    19791982  /* 
     
    19881991  ** SSL authentication process. 
    19891992  */ 
    1990 # ifdef USE_GNUTLS 
     1993# ifdef USE_SSL_GNUTLS 
    19911994  { "ssl_min_dh_prime_bits", DT_NUM, R_NONE, UL &SslDHPrimeBits, 0 }, 
    19921995  /* 
     
    20052008  ** Example: set ssl_ca_certificates_file=/etc/ssl/certs/ca-certificates.crt 
    20062009  */ 
    2007 # endif /* USE_GNUTLS */ 
    2008 #endif /* defined(USE_SSL) || defined(USE_GNUTLS) */ 
     2010# endif /* USE_SSL_GNUTLS */ 
     2011#endif /* defined(USE_SSL) */ 
    20092012 
    20102013  { "pipe_split",       DT_BOOL, R_NONE, OPTPIPESPLIT, 0 }, 
  • main.c

    r4574 r4622  
    265265 
    266266         
    267 #ifdef USE_SSL 
    268         "+USE_SSL  " 
    269 #else 
    270         "-USE_SSL  " 
    271 #endif 
    272  
    273 #ifdef USE_GNUTLS 
    274         "+USE_GNUTLS  " 
    275 #else 
    276         "-USE_GNUTLS  " 
     267#ifdef USE_SSL_OPENSSL 
     268        "+USE_SSL_OPENSSL  " 
     269#else 
     270        "-USE_SSL_OPENSSL  " 
     271#endif 
     272 
     273#ifdef USE_SSL_GNUTLS 
     274        "+USE_SSL_GNUTLS  " 
     275#else 
     276        "-USE_SSL_GNUTLS  " 
    277277#endif 
    278278 
  • mutt.h

    r4556 r4622  
    249249  /* options for socket code */ 
    250250  M_NEW_SOCKET, 
    251 #ifdef USE_SSL 
     251#ifdef USE_SSL_OPENSSL 
    252252  M_NEW_SSL_SOCKET, 
    253253#endif 
     
    290290  OPT_REPLYTO, 
    291291  OPT_RECALL, 
    292 #if defined(USE_SSL) || defined(USE_GNUTLS) 
     292#if defined(USE_SSL) 
    293293  OPT_SSLSTARTTLS, 
    294294#endif 
     
    377377  OPTIMAPSERVERNOISE, 
    378378#endif 
    379 #if defined(USE_SSL) || defined(USE_GNUTLS) 
    380 # ifndef USE_GNUTLS 
     379#if defined(USE_SSL) 
     380# ifndef USE_SSL_GNUTLS 
    381381  OPTSSLSYSTEMCERTS, 
    382382  OPTSSLV2, 
    383 # endif /* USE_GNUTLS */ 
     383# endif /* USE_SSL_GNUTLS */ 
    384384  OPTSSLV3, 
    385385  OPTTLSV1, 
    386386  OPTSSLFORCETLS, 
    387 #endif /* defined(USE_SSL) || defined(USE_GNUTLS) */ 
     387#endif /* defined(USE_SSL) */ 
    388388  OPTIMPLICITAUTOVIEW, 
    389389  OPTINCLUDEONLYFIRST, 
  • mutt_socket.c

    r4468 r4622  
    2727#include "mutt_socket.h" 
    2828#include "mutt_tunnel.h" 
    29 #if defined(USE_SSL) || defined(USE_GNUTLS) 
     29#if defined(USE_SSL) 
    3030# include "mutt_ssl.h" 
    3131#endif 
     
    276276  else if (account->flags & M_ACCT_SSL)  
    277277  { 
    278 #ifdef USE_SSL 
    279     ssl_socket_setup (conn); 
    280 #elif USE_GNUTLS 
    281     if (mutt_gnutls_socket_setup (conn) < 0) 
     278#if defined(USE_SSL) 
     279    if (mutt_ssl_socket_setup (conn) < 0) 
    282280    { 
    283281      mutt_socket_free (conn); 
  • mutt_ssl.c

    r4477 r4622  
    230230 
    231231 
    232 int ssl_socket_setup (CONNECTION * conn) 
     232int mutt_ssl_socket_setup (CONNECTION * conn) 
    233233{ 
    234234  if (ssl_init() < 0) 
  • mutt_ssl.h

    r4343 r4622  
    2222#include "mutt_socket.h" 
    2323 
    24 #ifdef USE_SSL 
     24#if defined(USE_SSL) 
    2525int mutt_ssl_starttls (CONNECTION* conn); 
     26int mutt_ssl_socket_setup (CONNECTION *conn); 
     27#endif 
    2628 
    27 extern int ssl_socket_setup (CONNECTION *conn); 
    28 #endif 
    29 #ifdef USE_GNUTLS 
    30 int mutt_gnutls_starttls (CONNECTION* conn); 
    31  
    32 extern int mutt_gnutls_socket_setup (CONNECTION *conn); 
    33 #endif 
    3429#endif /* _MUTT_SSL_H_ */ 
  • mutt_ssl_gnutls.c

    r4477 r4622  
    7373} 
    7474 
    75 int mutt_gnutls_socket_setup (CONNECTION* conn) 
     75int mutt_ssl_socket_setup (CONNECTION* conn) 
    7676{ 
    7777  if (tls_init() < 0) 
     
    145145} 
    146146 
    147 int mutt_gnutls_starttls (CONNECTION* conn) 
     147int mutt_ssl_starttls (CONNECTION* conn) 
    148148{ 
    149149  if (tls_init() < 0) 
     
    442442          { 
    443443            regfree(&preg); 
    444             safe_free((void**)&linestr); 
     444            FREE(&linestr); 
    445445            fclose(fp); 
    446446            return 1; 
  • pop_lib.c

    r4343 r4622  
    2525#include "url.h" 
    2626#include "pop.h" 
    27 #ifdef USE_SSL 
     27#if defined(USE_SSL) 
    2828# include "mutt_ssl.h" 
    2929#endif 
     
    275275  } 
    276276 
    277 #if defined(USE_SSL) || defined(USE_GNUTLS) 
     277#if defined(USE_SSL) 
    278278  /* Attempt STLS if available and desired. */ 
    279279  if (!pop_data->conn->ssf && (pop_data->cmd_stls || option(OPTSSLFORCETLS))) 
     
    302302        mutt_sleep (2); 
    303303      } 
    304 #ifdef USE_SSL 
    305304      else if (mutt_ssl_starttls (pop_data->conn)) 
    306 #elif USE_GNUTLS 
    307       else if (mutt_gnutls_starttls (pop_data->conn)) 
    308 #endif 
    309305      { 
    310306        mutt_error (_("Could not negotiate TLS connection"));