RE: Replace current implementations in crypt() and gen_salt() to OpenSSL - Mailing list pgsql-hackers

From Hayato Kuroda (Fujitsu)
Subject RE: Replace current implementations in crypt() and gen_salt() to OpenSSL
Date
Msg-id OSCPR01MB1496696A554B74DA8254BBF0CF5182@OSCPR01MB14966.jpnprd01.prod.outlook.com
Whole thread Raw
In response to Replace current implementations in crypt() and gen_salt() to OpenSSL  ("Koshi Shibagaki (Fujitsu)" <shibagaki.koshi@fujitsu.com>)
List pgsql-hackers
Dear Daniel,

Thanks for working on the project. I have few cosmetic comments.

```
+      built in legacy crypto functions <literal>gen_salt()</literal>,
```

According to other lines, `<literal>gen_salt()</literal>` should be `<function>gen_salt()</function>`.

```
+      <literal>pg_gen_salt_rounds()</literal>, and <literal>crypt()</literal>
```

Similar with [1], `pg_gen_salt_rounds` is not an SQL function.
I think we do not have to mention the function because it's just another implementation of gen_salt().
Also, use <function> instead of <literal>.

```
+void
+_PG_init(void)
+{
+    DefineCustomEnumVariable("pgcrypto.legacy_crypto_enabled",
+                             "Sets if builtin crypto functions are enabled.",
+                             "\"on\" enables builtin crypto, \"off\" unconditionally disables and \"fips\" "
+                             "will disable builtin crypto if OpenSSL is in FIPS mode",
+                             &legacy_crypto_enabled,
+                             LGC_ON,
+                             legacy_crypto_options,
+                             PGC_SUSET,
+                             0,
+                             NULL,
+                             NULL,
+                             NULL);
+}
```

I think we must call MarkGUCPrefixReserved() to catch the mis-spell.

Also: I'm not sure whether we should bump the version of pgcrypto. It should be done when
the API is changed, but the patch does not do. Thought?

[1]: https://www.postgresql.org/message-id/1f32ff67-255d-4c0c-8433-c8c721842aa3%40eisentraut.org

Best regards,
Hayato Kuroda
FUJITSU LIMITED




pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: [WIP]Vertical Clustered Index (columnar store extension) - take2
Next
From: Bertrand Drouvot
Date:
Subject: Re: Reorder shutdown sequence, to flush pgstats later