[M-git] Mahogany sources repository. branch master updated. v0.67-831-g403f3c88

vadz via Mahogany-cvsupdates <[email protected]> Sun, 30 Jul 2023 22:50:15 +0000
Newsgroups gmane.mail.mahogany.cvs
Message-ID <[email protected]>
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Mahogany sources repository.".

The branch, master has been updated
       via  403f3c88baa7e085a2b3eb311e66e2cc20d8a509 (commit)
       via  e4c01c740208135fd21db8321daa34c744da50c5 (commit)
       via  7c0dceb54b8a0a58a72bd0f56a37bb4f81b44a86 (commit)
       via  9b487ce19ebff28117f29bb4992e6157adb191ac (commit)
       via  f4df09d95ce0cbc8a87a99dcd4e0d709a0831318 (commit)
       via  eaf382ea13e9c7cc1d2c0647e4f48496617c293a (commit)
      from  d0ecd4ca6401b383bdf9f7f4fea5b5cabedaf2f1 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 403f3c88baa7e085a2b3eb311e66e2cc20d8a509
Author: Vadim Zeitlin <[email protected]>
Date:   Mon Jul 31 00:48:44 2023 +0200

    Add a dummy icon and a .desktop file using it
    
    This is better than nothing (although not by much).

diff --git a/extra/install/M.svg b/extra/install/M.svg
new file mode 100644
index 00000000..91fdca16
--- /dev/null
+++ b/extra/install/M.svg
@@ -0,0 +1,96 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+   version="1.1"
+   width="256"
+   height="256"
+   viewBox="0 0 256 256"
+   xml:space="preserve"
+   id="svg74"
+   sodipodi:docname="envelope.svg"
+   inkscape:version="1.2.2 (b0a8486541, 2022-12-01)"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:svg="http://www.w3.org/2000/svg"><sodipodi:namedview
+   id="namedview76"
+   pagecolor="#ffffff"
+   bordercolor="#000000"
+   borderopacity="0.25"
+   inkscape:showpageshadow="2"
+   inkscape:pageopacity="0.0"
+   inkscape:pagecheckerboard="0"
+   inkscape:deskcolor="#d1d1d1"
+   showgrid="false"
+   inkscape:zoom="0.921875"
+   inkscape:cx="-144.81356"
+   inkscape:cy="128"
+   inkscape:window-width="1920"
+   inkscape:window-height="1011"
+   inkscape:window-x="0"
+   inkscape:window-y="0"
+   inkscape:window-maximized="1"
+   inkscape:current-layer="g72" />
+
+<defs
+   id="defs56"><rect
+   x="177.59322"
+   y="189.31356"
+   width="64.580508"
+   height="52.95339"
+   id="rect4099" />
+</defs>
+<g
+   style="stroke: none; stroke-width: 0; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: none; fill-rule: nonzero; opacity: 1;"
+   transform="translate(1.4065934065934016 1.4065934065934016) scale(2.81 2.81)"
+   id="g72">
+	<path
+   d="m 89.294,31.075512 -42.013,42.014 c -0.941,0.941 -2.466,0.941 -3.406,0 l -28.388,-28.388 c -0.941,-0.941 -0.941,-2.466 0,-3.406 L 57.501,-0.71748754 c 0.941,-0.94099996 2.466,-0.94099996 3.406,0 L 89.294,27.669512 c 0.941,0.941 0.941,2.466 0,3.406 z"
+   style="opacity:1;fill:#bf4000;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;image-rendering:auto;fill-opacity:1"
+   stroke-linecap="round"
+   id="path58" />
+	<path
+   d="M 21.236 45.964 c -0.547 0 -0.996 -0.436 -1.01 -0.986 c -0.014 -0.558 0.427 -1.023 0.985 -1.037 l 36.569 -0.943 l 0.943 -36.57 c 0.015 -0.558 0.488 -1.015 1.037 -0.985 c 0.559 0.014 0.999 0.478 0.986 1.037 l -0.968 37.53 c -0.014 0.538 -0.447 0.971 -0.986 0.985 l -37.529 0.967 C 21.254 45.963 21.245 45.964 21.236 45.964 z"
+   style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: rgb(255,255,255); fill-rule: nonzero; opacity: 1;"
+   transform=" matrix(1 0 0 1 0 0) "
+   stroke-linecap="round"
+   id="path60" />
+	<path
+   d="M 59.084 32.643 c -0.537 0 -0.985 -0.423 -1.009 -0.965 c -0.026 -0.558 0.406 -1.031 0.964 -1.057 l 24.688 -1.137 c 0.55 -0.017 1.031 0.405 1.057 0.964 c 0.026 0.558 -0.406 1.031 -0.964 1.057 l -24.688 1.137 C 59.116 32.642 59.1 32.643 59.084 32.643 z"
+   style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: rgb(255,255,255); fill-rule: nonzero; opacity: 1;"
+   transform=" matrix(1 0 0 1 0 0) "
+   stroke-linecap="round"
+   id="path62" />
+	<path
+   d="M 45.219 70.063 c -0.016 0 -0.032 0 -0.047 -0.001 c -0.558 -0.026 -0.99 -0.499 -0.964 -1.057 l 1.137 -24.689 c 0.026 -0.558 0.506 -0.979 1.057 -0.964 c 0.558 0.026 0.99 0.499 0.964 1.057 l -1.137 24.689 C 46.203 69.64 45.755 70.063 45.219 70.063 z"
+   style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: rgb(255,255,255); fill-rule: nonzero; opacity: 1;"
+   transform=" matrix(1 0 0 1 0 0) "
+   stroke-linecap="round"
+   id="path64" />
+	<path
+   d="M 1.011 90 c -0.259 0 -0.517 -0.099 -0.715 -0.296 c -0.395 -0.395 -0.395 -1.035 0 -1.43 L 21.99 66.58 c 0.395 -0.395 1.035 -0.395 1.43 0 c 0.395 0.395 0.395 1.035 0 1.43 L 1.726 89.704 C 1.529 89.901 1.27 90 1.011 90 z"
+   style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: rgb(91,93,110); fill-rule: nonzero; opacity: 1;"
+   transform=" matrix(1 0 0 1 0 0) "
+   stroke-linecap="round"
+   id="path66" />
+	<path
+   d="M 2.284 69.58 c -0.259 0 -0.517 -0.099 -0.715 -0.296 c -0.395 -0.395 -0.395 -1.035 0 -1.43 l 10.847 -10.847 c 0.395 -0.395 1.035 -0.395 1.43 0 c 0.395 0.395 0.395 1.035 0 1.43 L 2.999 69.283 C 2.802 69.481 2.543 69.58 2.284 69.58 z"
+   style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: rgb(91,93,110); fill-rule: nonzero; opacity: 1;"
+   transform=" matrix(1 0 0 1 0 0) "
+   stroke-linecap="round"
+   id="path68" />
+	<path
+   d="M 21.432 88.727 c -0.259 0 -0.517 -0.099 -0.715 -0.296 c -0.395 -0.395 -0.395 -1.035 0 -1.43 l 10.847 -10.847 c 0.395 -0.395 1.035 -0.395 1.43 0 c 0.395 0.395 0.395 1.035 0 1.43 L 22.147 88.431 C 21.949 88.628 21.691 88.727 21.432 88.727 z"
+   style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: rgb(91,93,110); fill-rule: nonzero; opacity: 1;"
+   transform=" matrix(1 0 0 1 0 0) "
+   stroke-linecap="round"
+   id="path70" />
+<text
+   xml:space="preserve"
+   transform="matrix(0.35587189,0,0,0.35587189,-0.50056705,-0.50056705)"
+   id="text4097"
+   style="white-space:pre;shape-inside:url(#rect4099);fill:#bf4000;fill-opacity:1"><tspan
+     x="177.59375"
+     y="199.93164"
+     id="tspan4117">Mahogany
+</tspan></text></g>
+</svg>
diff --git a/extra/install/mahogany.desktop b/extra/install/mahogany.desktop
new file mode 100644
index 00000000..7599d5e3
--- /dev/null
+++ b/extra/install/mahogany.desktop
@@ -0,0 +1,7 @@
+[Desktop Entry]
+Type=Application
+Name=Mahogany
+Icon=mahogany.svg
+StartupWMClass=M
+StartupNotify=true
+Exec=/usr/bin/M

commit e4c01c740208135fd21db8321daa34c744da50c5
Author: Vadim Zeitlin <[email protected]>
Date:   Mon Jul 31 00:45:27 2023 +0200

    Always link with OpenSSL libraries under Unix
    
    Remove obsolete and broken code for loading these libraries dynamically
    and just call ssl_onceonlyinit() under all platforms.

diff --git a/configure.ac b/configure.ac
index 34ea1373..3ac064d8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1318,7 +1318,7 @@ dnl --------------------------------------------------------------------------
 dnl add other flags
 CFLAGS="$CFLAGS $CODE_GEN_FLAGS"
 CXXFLAGS="$CXXFLAGS $CODE_GEN_FLAGS"
-LIBS="$LIBS $PYTHON_LIBS $LIB_EFENCE $LIB_DMALLOC $LIB_PAM"
+LIBS="$LIBS $PYTHON_LIBS $LIB_EFENCE $LIB_DMALLOC $LIB_PAM $LIBS_SSL"
 
 dnl imap
 IMAP_CFLAGS="$CFLAGS $IMAP_CFLAGS"
diff --git a/src/util/ssl.cpp b/src/util/ssl.cpp
index 450d3390..c2a3f2b8 100644
--- a/src/util/ssl.cpp
+++ b/src/util/ssl.cpp
@@ -21,425 +21,8 @@
 
    // needed to get ssl_onceonlyinit() declaration
    #include "Mcclient.h"
-
-   #if defined(OS_UNIX) || defined(__CYGWIN__)
-      #include "Profile.h"
-      #include "MApplication.h"
-   #endif
 #endif // USE_PCH
 
-#include "gui/wxMDialogs.h"
-
-// under Unix we have to load libssl and libcrypto to provide access to them to
-// c-client
-#if (defined(OS_UNIX) || defined(__CYGWIN__)) && !defined(__WINE__)
-
-#include <wx/dynlib.h>
-
-#include <stdint.h>
-
-extern const MOption MP_SSL_DLL_CRYPTO;
-extern const MOption MP_SSL_DLL_SSL;
-
-/* These functions will serve as stubs for the real openSSL library
-   and must be initialised at runtime as c-client actually links
-   against these. */
-
-#include <openssl/ssl.h>
-#include <openssl/opensslv.h>
-
-// starting from 0.9.6a, OpenSSL uses void, as it should, instead of char
-#if defined(OPENSSL_VERSION_NUMBER) && (OPENSSL_VERSION_NUMBER > 0x0090600fL)
-   #define ssl_data_t void *
-#else // old ssl
-   #define ssl_data_t char *
-#endif
-// starting from 0.9.7, OpenSSL uses void instead of char
-#if defined(OPENSSL_VERSION_NUMBER) && (OPENSSL_VERSION_NUMBER >= 0x0090700fL)
-   #define ssl_parg void *
-#else // old ssl
-   #define ssl_parg char *
-#endif
-
-// starting from 0.9.7g OpenSSL has discovered const correctness (better late
-// than never)
-#if defined(OPENSSL_VERSION_NUMBER) && (OPENSSL_VERSION_NUMBER >= 0x0090707fL)
-   #define ssl_const1 const
-#else
-   #define ssl_const1
-#endif
-// OpenSSL 1.0.0-beta3
-#if defined(OPENSSL_VERSION_NUMBER) && (OPENSSL_VERSION_NUMBER >= 0x10000003L)
-   #define ssl_const2 const
-   #define ssl_STACK _STACK
-   #define sk_value_t void *
-#else
-   #define ssl_const2
-   #define ssl_STACK STACK
-   #define sk_value_t char *
-#endif
-// OpenSSL 1.0.2g
-#if defined(OPENSSL_VERSION_NUMBER) && (OPENSSL_VERSION_NUMBER >= 0x1000207fL)
-   #define ssl_const3 const
-#else
-   #define ssl_const3
-#endif
-// OpenSSL 1.1.0
-#if defined(OPENSSL_VERSION_NUMBER) && (OPENSSL_VERSION_NUMBER >= 0x10100000L)
-   #define ssl_const110 const
-
-   // A couple of functions used by c-client code were deprecated in OpenSSL
-   // 1.1.0 and preserved only as compatibility defines. We still want to
-   // define stub functions for them though and macros just get into the way.
-   #undef SSL_library_init
-   #undef SSL_load_error_strings
-   #undef ERR_load_crypto_strings
-   #undef SSL_CTX_set_tmp_rsa_callback
-   #undef SSLv23_client_method
-   #undef SSLv23_server_method
-   #undef sk_num
-   #undef sk_value
-#else
-   #define ssl_const110
-
-   // Conversely, a few functions existed as macros originally but need to be
-   // loaded dynamically in 1.1.0. Handling them is simpler as c-client code
-   // will still use the macros with old versions, while we'll provide the
-   // forwarder functions for the later ones.
-   #undef SSL_in_init
-   #undef SSL_CTX_set_options
-#endif
-// OpenSSL 1.1.1
-#if defined(OPENSSL_VERSION_NUMBER) && (OPENSSL_VERSION_NUMBER >= 0x1010100fL)
-   #define ssl_const111 const
-#else
-   #define ssl_const111
-#endif
-// OpenSSL 3.0
-#if defined(OPENSSL_VERSION_NUMBER) && (OPENSSL_VERSION_NUMBER >= 0x30000000L)
-   #define ssl_const30 const
-   #define SSL_get_peer_certificate SSL_get1_peer_certificate
-#else
-   #define ssl_const30
-#endif
-
-/* This is our interface to the library and auth_ssl.c in c-client
-   which are all in "C" */
-extern "C" {
-
-/*
-   This macro is used to do the following things:
-
-   1. define the type for the given SSL functions
-   2. declare a variable of this type named stub_SSL_XXX and init it to NULL
-   3. declare our SSL_XXX which simply forwards to stub_SSL_XXX
- */
-#define SSL_DEF2(returnval, name, args, params, ret) \
-   typedef returnval (* name##_TYPE) args ; \
-   name##_TYPE stub_##name = NULL; \
-   returnval name args \
-      { ret (*stub_##name) params; }
-
-// the SSL_DEF macro for non void functions
-#define SSL_DEF(returnval, name, args, params) \
-   SSL_DEF2(returnval, name, args, params, return)
-
-// ... and for the void ones
-#define SSL_DEF_VOID(name, args, params) \
-   SSL_DEF2(void, name, args, params, (void))
-
-#define SSL_LOOKUP_NO_ERROR_CHECK(name) \
-      stub_##name = (name##_TYPE) gs_dllSll.GetSymbol(#name)
-
-#define SSL_LOOKUP(name) \
-      SSL_LOOKUP_NO_ERROR_CHECK(name); \
-      if ( !stub_##name ) \
-         goto error
-
-#define CRYPTO_LOOKUP(name) \
-      stub_##name = (name##_TYPE) gs_dllCrypto.GetSymbol(#name); \
-      if ( !stub_##name ) \
-         goto error
-
-SSL_DEF( SSL *, SSL_new, (SSL_CTX *ctx), (ctx) );
-SSL_DEF_VOID( SSL_free, (SSL *s), (s) );
-SSL_DEF( int,  SSL_set_rfd, (SSL *s, int fd), (s, fd) );
-SSL_DEF( int,  SSL_set_wfd, (SSL *s, int fd), (s, fd) );
-SSL_DEF_VOID( SSL_set_read_ahead, (SSL *s, int yes), (s, yes) );
-SSL_DEF( int,  SSL_connect, (SSL *s), (s) );
-SSL_DEF( int,  SSL_read, (SSL *s,ssl_data_t buf,int num), (s, buf, num) );
-SSL_DEF( int,  SSL_write, (SSL *s,const ssl_data_t buf,int num), (s, buf, num) );
-SSL_DEF( int,  SSL_pending, (ssl_const1 SSL *s), (s) );
-SSL_DEF( int,  SSL_library_init, (void ), () );
-SSL_DEF_VOID( SSL_load_error_strings, (void ), () );
-SSL_DEF( SSL_CTX *,SSL_CTX_new, (ssl_const2 SSL_METHOD *meth), (meth) );
-SSL_DEF( const char *, SSL_CIPHER_get_name, (ssl_const1 SSL_CIPHER *c), (c) );
-SSL_DEF( int, SSL_CIPHER_get_bits, (ssl_const1 SSL_CIPHER *c, int *alg_bits), (c,alg_bits) );
-SSL_DEF( ssl_const2 SSL_CIPHER *, SSL_get_current_cipher ,(ssl_const1 SSL *s), (s) );
-SSL_DEF( int, SSL_get_fd, (ssl_const1 SSL *s), (s) );
-SSL_DEF( int, SSL_set_fd, (SSL *s, int fd), (s, fd) );
-SSL_DEF( int, SSL_get_error, (ssl_const1 SSL *s, int ret_code), (s, ret_code) );
-SSL_DEF( X509 *, SSL_get_peer_certificate, (ssl_const1 SSL *s), (s) );
-
-SSL_DEF( int, sk_num, (const ssl_STACK *s), (s) );
-SSL_DEF( sk_value_t, sk_value, (const ssl_STACK *s, int n), (s, n) );
-
-SSL_DEF( int, OPENSSL_sk_num, (const struct stack_st *s), (s) );
-SSL_DEF( void*, OPENSSL_sk_value, (const struct stack_st *s, int n), (s, n) );
-
-SSL_DEF_VOID( RAND_seed, (const void *buf,int num), (buf, num) );
-SSL_DEF( BIO *, BIO_new_socket, (int sock, int close_flag), (sock, close_flag) );
-SSL_DEF( BIO *, BIO_new_mem_buf, (ssl_const3 void *buf, int len), (buf, len) );
-SSL_DEF( int, BIO_free, (BIO *a), (a) );
-SSL_DEF( long, SSL_CTX_ctrl, (SSL_CTX *ctx,int cmd, long larg, ssl_parg parg), (ctx,cmd,larg,parg) );
-SSL_DEF_VOID( SSL_CTX_set_verify, (SSL_CTX *ctx,int mode, int (*callback)(int, X509_STORE_CTX *)), (ctx,mode,callback) );
-SSL_DEF( int, SSL_CTX_load_verify_locations, (SSL_CTX *ctx, const char *CAfile, const char *CApath), (ctx, CAfile, CApath) );
-SSL_DEF( int, SSL_CTX_set_default_verify_paths, (SSL_CTX *ctx), (ctx) );
-SSL_DEF_VOID( SSL_set_bio, (SSL *s, BIO *rbio,BIO *wbio), (s,rbio,wbio) );
-SSL_DEF_VOID( SSL_set_connect_state, (SSL *s), (s) );
-SSL_DEF( int, SSL_state, (ssl_const1 SSL *ssl), (ssl) );
-SSL_DEF( long,    SSL_ctrl, (SSL *ssl,int cmd, long larg, ssl_parg parg), (ssl,cmd,larg,parg) );
-SSL_DEF_VOID( ERR_load_crypto_strings, (void), () );
-SSL_DEF( ssl_const2 SSL_METHOD *,TLSv1_server_method, (void), () );
-SSL_DEF( ssl_const2 SSL_METHOD *,SSLv23_server_method, (void), () );
-SSL_DEF( int, SSL_CTX_set_cipher_list, (SSL_CTX *ctx,const char *str), (ctx,str) );
-SSL_DEF( int, SSL_CTX_use_certificate_chain_file, (SSL_CTX *ctx, const char *file), (ctx,file) );
-SSL_DEF( int, SSL_CTX_use_RSAPrivateKey_file, (SSL_CTX *ctx, const char *file, int type), (ctx,file,type) );
-SSL_DEF_VOID( SSL_CTX_set_tmp_rsa_callback, (SSL_CTX *ctx, RSA *(*cb)(SSL *,int, int)), (ctx,cb) );
-SSL_DEF( int,  SSL_accept, (SSL *ssl), (ssl) );
-SSL_DEF( int, X509_STORE_CTX_get_error, (ssl_const30 X509_STORE_CTX *ctx), (ctx) );
-SSL_DEF( const char *, X509_verify_cert_error_string, (long n), (n) );
-SSL_DEF( X509 *, X509_STORE_CTX_get_current_cert, (ssl_const30 X509_STORE_CTX *ctx), (ctx) );
-SSL_DEF( X509_NAME *, X509_get_subject_name, (ssl_const110 X509 *a), (a) );
-SSL_DEF( char *, X509_NAME_oneline, (ssl_const110 X509_NAME *a,char *buf,int size), (a,buf,size) );
-SSL_DEF( void *, X509_get_ext_d2i, (ssl_const110 X509 *x, int nid, int *crit, int *idx), (x, nid, crit, idx) );
-SSL_DEF_VOID( X509_free, (X509 *x), (x) );
-SSL_DEF( int, SSL_shutdown, (SSL *s), (s) );
-SSL_DEF( int, SSL_CTX_use_certificate, (SSL_CTX *ctx, X509 *x), (ctx, x) );
-SSL_DEF( int, SSL_CTX_use_PrivateKey, (SSL_CTX *ctx, EVP_PKEY *pk), (ctx, pk) );
-SSL_DEF_VOID( SSL_CTX_free, (SSL_CTX *ctx), (ctx) );
-SSL_DEF( RSA *, RSA_generate_key, (int bits, unsigned long e,void (*cb)(int,int,void *),void *cb_arg), (bits,e,cb,cb_arg) );
-SSL_DEF(ssl_const2 SSL_METHOD *, TLSv1_client_method, (void), () );
-SSL_DEF(ssl_const2 SSL_METHOD *, SSLv23_client_method, (void), () );
-SSL_DEF_VOID( EVP_PKEY_free, (EVP_PKEY *pk), (pk) );
-SSL_DEF( X509 *, PEM_read_bio_X509, (BIO *bp, X509 **x, pem_password_cb *cb, void *u), (bp, x, cb, u) );
-SSL_DEF( EVP_PKEY *, PEM_read_bio_PrivateKey, (BIO *bp, EVP_PKEY **x, pem_password_cb *cb, void *u), (bp, x, cb, u) );
-
-SSL_DEF( unsigned long, ERR_get_error, (void), () );
-SSL_DEF( char *, ERR_error_string, (unsigned long e, char *p), (e, p) );
-
-// Those are macros until 1.1.0, functions in it.
-SSL_DEF( int, SSL_in_init, (ssl_const111 SSL* s), (s) );
-SSL_DEF( unsigned long, SSL_CTX_set_options, (SSL_CTX *ctx, unsigned long op), (ctx, op) );
-
-// These functions are used inside macro expansions in openssl/ssl.h.
-SSL_DEF( int, OPENSSL_init_ssl, (uint64_t opts, const struct ossl_init_settings_st* settings), (opts, settings) );
-SSL_DEF( int, OPENSSL_init_crypto, (uint64_t opts, const struct ossl_init_settings_st* settings), (opts, settings) );
-
-} // extern "C"
-
-// These functions are not used by c-client but only in this file itself.
-SSL_DEF( const SSL_METHOD *, TLS_client_method, (void), () );
-SSL_DEF( const SSL_METHOD *, TLS_server_method, (void), () );
-
-static int compat_SSL_library_init()
-{
-   return (*stub_OPENSSL_init_ssl)(0, NULL);
-}
-
-#ifndef OPENSSL_INIT_LOAD_SSL_STRINGS
-   #define OPENSSL_INIT_LOAD_SSL_STRINGS 0x00200000L
-#endif
-#ifndef OPENSSL_INIT_LOAD_CRYPTO_STRINGS
-   #define OPENSSL_INIT_LOAD_CRYPTO_STRINGS 0x00000002L
-#endif
-
-static void compat_SSL_load_error_strings()
-{
-   (*stub_OPENSSL_init_ssl)(OPENSSL_INIT_LOAD_SSL_STRINGS |
-                            OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL);
-}
-
-static void compat_ERR_load_crypto_strings()
-{
-   (*stub_OPENSSL_init_crypto)(OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL);
-}
-
-static void compat_SSL_CTX_set_tmp_rsa_callback(SSL_CTX *, RSA *(*)(SSL *, int, int))
-{
-   // Nothing to do here, this seems to be unsupported in OpenSSL 1.1.0.
-}
-
-#undef SSL_DEF
-
-static bool gs_SSL_loaded = false;
-static bool gs_SSL_available = false;
-
-static wxDynamicLibrary gs_dllSll,
-                        gs_dllCrypto;
-
-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_NO_ERROR_CHECK(SSL_library_init);
-   if ( stub_SSL_library_init )
-   {
-      // We must be using OpenSSL < 1.1.0, so all the other functions removed
-      // in 1.1.0 should be there.
-      SSL_LOOKUP(SSL_load_error_strings);
-      SSL_LOOKUP(ERR_load_crypto_strings);
-      SSL_LOOKUP(SSL_CTX_set_tmp_rsa_callback);
-      SSL_LOOKUP(SSLv23_server_method);
-      SSL_LOOKUP(SSLv23_client_method);
-      SSL_LOOKUP(sk_num);
-      SSL_LOOKUP(sk_value);
-   }
-   else // Perhaps it's OpenSSL 1.1.0+, check for new functions.
-   {
-      SSL_LOOKUP(OPENSSL_init_ssl);
-      SSL_LOOKUP(OPENSSL_init_crypto);
-      SSL_LOOKUP(TLS_server_method);
-      SSL_LOOKUP(TLS_client_method);
-      SSL_LOOKUP(OPENSSL_sk_num);
-      SSL_LOOKUP(OPENSSL_sk_value);
-      SSL_LOOKUP(SSL_in_init);
-      SSL_LOOKUP(SSL_CTX_set_options);
-
-      // We've got the new functions, but we still need to provide the old ones
-      // to c-client
-      stub_SSL_library_init = compat_SSL_library_init;
-      stub_SSL_load_error_strings = compat_SSL_load_error_strings;
-      stub_ERR_load_crypto_strings = compat_ERR_load_crypto_strings;
-      stub_SSL_CTX_set_tmp_rsa_callback = compat_SSL_CTX_set_tmp_rsa_callback;
-      stub_SSLv23_client_method = stub_TLS_client_method;
-      stub_SSLv23_server_method = stub_TLS_server_method;
-   }
-
-   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_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);
-// OpenSSL 3.0
-#if defined(OPENSSL_VERSION_NUMBER) && (OPENSSL_VERSION_NUMBER >= 0x30000000L)
-   SSL_LOOKUP(SSL_get1_peer_certificate);
-#else
-   SSL_LOOKUP(SSL_get_peer_certificate);
-#endif
-   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_ctrl);
-   SSL_LOOKUP(TLSv1_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_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(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:
-   // Unload the DLLs to avoid assertion failures when calling Load() on them
-   // again if we reattempt SSL initialization later (note that Unload() itself
-   // doesn't assert and just doesn't do anything if the DLL is not loaded).
-   gs_dllSll.Unload();
-   gs_dllCrypto.Unload();
-
-   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;
-}
-
-#undef SSL_LOOKUP
-
-#else // !OS_UNIX
-
 bool InitSSL()
 {
    ssl_onceonlyinit();
@@ -447,8 +30,6 @@ bool InitSSL()
    return true;
 }
 
-#endif // OS_UNIX/!OS_UNIX
-
 #else // !USE_SSL
 
 bool InitSSL(void)

commit 7c0dceb54b8a0a58a72bd0f56a37bb4f81b44a86
Author: Vadim Zeitlin <[email protected]>
Date:   Mon Jul 31 00:44:37 2023 +0200

    Fix deprecation warning due to wrong wxString ctor use
    
    The warning was about deprecated ctor argument but actually the code was
    just wrong and we need to check for the encoding availability in a
    different way.

diff --git a/src/util/strutil.cpp b/src/util/strutil.cpp
index f4ee6ea0..d017c823 100644
--- a/src/util/strutil.cpp
+++ b/src/util/strutil.cpp
@@ -1446,7 +1446,7 @@ wxFontEncoding GuessUnicodeCharset(const wchar_t *pwz)
          //     awfully wasteful but currently it's possible for wxCSConv::
          //     WC2MB() to return successfully when it's used for just testing
          //     and not real conversion under Win32
-         if ( !wxString(pwz, wxCSConv(enc)).empty() )
+         if ( wxCSConv(enc).FromWChar(NULL, 0, pwz) > 0 )
             break;
       }
    }

commit 9b487ce19ebff28117f29bb4992e6157adb191ac
Author: Vadim Zeitlin <[email protected]>
Date:   Mon Jul 31 00:43:46 2023 +0200

    Avoid warning about __STRICT_ANSI__ redefinition
    
    It's probably unnecessary to still define it ourselves at all, but for
    now just avoid the warning as it's simpler than to update this old code.

diff --git a/src/modules/spam/HeadersFilter.cpp b/src/modules/spam/HeadersFilter.cpp
index a68f3bac..28ec4579 100644
--- a/src/modules/spam/HeadersFilter.cpp
+++ b/src/modules/spam/HeadersFilter.cpp
@@ -963,7 +963,9 @@ static bool CheckWhiteList(const Message& msg, String *match)
 #ifdef USE_RBL
 
 
+#ifndef __STRICT_ANSI__
 #define __STRICT_ANSI__
+#endif
 #include <netinet/in.h>
 
 // FreeBSD uses a variable name "class"

commit f4df09d95ce0cbc8a87a99dcd4e0d709a0831318
Author: Vadim Zeitlin <[email protected]>
Date:   Sun Jul 23 01:11:57 2023 +0200

    Stop copying URLs to primary selection under Unix
    
    This is worse than useless as it actually prevents them from being
    copied to the clipboard and so they can't be pasted anywhere.

diff --git a/src/gui/ClickURL.cpp b/src/gui/ClickURL.cpp
index 93c470d1..f6504756 100644
--- a/src/gui/ClickURL.cpp
+++ b/src/gui/ClickURL.cpp
@@ -264,13 +264,6 @@ UrlPopup::OnCommandEvent(wxCommandEvent &event)
                const wxString url = m_clickableURL->GetUrl();
 
                wxTheClipboard->SetData(new wxURLDataObject(url));
-
-#ifdef __UNIX__
-               // Different browsers (Firefox and Chromium) use different
-               // selections for pasting URLs, so just copy it to both.
-               wxTheClipboard->UsePrimarySelection(true);
-               wxTheClipboard->SetData(new wxURLDataObject(url));
-#endif // __UNIX__
             }
          }
          break;

commit eaf382ea13e9c7cc1d2c0647e4f48496617c293a
Author: Vadim Zeitlin <[email protected]>
Date:   Sun Jul 23 01:11:23 2023 +0200

    Fix formatting specifier in address autocollect code
    
    Avoid assert when formatting size_t.

diff --git a/src/adb/Collect.cpp b/src/adb/Collect.cpp
index df324ad7..21feabb8 100644
--- a/src/adb/Collect.cpp
+++ b/src/adb/Collect.cpp
@@ -436,7 +436,7 @@ int InteractivelyCollectAddresses(const wxArrayString& addresses,
             }
          }
 
-         wxLogStatus(parent, _("Saved %u addresses."), saved);
+         wxLogStatus(parent, _("Saved %zu addresses."), saved);
        }
        //else: cancelled
     }

-----------------------------------------------------------------------

Summary of changes:
 configure.ac                       |   2 +-
 extra/install/M.svg                |  96 +++++++++
 extra/install/mahogany.desktop     |   7 +
 src/adb/Collect.cpp                |   2 +-
 src/gui/ClickURL.cpp               |   7 -
 src/modules/spam/HeadersFilter.cpp |   2 +
 src/util/ssl.cpp                   | 419 -------------------------------------
 src/util/strutil.cpp               |   2 +-
 8 files changed, 108 insertions(+), 429 deletions(-)
 create mode 100644 extra/install/M.svg
 create mode 100644 extra/install/mahogany.desktop


hooks/post-receive
-- 
Mahogany sources repository.