Refactor MD5 implementations and switch to EVP for OpenSSL

2020-11-05 Thread Michael Paquier
Hi all, Please find attached a patch set to sanitize the use of MD5 we have in the core tree. As of now, there are two duplicated implementations of MD5, one in contrib/pgcrypto/ used as a fallback when not compiling with OpenSSL, and one in src/common/ used by the backend when compiling with *or

Re: Refactor MD5 implementations and switch to EVP for OpenSSL

2020-11-09 Thread Michael Paquier
On Fri, Nov 06, 2020 at 04:34:34PM +0900, Michael Paquier wrote: > The attached patch set does a bit of rework to make the Postgres code > more consistent with OpenSSL, similarly to the work I did for all the > SHA2 implementations with EVP in [1]: > - 0001 is something stolen from the SHA2 set, ad

Re: Refactor MD5 implementations and switch to EVP for OpenSSL

2020-12-03 Thread Michael Paquier
On Tue, Nov 10, 2020 at 01:28:09PM +0900, Michael Paquier wrote: > The CF bot has been complaining on Windows and this issue is fixed in > the attached. A refresh of src/tools/msvc for pgcrypto was just > missing. Now that HEAD has the necessary infrastructure to be able to plug in easily new cry

Re: Refactor MD5 implementations and switch to EVP for OpenSSL

2020-12-07 Thread Daniel Gustafsson
> On 4 Dec 2020, at 08:05, Michael Paquier wrote: > > On Tue, Nov 10, 2020 at 01:28:09PM +0900, Michael Paquier wrote: >> The CF bot has been complaining on Windows and this issue is fixed in >> the attached. A refresh of src/tools/msvc for pgcrypto was just >> missing. > > Now that HEAD has th

Re: Refactor MD5 implementations and switch to EVP for OpenSSL

2020-12-08 Thread Michael Paquier
On Mon, Dec 07, 2020 at 02:15:58PM +0100, Daniel Gustafsson wrote: > This is a pretty straightforward patch which given the cryptohash framework > added previously does what it says on the tin. +1 on rolling MD5 into what we > already have for SHA2 now. Applies clean and all tests pass. Thanks.

Re: Refactor MD5 implementations and switch to EVP for OpenSSL

2020-12-09 Thread Daniel Gustafsson
> On 9 Dec 2020, at 06:47, Michael Paquier wrote: > In short, this seems rather committable to me. Agreed, this version of the patch looks good to me. I've looked over the attributions for the code movement and it seems to match now, and all tests pass etc. +1 on going ahead with this version.

Re: Refactor MD5 implementations and switch to EVP for OpenSSL

2020-12-09 Thread Michael Paquier
On Wed, Dec 09, 2020 at 01:52:32PM +0100, Daniel Gustafsson wrote: > The tiniest level of nitpicking would be that md5.h doesn't have the > /* PG_MD5_H */ comment on the #endif line (and it's even tinier since it's > not even the fault of this patch - I just happened to notice when looking > at th