pgcrypto: remove useless px_memset() and BF_ASM

From: Dagfinn Ilmari Mannsåker <ilmari(at)ilmari(dot)org>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: pgcrypto: remove useless px_memset() and BF_ASM
Date: 2026-04-09 10:51:05
Message-ID: 87ldew2yqu.fsf@wibble.ilmari.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Hackers,

In the thread about centralised architecture detection, I noticed that
the BF_ASM macro in crypt-blowfish.c has never been defined to anything
but 0, and the _BF_body_r() function it would call has never existed, so
that can be got rid of.

While investigating at that, I also noticed that px_memset(), which has
the comment /* memset that must not be optimized away */, is only ever
called with zero for the value, which could be better written with
explicit_bzero() now that we have that.

Attached are patches for both.

- ilmari

Attachment Content-Type Size
0001-pgcrypto-remove-unused-BF_ASM-macro.patch text/x-diff 1.3 KB
0002-pgcrypto-use-explicit_bzero-instead-of-px_memset-.-0.patch text/x-diff 15.3 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2026-04-09 10:59:39 Re: Add errdetail() with PID and UID about source of termination signal
Previous Message Shruthi Gowda 2026-04-09 10:44:13 Re: [BUG] CRASH: ECPGprepared_statement() and ECPGdeallocate_all() when connection is NULL