From: Viktor Dukhovni Date: Fri, 29 Jan 2016 08:31:53 +0000 (-0500) Subject: Bitrot: EVP_PKEY structure opaque in OpenSSL 1.1.0 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2e1942df003b5895e521eeb5fc7747de18953fb4;p=thirdparty%2Fpostfix.git Bitrot: EVP_PKEY structure opaque in OpenSSL 1.1.0 EVP_PKEY finally joins X509 in OpenSSL 1.1.0-dev API cleanup march --- diff --git a/postfix/src/tls/tls.h b/postfix/src/tls/tls.h index 853367623..2475349c7 100644 --- a/postfix/src/tls/tls.h +++ b/postfix/src/tls/tls.h @@ -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 */ diff --git a/postfix/src/tls/tls_dane.c b/postfix/src/tls/tls_dane.c index bb882f206..8275ee127 100644 --- a/postfix/src/tls/tls_dane.c +++ b/postfix/src/tls/tls_dane.c @@ -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;