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=85294eba2f4830af32faed69084f00c7e78e17ae;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 af3d1777f..a335fc8ad 100644 --- a/postfix/src/tls/tls.h +++ b/postfix/src/tls/tls.h @@ -85,8 +85,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 fa254bc47..879fd0963 100644 --- a/postfix/src/tls/tls_dane.c +++ b/postfix/src/tls/tls_dane.c @@ -569,7 +569,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;