From bd41626afb614a9e3e4e8d85761af0fd77652ae205cc949452a9b947da0e0a3c Mon Sep 17 00:00:00 2001 From: Dirk Stoecker Date: Tue, 7 Feb 2023 10:24:58 +0000 Subject: [PATCH] Accepting request 1063508 from home:adkorte:branches:server:mail - Add patch to fix building with OpenSSL-3 (boo#1207958) + fix-build-with-openssl-3.patch OBS-URL: https://build.opensuse.org/request/show/1063508 OBS-URL: https://build.opensuse.org/package/show/server:mail/dovecot23?expand=0&rev=112 --- dovecot23.changes | 6 ++++++ dovecot23.spec | 6 +++++- fix-build-with-openssl-3.patch | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 fix-build-with-openssl-3.patch diff --git a/dovecot23.changes b/dovecot23.changes index 5ee1a2b..02a20ea 100644 --- a/dovecot23.changes +++ b/dovecot23.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Sun Feb 5 16:07:02 UTC 2023 - Arjen de Korte + +- Add patch to fix building with OpenSSL-3 (boo#1207958) + + fix-build-with-openssl-3.patch + ------------------------------------------------------------------- Thu Dec 22 20:47:52 UTC 2022 - Michael Ströder diff --git a/dovecot23.spec b/dovecot23.spec index 6b8c46f..17d8fa8 100644 --- a/dovecot23.spec +++ b/dovecot23.spec @@ -1,7 +1,7 @@ # # spec file for package dovecot23 # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -158,8 +158,12 @@ Source9: dovecot-2.3-pigeonhole.configfiles Source10: https://www.dovecot.org/releases/%{dovecot_branch}/%{pkg_name}-%{dovecot_version}.tar.gz.sig Source11: https://pigeonhole.dovecot.org/releases/%{dovecot_branch}/%{dovecot_pigeonhole_source_dir}.tar.gz.sig Source12: dovecot23.keyring +# PATCH-FIX-OPENSUSE - boo#932386 Patch: dovecot-2.3.0-dont_use_etc_ssl_certs.patch +# PATCH-FIX-SLE - boo#854512 Patch1: dovecot-2.3.0-better_ssl_defaults.patch +# PATCH-FIX-OPENSUSE - boo#1207958 +Patch2: fix-build-with-openssl-3.patch Summary: IMAP and POP3 Server Written Primarily with Security in Mind License: BSD-3-Clause AND LGPL-2.1-or-later AND MIT Group: Productivity/Networking/Email/Servers diff --git a/fix-build-with-openssl-3.patch b/fix-build-with-openssl-3.patch new file mode 100644 index 0000000..ef7a785 --- /dev/null +++ b/fix-build-with-openssl-3.patch @@ -0,0 +1,34 @@ +diff -up dovecot-2.3.14/src/lib-dcrypt/dcrypt-openssl.c.opensslv3 dovecot-2.3.14/src/lib-dcrypt/dcrypt-openssl.c +--- dovecot-2.3.14/src/lib-dcrypt/dcrypt-openssl.c.opensslv3 2021-06-03 18:56:52.573174433 +0200 ++++ dovecot-2.3.14/src/lib-dcrypt/dcrypt-openssl.c 2021-06-03 18:56:52.585174274 +0200 +@@ -73,10 +73,30 @@ + 2key algo oid1symmetric algo namesalthash algoroundsE(RSA = i2d_PrivateKey, EC=Private Point)key id + **/ + ++#if OPENSSL_VERSION_MAJOR == 3 ++static EC_KEY *EVP_PKEY_get0_EC_KEYv3(EVP_PKEY *key) ++{ ++ EC_KEY *eck = EVP_PKEY_get1_EC_KEY(key); ++ EVP_PKEY_set1_EC_KEY(key, eck); ++ EC_KEY_free(eck); ++ return eck; ++} ++ ++static EC_KEY *EVP_PKEY_get1_EC_KEYv3(EVP_PKEY *key) ++{ ++ EC_KEY *eck = EVP_PKEY_get1_EC_KEY(key); ++ EVP_PKEY_set1_EC_KEY(key, eck); ++ return eck; ++} ++ ++#define EVP_PKEY_get0_EC_KEY EVP_PKEY_get0_EC_KEYv3 ++#define EVP_PKEY_get1_EC_KEY EVP_PKEY_get1_EC_KEYv3 ++#else + #ifndef HAVE_EVP_PKEY_get0 + #define EVP_PKEY_get0_EC_KEY(x) x->pkey.ec + #define EVP_PKEY_get0_RSA(x) x->pkey.rsa + #endif ++#endif + + #ifndef HAVE_OBJ_LENGTH + #define OBJ_length(o) ((o)->length)