Re: Refactoring HMAC in the core code

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Bruce Momjian <bruce@momjian.us>
Cc: Postgres hackers <pgsql-hackers@lists.postgresql.org>, Daniel Gustafsson <daniel@yesql.se>
Date: 2021-01-08T07:11:53Z
Lists: pgsql-hackers

Attachments

On Fri, Dec 18, 2020 at 03:46:42PM +0900, Michael Paquier wrote:
> This has been tested on Windows and Linux across all the versions of
> OpenSSL we support on HEAD.  I am also attaching a small module called
> hmacfuncs that I used as a way to validate this patch across all the
> versions of OpenSSL and the fallback implementation.  As a reference,
> this matches with the results from Wikipedia here:
> https://en.wikipedia.org/wiki/HMAC#Examples

Please find attached a rebased version.  I have simplified the
implementation to use an opaque pointer similar to the cryptohash
part, leading to a large cleanup of the allocation logic for both
implementations, with and without OpenSSL.
--
Michael

Commits

  1. Refactor HMAC implementations