Re: pgcrypto compilation error due to stack-allocated EVP_CIPHER_CTX

From: Asif Naeem <anaeem(dot)it(at)gmail(dot)com>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, Andreas Karlsson <andreas(at)proxel(dot)se>, Andres Freund <andres(at)anarazel(dot)de>, PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pgcrypto compilation error due to stack-allocated EVP_CIPHER_CTX
Date: 2016-12-06 14:42:21
Message-ID: CAEB4t-PyyhhQAB+P6tPRWmj6Vg2m5k3XrLSMf8Kh2af0Qr4Xag@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Thanks for updated patch. Although EVP_CIPHER_CTX_cleanup() seems deprecated in
OpenSSL >= 1.1.0 i.e.

# if OPENSSL_API_COMPAT < 0x10100000L
> # define EVP_CIPHER_CTX_init(c) EVP_CIPHER_CTX_reset(c)
> # define EVP_CIPHER_CTX_cleanup(c) EVP_CIPHER_CTX_reset(c)
> # endif

I guess use of deprecated function is fine, until OpenSSL library support
it.

On Tue, Dec 6, 2016 at 6:15 PM, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
wrote:

> On Tue, Dec 6, 2016 at 9:31 PM, Asif Naeem <anaeem(dot)it(at)gmail(dot)com> wrote:
> > Thank you for v2 patch, I would like to comment on it. It seems that you
> > have used function EVP_CIPHER_CTX_reset in the patch that was introduced
> in
> > OpenSSL 1.1.0, older library version might not work now, is it
> intentional
> > change ?.
>
> I thought I tested that... But yes, that would not compile when linked
> with 1.0.2 or older. Using EVP_CIPHER_CTX_cleanup() is safe instead as
> that's available down to 0.9.8.
> --
> Michael
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2016-12-06 14:46:46 Re: [COMMITTERS] pgsql: Account for catalog snapshot in PGXACT->xmin updates.
Previous Message Kohei KaiGai 2016-12-06 14:30:19 Re: raw output from copy