]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
Bitrot: EVP_PKEY structure opaque in OpenSSL 1.1.0
authorViktor Dukhovni <postfix-users@dukhovni.org>
Fri, 29 Jan 2016 08:31:53 +0000 (03:31 -0500)
committerViktor Dukhovni <postfix-users@dukhovni.org>
Sun, 14 Oct 2018 15:50:09 +0000 (11:50 -0400)
EVP_PKEY finally joins X509 in OpenSSL 1.1.0-dev API cleanup march

postfix/src/tls/tls.h
postfix/src/tls/tls_dane.c

index 853367623a2471610a1da0536bc5e7de6a7b7272..2475349c79a6f618680706d69311fb0707f2d381 100644 (file)
@@ -87,8 +87,11 @@ extern const NAME_CODE tls_level_table[];
 
  /* Backwards compatibility with OpenSSL < 1.1.0 */
 #if OPENSSL_VERSION_NUMBER < 0x10100000L
-#define X509_up_ref(x) CRYPTO_add(&((x)->references), 1, CRYPTO_LOCK_X509)
 #define OpenSSL_version_num SSLeay
+#define X509_up_ref(x) \
+       CRYPTO_add(&((x)->references), 1, CRYPTO_LOCK_X509)
+#define EVP_PKEY_up_ref(k) \
+       CRYPTO_add(&((k)->references), 1, CRYPTO_LOCK_EVP_PKEY)
 #endif
 
 /* SSL_CIPHER_get_name() got constified in 0.9.7g */
index bb882f2062c1422d3d6c3b432b4ce395a1d56825..8275ee127b47da12d1607fa9d1dcd16ed7ba6cb3 100644 (file)
@@ -573,7 +573,7 @@ static void ta_pkey_insert(TLS_DANE *d, EVP_PKEY *k)
 {
     TLS_PKEYS *new = (TLS_PKEYS *) mymalloc(sizeof(*new));
 
-    CRYPTO_add(&k->references, 1, CRYPTO_LOCK_EVP_PKEY);
+    EVP_PKEY_up_ref(k);
     new->pkey = k;
     new->next = d->pkeys;
     d->pkeys = new;