Re: cryptohash: missing locking functions for OpenSSL <= 1.0.2?

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Jacob Champion <pchampion(at)vmware(dot)com>
Cc: "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: cryptohash: missing locking functions for OpenSSL <= 1.0.2?
Date: 2021-03-10 08:21:53
Message-ID: YEiBoX2oH7TUINRL@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Mar 08, 2021 at 06:06:32PM +0000, Jacob Champion wrote:
> I had to convince myself that this logic is correct -- we set
> destroy_needed even if crypto is not enabled, but then check later to
> make sure that crypto_loaded is true before doing anything. What would
> you think about moving the conn->crypto_loaded check to the else
> branch, so that destroy_needed is only set if we actually need it?

Do you mean something like the attached? If I recall my mood from the
moment, I think that I did that to be more careful with the case where
the client has its own set of callbacks set (pq_init_crypto_lib as
false) but that does not matter as this is double-checked in
destroy_ssl_system(). I have adjusted some comments after more
review.
--
Michael

Attachment Content-Type Size
cryptohash-libpq-v3.patch text/x-diff 8.4 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Gustafsson 2021-03-10 08:23:15 Re: OpenSSL 3.0.0 compatibility
Previous Message yuzuko 2021-03-10 08:19:13 Re: Release SPI plans for referential integrity with DISCARD ALL