]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-ssl-iostream: Do not unref DH parameters too soon
authorAki Tuomi <aki.tuomi@open-xchange.com>
Fri, 4 Nov 2022 10:27:11 +0000 (12:27 +0200)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Tue, 8 Nov 2022 07:12:21 +0000 (07:12 +0000)
SSL_CTX_set0_tmp_dh_pkey moves references to SSL_CTX which
frees the DH parameters itself.

Broken by 124c491aa688eec146c21718f0d98aec9ae03294

src/lib-ssl-iostream/iostream-openssl-context.c

index 80c3af812e263bf8c19f48cf312ac9b538fd0992..4086774032c045d0a83a37e4ee2ec7a3c854bfe3 100644 (file)
@@ -202,7 +202,9 @@ ssl_iostream_ctx_use_dh(struct ssl_iostream_context *ctx,
                        openssl_iostream_key_load_error());
                ret = -1;
        }
+#ifndef HAVE_SSL_CTX_set0_tmp_dh_pkey
        EVP_PKEY_free(pkey_dh);
+#endif
        return ret;
 }