Exemplo n.º 1
0
  virtual void moduleInit() {
    mail_link(&unixdriver);   /* link in the unix driver */
    mail_link(&mhdriver);     /* link in the mh driver */
    /* According to c-client docs (internal.txt) this shouldn't be used. */
    /* mail_link(&mxdriver); */
    mail_link(&mmdfdriver);   /* link in the mmdf driver */
    mail_link(&newsdriver);   /* link in the news driver */
    mail_link(&philedriver);  /* link in the phile driver */

    mail_link(&imapdriver);   /* link in the imap driver */
    mail_link(&nntpdriver);   /* link in the nntp driver */
    mail_link(&pop3driver);   /* link in the pop3 driver */
    mail_link(&mbxdriver);    /* link in the mbx driver */
    mail_link(&tenexdriver);  /* link in the tenex driver */
    mail_link(&mtxdriver);    /* link in the mtx driver */
    mail_link(&dummydriver);  /* link in the dummy driver */

    auth_link(&auth_log);     /* link in the log authenticator */
    auth_link(&auth_md5);     /* link in the cram-md5 authenticator */

#ifndef SKIP_IMAP_GSS
    auth_link(&auth_gss);     /* link in the gss authenticator */
#endif

    auth_link(&auth_pla);     /* link in the plain authenticator */

#ifndef SKIP_IMAP_SSL
    ssl_onceonlyinit();
#endif

    /* plug in our gets */
    mail_parameters(NIL, SET_GETS, (void *) NIL);

    /* set default timeout values */
    void *timeout = reinterpret_cast<void *>(
      ThreadInfo::s_threadInfo.getNoCheck()->
        m_reqInjectionData.getSocketDefaultTimeout());

    mail_parameters(NIL, SET_OPENTIMEOUT,  timeout);
    mail_parameters(NIL, SET_READTIMEOUT,  timeout);
    mail_parameters(NIL, SET_WRITETIMEOUT, timeout);
    mail_parameters(NIL, SET_CLOSETIMEOUT, timeout);
  }
Exemplo n.º 2
0
bool InitSSL()
{
   ssl_onceonlyinit();

   return true;
}
Exemplo n.º 3
0
bool InitSSL(void) /* FIXME: MT */
{
   static bool s_errMsgGiven = false;

   if(gs_SSL_loaded)
      return gs_SSL_available;

   String ssl_dll = READ_APPCONFIG(MP_SSL_DLL_SSL);
   String crypto_dll = READ_APPCONFIG(MP_SSL_DLL_CRYPTO);

   // it doesn't take long so nobody sees this message anyhow
#if 0
   STATUSMESSAGE((_("Trying to load SSL libraries '%s' and '%s'..."),
                  crypto_dll.c_str(),
                  ssl_dll.c_str()));
#endif // 0

   if ( !gs_dllCrypto.Load(crypto_dll) )
      goto error;

   if ( !gs_dllSll.Load(ssl_dll) )
      goto error;

   SSL_LOOKUP(SSL_new);
   SSL_LOOKUP(SSL_free);
   SSL_LOOKUP(SSL_set_rfd);
   SSL_LOOKUP(SSL_set_wfd);
   SSL_LOOKUP(SSL_set_read_ahead);
   SSL_LOOKUP(SSL_connect);
   SSL_LOOKUP(SSL_read);
   SSL_LOOKUP(SSL_write);
   SSL_LOOKUP(SSL_pending);
   SSL_LOOKUP(SSL_library_init);
   SSL_LOOKUP(SSL_load_error_strings);
   SSL_LOOKUP(SSL_CTX_new);
   SSL_LOOKUP(SSL_CTX_use_certificate);
   SSL_LOOKUP(SSL_CTX_use_PrivateKey);
   SSL_LOOKUP(SSL_CIPHER_get_name);
   SSL_LOOKUP(SSL_CIPHER_get_bits);
   SSL_LOOKUP(SSL_get_current_cipher);
   SSL_LOOKUP(SSL_get_fd);
   SSL_LOOKUP(SSL_set_fd);
   SSL_LOOKUP(SSL_get_error);
   SSL_LOOKUP(SSL_get_peer_certificate);
   SSL_LOOKUP(sk_num);
   SSL_LOOKUP(sk_value);
   SSL_LOOKUP(RAND_seed);
   SSL_LOOKUP(BIO_new_socket);
   SSL_LOOKUP(BIO_new_mem_buf);
   SSL_LOOKUP(BIO_free);
   SSL_LOOKUP(SSL_CTX_ctrl);
   SSL_LOOKUP(SSL_CTX_set_verify);
   SSL_LOOKUP(SSL_CTX_load_verify_locations);
   SSL_LOOKUP(SSL_CTX_set_default_verify_paths);
   SSL_LOOKUP(SSL_set_bio);
   SSL_LOOKUP(SSL_set_connect_state);
   SSL_LOOKUP(SSL_state);
   SSL_LOOKUP(SSL_ctrl);
   SSL_LOOKUP(ERR_load_crypto_strings);
   SSL_LOOKUP(TLSv1_server_method);
   SSL_LOOKUP(SSLv23_server_method);
   SSL_LOOKUP(SSL_CTX_set_cipher_list);
   SSL_LOOKUP(SSL_CTX_use_certificate_chain_file);
   SSL_LOOKUP(SSL_CTX_use_RSAPrivateKey_file);
   SSL_LOOKUP(SSL_CTX_set_tmp_rsa_callback);
   SSL_LOOKUP(SSL_accept);
   SSL_LOOKUP(X509_STORE_CTX_get_error);
   SSL_LOOKUP(X509_verify_cert_error_string);
   SSL_LOOKUP(X509_STORE_CTX_get_current_cert);
   SSL_LOOKUP(X509_get_subject_name);
   SSL_LOOKUP(X509_NAME_oneline);
   SSL_LOOKUP(X509_get_ext_d2i);
   SSL_LOOKUP(X509_free);
   SSL_LOOKUP(SSL_shutdown);
   SSL_LOOKUP(SSL_CTX_free);
   SSL_LOOKUP(RSA_generate_key);
   SSL_LOOKUP(TLSv1_client_method);
   SSL_LOOKUP(SSLv23_client_method);
   SSL_LOOKUP(EVP_PKEY_free);
   SSL_LOOKUP(PEM_read_bio_X509);
   SSL_LOOKUP(PEM_read_bio_PrivateKey);

   CRYPTO_LOOKUP(ERR_get_error);
   CRYPTO_LOOKUP(ERR_error_string);

   gs_SSL_available =
   gs_SSL_loaded = true;

   STATUSMESSAGE((_("Successfully loaded '%s' and '%s' - "
                    "SSL authentication is now available."),
                  crypto_dll.c_str(),
                  ssl_dll.c_str()));

   ssl_onceonlyinit();

   return true;

error:
   if ( !s_errMsgGiven )
   {
      ERRORMESSAGE((_("SSL authentication is not available.")));

      s_errMsgGiven = true;

      // show the log dialog first
      wxLog::FlushActive();

      MDialog_Message
      (
         _("You can change the locations of the SSL and crypto "
           "libraries in the Helpers page of the preferences dialog\n"
           "if you have these libraries in non default location"
           " or if they have some other names on your system."),
         NULL,
         "SSL tip",
         "SSLLibTip"
      );
   }

   return false;
}