From 1fb230941afc4a5c13e10e6a2dd8ded803c12394 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20R=C4=99korajski?= Date: Sat, 2 Oct 2021 22:28:55 +0200 Subject: [PATCH] - add openssl 3.0.0 support, rel 2 --- dovecot.spec | 4 +++- openssl3.patch | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 openssl3.patch diff --git a/dovecot.spec b/dovecot.spec index 7db7110..86e0ed6 100644 --- a/dovecot.spec +++ b/dovecot.spec @@ -13,7 +13,7 @@ Summary: IMAP and POP3 server written with security primarily in mind Summary(pl.UTF-8): Serwer IMAP i POP3 pisany głównie z myślą o bezpieczeństwie Name: dovecot Version: 2.3.16 -Release: 1 +Release: 2 Epoch: 1 License: MIT (libraries), LGPL v2.1 (the rest) Group: Networking/Daemons @@ -27,6 +27,7 @@ Patch0: %{name}-config.patch Patch1: %{name}-rpath.patch Patch2: %{name}-shebang.patch Patch3: fts.patch +Patch4: openssl3.patch URL: http://dovecot.org/ BuildRequires: autoconf BuildRequires: automake @@ -168,6 +169,7 @@ Pakiet programistyczny do tworzenia wtyczek dla Dovecota. %patch1 -p1 %patch2 -p1 %patch3 -p1 +%patch4 -p1 %{__sed} -i 's,/usr/lib/dovecot,%{_libdir}/dovecot,g' doc/example-config/*.conf doc/example-config/conf.d/*.conf diff --git a/openssl3.patch b/openssl3.patch new file mode 100644 index 0000000..fa6c44f --- /dev/null +++ b/openssl3.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) -- 2.44.0