summary refs log tree commit diff
path: root/gnu/packages/patches/dovecot-opensslv3.patch
diff options
context:
space:
mode:
author宋文武 <iyzsong@member.fsf.org>2023-04-28 09:33:03 +0800
committer宋文武 <iyzsong@member.fsf.org>2023-04-28 09:33:03 +0800
commitaecc6e70587f8412cbbb9b2c13141de4f534518e (patch)
tree8536a8e85076048335543626246125c6d607be43 /gnu/packages/patches/dovecot-opensslv3.patch
parente42117bfc9afd7650f14efd2b2def68fcbfd4e36 (diff)
downloadguix-aecc6e70587f8412cbbb9b2c13141de4f534518e.tar.gz
gnu: dovecot: Fix build.
* gnu/packages/mail.scm (dovecot)[source]: Add patch for OpenSSL v3.
* gnu/packages/patches/dovecot-opensslv3.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
Diffstat (limited to 'gnu/packages/patches/dovecot-opensslv3.patch')
-rw-r--r--gnu/packages/patches/dovecot-opensslv3.patch34
1 files changed, 34 insertions, 0 deletions
diff --git a/gnu/packages/patches/dovecot-opensslv3.patch b/gnu/packages/patches/dovecot-opensslv3.patch
new file mode 100644
index 0000000000..fa6c44f672
--- /dev/null
+++ b/gnu/packages/patches/dovecot-opensslv3.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 @@
+   2<tab>key algo oid<tab>1<tab>symmetric algo name<tab>salt<tab>hash algo<tab>rounds<tab>E(RSA = i2d_PrivateKey, EC=Private Point)<tab>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)