archrelease: copy trunk to community-any
[ArchLinux/community.git] / dovecot / trunk / dovecot-2.3.14-opensslv3.patch
blobfa6c44f67204d02ca8961284af0d12063a2af7e0
1 diff -up dovecot-2.3.14/src/lib-dcrypt/dcrypt-openssl.c.opensslv3 dovecot-2.3.14/src/lib-dcrypt/dcrypt-openssl.c
2 --- dovecot-2.3.14/src/lib-dcrypt/dcrypt-openssl.c.opensslv3 2021-06-03 18:56:52.573174433 +0200
3 +++ dovecot-2.3.14/src/lib-dcrypt/dcrypt-openssl.c 2021-06-03 18:56:52.585174274 +0200
4 @@ -73,10 +73,30 @@
5 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
6 **/
8 +#if OPENSSL_VERSION_MAJOR == 3
9 +static EC_KEY *EVP_PKEY_get0_EC_KEYv3(EVP_PKEY *key)
11 + EC_KEY *eck = EVP_PKEY_get1_EC_KEY(key);
12 + EVP_PKEY_set1_EC_KEY(key, eck);
13 + EC_KEY_free(eck);
14 + return eck;
17 +static EC_KEY *EVP_PKEY_get1_EC_KEYv3(EVP_PKEY *key)
19 + EC_KEY *eck = EVP_PKEY_get1_EC_KEY(key);
20 + EVP_PKEY_set1_EC_KEY(key, eck);
21 + return eck;
24 +#define EVP_PKEY_get0_EC_KEY EVP_PKEY_get0_EC_KEYv3
25 +#define EVP_PKEY_get1_EC_KEY EVP_PKEY_get1_EC_KEYv3
26 +#else
27 #ifndef HAVE_EVP_PKEY_get0
28 #define EVP_PKEY_get0_EC_KEY(x) x->pkey.ec
29 #define EVP_PKEY_get0_RSA(x) x->pkey.rsa
30 #endif
31 +#endif
33 #ifndef HAVE_OBJ_LENGTH
34 #define OBJ_length(o) ((o)->length)