Обсуждение: Renaming more clearly SHA functions in pgcrypto/

Поиск
Список
Период
Сортировка

Renaming more clearly SHA functions in pgcrypto/

От
Michael Paquier
Дата:
Hi all,
(folks interested in that in CC)

While looking at some facility in pgcrypto, I have noticed the stanza
created by 56f4478 to prevent conflicts with OpenSSL, like that:
+#define SHA256_Init pg_SHA256_Init
+#define SHA256_Update pg_SHA256_Update

Wouldn't it be better to avoid that, and just rename all those
functions as pg_shaXX_foo? It seems to me that this would be more
in-line with what's already in core. This renaming would be part of
the refactoring effort for SCRAM to have all the functions for SHA1,
SHA156, etc in a unique file sha.c in src/common with a reworked
interface, particularly for SHA1 where things are quite inconsistent
with SHA2XX.

Opinions? As that's a matter really rather independent on SCRAM, I
prefer creating a new thread to gather opinions..

Thanks,
-- 
Michael



Re: Renaming more clearly SHA functions in pgcrypto/

От
Alvaro Herrera
Дата:
Michael Paquier wrote:
> Hi all,
> (folks interested in that in CC)
> 
> While looking at some facility in pgcrypto, I have noticed the stanza
> created by 56f4478 to prevent conflicts with OpenSSL, like that:
> +#define SHA256_Init pg_SHA256_Init
> +#define SHA256_Update pg_SHA256_Update
> 
> Wouldn't it be better to avoid that, and just rename all those
> functions as pg_shaXX_foo?

Sure.

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



Re: Renaming more clearly SHA functions in pgcrypto/

От
Michael Paquier
Дата:
On Tue, Jul 5, 2016 at 2:09 AM, Alvaro Herrera <alvherre@2ndquadrant.com> wrote:
> Michael Paquier wrote:
>> Hi all,
>> (folks interested in that in CC)
>>
>> While looking at some facility in pgcrypto, I have noticed the stanza
>> created by 56f4478 to prevent conflicts with OpenSSL, like that:
>> +#define SHA256_Init pg_SHA256_Init
>> +#define SHA256_Update pg_SHA256_Update
>>
>> Wouldn't it be better to avoid that, and just rename all those
>> functions as pg_shaXX_foo?
>
> Sure.

OK, so I guess I'll get something into a shape like that.
-- 
Michael