Re: Fetch channel binding digest explicitly with OpenSSL 3.0 and later - Mailing list pgsql-hackers

From Mark Atwood
Subject Re: Fetch channel binding digest explicitly with OpenSSL 3.0 and later
Date
Msg-id 178648041193.650853.7107077647538167857@reviewcommit.com
Whole thread
Responses RE: [PATCH] Preserve replication origin OIDs in pg_upgrade
List pgsql-hackers
Correction: my rationale for this patch was wrong.

Implicit digests DO reach providers.  evp_md_init_internal() re-fetches an MD
with type->prov == NULL by name, so EVP_sha256() and EVP_get_digestbynid()
end up provider-backed.  The probe I cited measured ctx->reqdigest, the MD
passed in, not the one used.  Details and a corrected probe are on the
cryptohash thread [1].

So this patch is not a bypass fix.  What survives: the internal fetch
hardcodes libctx=NULL and propq="", so a non-default OSSL_LIB_CTX gets no
provider control, and a registered ENGINE bypasses providers outright.
Control and clarity, not bypass.

Michael, you named channel binding as your interest, so you should have that
before spending time on it.  The patch behavior is unchanged, and the question
about freeing the EVP_MD on every error path still stands.

Repost on the narrower basis, or withdraw?

[1] https://postgr.es/m/178596055358.1584287.8485463954311014881%40reviewcommit.com

--
Mark



pgsql-hackers by date:

Previous
From: Mark Atwood
Date:
Subject: Re: Fetch digests explicitly for cryptohash with OpenSSL 3.0 and later
Next
From: Chao Li
Date:
Subject: Re: Fix detection of truncated zstd-compressed backups