[M-git] Mahogany sources repository. branch master updated. v0.67-816-g228268b3

Nerijus BaliÅ«nas via Mahogany-cvsupdates <[email protected]> Mon, 09 May 2022 20:44:10 +0000
Newsgroups gmane.mail.mahogany.cvs
Message-ID <[email protected]>
--===============7818143973352776383==
Content-Type: text/plain

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  228268b3143c16365fc0f76f15d4b86c8e640e1d (commit)
      from  791b9f972459b7ed17255cd4cd64fd675b594d8c (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 228268b3143c16365fc0f76f15d4b86c8e640e1d
Author: Nerijus Baliūnas <[email protected]>
Date:   Mon May 9 23:42:47 2022 +0300

    Fix compilation with OpenSSL 3.0

diff --git a/src/util/ssl.cpp b/src/util/ssl.cpp
index 4483f4ef..450d3390 100644
--- a/src/util/ssl.cpp
+++ b/src/util/ssl.cpp
@@ -115,6 +115,13 @@ extern const MOption MP_SSL_DLL_SSL;
 #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" */
@@ -200,9 +207,9 @@ SSL_DEF( int, SSL_CTX_use_certificate_chain_file, (SSL_CTX *ctx, const char *fil
 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, (X509_STORE_CTX *ctx), (ctx) );
+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, (X509_STORE_CTX *ctx), (ctx) );
+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) );
@@ -346,7 +353,12 @@ bool InitSSL(void) /* FIXME: MT */
    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);

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

Summary of changes:
 src/util/ssl.cpp | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
Mahogany sources repository.


--===============7818143973352776383==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


--===============7818143973352776383==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Mahogany-cvsupdates mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

--===============7818143973352776383==--