<div dir="ltr">Hi<div><br></div><div>I kept that piece of code for comparing the startup timing. we can safely remove it.</div><div>Sorry for the noice.</div><div><br></div><div>Thanks</div><div>Best regards</div><div>Muhammad Usama</div><div><br></div><div><br><div class="gmail_quote"><div dir="ltr">On Fri, Aug 17, 2018 at 11:49 AM Tatsuo Ishii &lt;<a href="mailto:ishii@sraoss.co.jp">ishii@sraoss.co.jp</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Usama,<br>
<br>
To run pgindent (the code causes error on pgindent), I ifdef out it for now.<br>
<br>
Best regards,<br>
--<br>
Tatsuo Ishii<br>
SRA OSS, Inc. Japan<br>
English: <a href="http://www.sraoss.co.jp/index_en.php" rel="noreferrer" target="_blank">http://www.sraoss.co.jp/index_en.php</a><br>
Japanese:<a href="http://www.sraoss.co.jp" rel="noreferrer" target="_blank">http://www.sraoss.co.jp</a><br>
<br>
From: Tatsuo Ishii &lt;<a href="mailto:ishii@sraoss.co.jp" target="_blank">ishii@sraoss.co.jp</a>&gt;<br>
Subject: [pgpool-committers: 5052] Re: pgpool: Feature: Add SCRAM and Certificate authentication support<br>
Date: Fri, 17 Aug 2018 09:38:08 +0900 (JST)<br>
Message-ID: &lt;<a href="mailto:20180817.093808.2104436097708702867.t-ishii@sraoss.co.jp" target="_blank">20180817.093808.2104436097708702867.t-ishii@sraoss.co.jp</a>&gt;<br>
<br>
&gt; Usama,<br>
&gt; <br>
&gt; In this commit I see below in main/main.c:<br>
&gt; <br>
&gt; //#ifdef USE_SSL<br>
&gt; //    /* global ssl init */<br>
&gt; //#if (OPENSSL_VERSION_NUMBER &gt;= 0x10100000L &amp;&amp; !defined (LIBRESSL_VERSION_NUMBER))<br>
&gt; //    OPENSSL_init_ssl(0, NULL);<br>
&gt; //#else<br>
&gt; //    SSL_library_init();<br>
&gt; //#endif<br>
&gt; //    SSL_load_error_strings();<br>
&gt; //#endif /* USE_SSL */<br>
&gt; <br>
&gt; Can we remove the code safely or are you still working on this part?<br>
&gt; <br>
&gt; Best regards,<br>
&gt; --<br>
&gt; Tatsuo Ishii<br>
&gt; SRA OSS, Inc. Japan<br>
&gt; English: <a href="http://www.sraoss.co.jp/index_en.php" rel="noreferrer" target="_blank">http://www.sraoss.co.jp/index_en.php</a><br>
&gt; Japanese:<a href="http://www.sraoss.co.jp" rel="noreferrer" target="_blank">http://www.sraoss.co.jp</a><br>
&gt; <br>
&gt; From: Muhammad Usama &lt;<a href="mailto:m.usama@gmail.com" target="_blank">m.usama@gmail.com</a>&gt;<br>
&gt; Subject: [pgpool-committers: 5051] pgpool: Feature: Add SCRAM and Certificate authentication support<br>
&gt; Date: Thu, 16 Aug 2018 16:45:03 +0000<br>
&gt; Message-ID: &lt;<a href="mailto:E1fqLOR-0002Yf-AY@gothos.postgresql.org" target="_blank">E1fqLOR-0002Yf-AY@gothos.postgresql.org</a>&gt;<br>
&gt; <br>
&gt;&gt; Feature: Add SCRAM and Certificate authentication support<br>
&gt;&gt; <br>
&gt;&gt; New feature to add scram and cert authentication method support in Pgpool-II.<br>
&gt;&gt; Apart from supporting the new authentication methods the commit also includes<br>
&gt;&gt; the following enhancements and changes in the authentication framework<br>
&gt;&gt; of Pgpool-II<br>
&gt;&gt; <br>
&gt;&gt; Different auth methods for frontend and backend for user session<br>
&gt;&gt; ================================================================<br>
&gt;&gt; Now it possible to use different authentication method for client<br>
&gt;&gt; application and backend PostgreSQL servers.<br>
&gt;&gt; For example, a client application can use scram-sha-256 to connect to Pgpool-II<br>
&gt;&gt; which in turn can use trust or md5 authentication to connect to<br>
&gt;&gt; PostgreSQL backend for the same session.<br>
&gt;&gt; <br>
&gt;&gt; Use MD5 and SCRAM without pool_passwd<br>
&gt;&gt; =====================================<br>
&gt;&gt; New configuration parameter allow_clear_text_frontend_auth, enables the Pgpool-II<br>
&gt;&gt; to use clear-text-password authentication with frontend clients when pool_passwd<br>
&gt;&gt; file does not contains the password for the connecting user.<br>
&gt;&gt; For example: suppose PostgreSQL servers has a user named &quot;some_user&quot; which can<br>
&gt;&gt; connect to database using SCRAM authentication, Now for this &quot;some_user&quot; to<br>
&gt;&gt; connect to PostgreSQL using SCRAM through Pgpool-II we must have the some_user&#39;s<br>
&gt;&gt; password stored in the pool_passwd file, but if in some case when pool_passwd does<br>
&gt;&gt; not have the entry of &quot;some_user&quot; and allow_clear_text_frontend_auth is enabled<br>
&gt;&gt; in the pgpool.conf then Pgpool-II will ask the connecting frontend to use<br>
&gt;&gt; clear-text-password auth method for authentication, and after receiving the<br>
&gt;&gt; password from the client, Pgpool-II will use that password to authenticate with<br>
&gt;&gt; backend using the required SCRAM auth.<br>
&gt;&gt; <br>
&gt;&gt; Note: allow_clear_text_frontend_auth only works when pool_hba.conf is not enabled.<br>
&gt;&gt; <br>
&gt;&gt; Encrypted passwords in pool_passwd file<br>
&gt;&gt; =======================================<br>
&gt;&gt; Since the SCRAM authentication method explicitly guards against the<br>
&gt;&gt; man-in-middle type attacks, so to use such authentication methods Pgpool-II<br>
&gt;&gt; requires the PostgreSQL user password to authenticate with the backend.<br>
&gt;&gt; But as storing the clear text password in the &quot;pool_passwd&quot; file is never a good<br>
&gt;&gt; idea, so now you can store the AES256-CBC encrypted password in the &quot;pool_passwd&quot;.<br>
&gt;&gt; To store the AES encrypted password in the &quot;pool_passwd&quot; the password is first<br>
&gt;&gt; encrypted using the AES256 encryption with the user provided key and then the<br>
&gt;&gt; encrypted password is base64 encoded and AES prefix is added to<br>
&gt;&gt; the encoded string.<br>
&gt;&gt; <br>
&gt;&gt; New pg_enc utility to create encrypted passwords<br>
&gt;&gt; ================================================<br>
&gt;&gt; A new utility pg_enc is added to create AES encrypted passwords. The utility<br>
&gt;&gt; works similar in most ways as pg_md5 utility, with a some small differences,<br>
&gt;&gt; pg_enc also requires the key for encrypting the password entries. later that<br>
&gt;&gt; same key is required by Pgpool-II to decrypt the passwords to be used for<br>
&gt;&gt; authentication.<br>
&gt;&gt; <br>
&gt;&gt; Note: Pgpool-II must be build with ssl (--with-openssl) support to use<br>
&gt;&gt; this encrypted password feature.<br>
&gt;&gt; <br>
&gt;&gt; Providing encryption key to Pgpool-II<br>
&gt;&gt; =====================================<br>
&gt;&gt; If you have AES encrypted passwords stored in the pool_passwd file, then<br>
&gt;&gt; Pgpool-II will require the decryption key to decrypt the passwords before<br>
&gt;&gt; using them, Pgpool-II tries to read the decryption key at startup from<br>
&gt;&gt; the pgpoolkey file.<br>
&gt;&gt; By default the Pgpool-II will look for the pgpoolkey file in user&#39;s home<br>
&gt;&gt; directory or the file referenced by environment variable PGPOOLKEYFILE.<br>
&gt;&gt; You can also specify the key file using the (-k, --key-file=KEY_FILE)<br>
&gt;&gt; command line argument to the Pgpool-II binary.<br>
&gt;&gt; <br>
&gt;&gt; Encrypted Passwords in pgpool.conf<br>
&gt;&gt; ==================================<br>
&gt;&gt; The commit also allows to specify the AES encrypted password in the pgpool.conf<br>
&gt;&gt; file for healh_check_user, sr_check_user, wd_lifecheck_user and recovery_user<br>
&gt;&gt; users, Additionally if the password field for any of these users is left blank<br>
&gt;&gt; in pgpool conf then Pgpool-II will first try to get the password for that user<br>
&gt;&gt; from pool_passwd file before using the empty password for the connection.<br>
&gt;&gt; So now pgpool.conf can be made password free and single pool_passwd file can be<br>
&gt;&gt; used to store all passwords for internal and external user connection<br>
&gt;&gt; <br>
&gt;&gt; Documentation updates and regression test cases for the<br>
&gt;&gt; feature are also part of the commit.<br>
&gt;&gt; Thanks to jesperpedersen &lt;<a href="mailto:jesper.pedersen@redhat.com" target="_blank">jesper.pedersen@redhat.com</a>&gt; for helping<br>
&gt;&gt; in documentation and testing for the feature<br>
&gt;&gt; <br>
&gt;&gt; Branch<br>
&gt;&gt; ------<br>
&gt;&gt; master<br>
&gt;&gt; <br>
&gt;&gt; Details<br>
&gt;&gt; -------<br>
&gt;&gt; <a href="https://git.postgresql.org/gitweb?p=pgpool2.git;a=commitdiff;h=26446126f36dcd34ea9032ac934aafe63acc0eee" rel="noreferrer" target="_blank">https://git.postgresql.org/gitweb?p=pgpool2.git;a=commitdiff;h=26446126f36dcd34ea9032ac934aafe63acc0eee</a><br>
&gt;&gt; <br>
&gt;&gt; Modified Files<br>
&gt;&gt; --------------<br>
&gt;&gt; Makefile.in                                        |   43 +-<br>
&gt;&gt; aclocal.m4                                         |  203 +-<br>
&gt;&gt; configure                                          |  261 +--<br>
&gt;&gt; <a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a>                                       |    2 +-<br>
&gt;&gt; doc.ja/Makefile.in                                 |   24 +-<br>
&gt;&gt; doc.ja/src/Makefile.in                             |   24 +-<br>
&gt;&gt; doc.ja/src/sgml/Makefile.in                        |   24 +-<br>
&gt;&gt; doc/Makefile.in                                    |   24 +-<br>
&gt;&gt; doc/src/Makefile.in                                |   24 +-<br>
&gt;&gt; doc/src/sgml/Makefile.in                           |   24 +-<br>
&gt;&gt; doc/src/sgml/client-auth.sgml                      |  231 +-<br>
&gt;&gt; doc/src/sgml/connection-settings.sgml              |   32 +<br>
&gt;&gt; doc/src/sgml/healthcheck.sgml                      |   23 +<br>
&gt;&gt; doc/src/sgml/online-recovery.sgml                  |   24 +<br>
&gt;&gt; doc/src/sgml/ref/allfiles.sgml                     |    1 +<br>
&gt;&gt; doc/src/sgml/ref/pg_enc.sgml                       |  165 ++<br>
&gt;&gt; doc/src/sgml/reference.sgml                        |    1 +<br>
&gt;&gt; doc/src/sgml/stream-check.sgml                     |   23 +<br>
&gt;&gt; doc/src/sgml/watchdog.sgml                         |   27 +-<br>
&gt;&gt; src/Makefile.am                                    |    5 +<br>
&gt;&gt; src/Makefile.in                                    |   45 +-<br>
&gt;&gt; src/auth/auth-scram.c                              | 1653 ++++++++++++++<br>
&gt;&gt; src/auth/pool_auth.c                               | 1674 +++++++++++---<br>
&gt;&gt; src/auth/pool_hba.c                                |   87 +-<br>
&gt;&gt; src/auth/pool_passwd.c                             |  377 +++-<br>
&gt;&gt; src/config/pool_config_variables.c                 |    9 +<br>
&gt;&gt; src/include/Makefile.in                            |   29 +-<br>
&gt;&gt; src/include/auth/md5.h                             |    1 -<br>
&gt;&gt; src/include/auth/pool_hba.h                        |   10 +-<br>
&gt;&gt; src/include/auth/pool_passwd.h                     |   43 +-<br>
&gt;&gt; src/include/auth/scram-common.h                    |   93 +<br>
&gt;&gt; src/include/auth/scram.h                           |   65 +<br>
&gt;&gt; src/include/<a href="http://config.h.in" rel="noreferrer" target="_blank">config.h.in</a>                            |    3 +<br>
&gt;&gt; src/include/pool.h                                 |   21 +-<br>
&gt;&gt; src/include/pool_config.h                          |    8 +-<br>
&gt;&gt; src/include/pool_type.h                            |   13 +-<br>
&gt;&gt; src/include/utils/base64.h                         |   19 +<br>
&gt;&gt; src/include/utils/sha2.h                           |  116 +<br>
&gt;&gt; src/include/utils/ssl_utils.h                      |   34 +<br>
&gt;&gt; src/include/watchdog/wd_utils.h                    |    7 +-<br>
&gt;&gt; src/libs/Makefile.in                               |   24 +-<br>
&gt;&gt; src/libs/pcp/Makefile.in                           |   25 +-<br>
&gt;&gt; src/main/health_check.c                            |    8 +-<br>
&gt;&gt; src/main/main.c                                    |   86 +-<br>
&gt;&gt; src/main/pgpool_main.c                             |   16 +-<br>
&gt;&gt; src/parser/Makefile.in                             |   25 +-<br>
&gt;&gt; src/pcp_con/recovery.c                             |   27 +-<br>
&gt;&gt; src/protocol/child.c                               |  227 +-<br>
&gt;&gt; src/sample/pgpool.conf.sample                      |   20 +-<br>
&gt;&gt; src/sample/pgpool.conf.sample-logical              |   18 +-<br>
&gt;&gt; src/sample/pgpool.conf.sample-master-slave         |   17 +<br>
&gt;&gt; src/sample/pgpool.conf.sample-replication          |   17 +<br>
&gt;&gt; src/sample/pgpool.conf.sample-stream               |   16 +<br>
&gt;&gt; src/sample/pool_hba.conf.sample                    |    4 +-<br>
&gt;&gt; src/streaming_replication/pool_worker_child.c      |   10 +-<br>
&gt;&gt; src/test/pgpool_setup                              |   34 +-<br>
&gt;&gt; .../020.allow_clear_text_frontend_auth/test.sh     |  104 +<br>
&gt;&gt; .../tests/021.pool_passwd_auth/pool_hba.conf       |   71 +<br>
&gt;&gt; .../regression/tests/021.pool_passwd_auth/test.sh  |  111 +<br>
&gt;&gt; .../022.pool_passwd_alternative_auth/pool_hba.conf |   71 +<br>
&gt;&gt; .../tests/022.pool_passwd_alternative_auth/test.sh |  112 +<br>
&gt;&gt; src/tools/Makefile.am                              |    2 +-<br>
&gt;&gt; src/tools/Makefile.in                              |   27 +-<br>
&gt;&gt; src/tools/pcp/Makefile.in                          |   24 +-<br>
&gt;&gt; src/tools/pgenc/Makefile.am                        |   54 +<br>
&gt;&gt; src/tools/pgenc/Makefile.in                        |  687 ++++++<br>
&gt;&gt; src/tools/pgenc/pg_enc.c                           |  449 ++++<br>
&gt;&gt; src/tools/pgmd5/Makefile.in                        |   24 +-<br>
&gt;&gt; src/tools/pgmd5/pool_config.c                      | 2318 +-------------------<br>
&gt;&gt; src/utils/base64.c                                 |  196 ++<br>
&gt;&gt; src/utils/pool_process_reporting.c                 |    5 +<br>
&gt;&gt; src/utils/pool_ssl.c                               |  350 ++-<br>
&gt;&gt; src/utils/scram-common.c                           |  238 ++<br>
&gt;&gt; src/utils/sha2.c                                   |  999 +++++++++<br>
&gt;&gt; src/utils/ssl_utils.c                              |  248 +++<br>
&gt;&gt; src/watchdog/Makefile.in                           |   24 +-<br>
&gt;&gt; src/watchdog/watchdog.c                            |    1 +<br>
&gt;&gt; src/watchdog/wd_json_data.c                        |    3 +<br>
&gt;&gt; src/watchdog/wd_lifecheck.c                        |    8 +-<br>
&gt;&gt; src/watchdog/wd_utils.c                            |   32 +-<br>
&gt;&gt; 80 files changed, 8747 insertions(+), 3477 deletions(-)<br>
&gt;&gt; <br>
&gt; _______________________________________________<br>
&gt; pgpool-committers mailing list<br>
&gt; <a href="mailto:pgpool-committers@pgpool.net" target="_blank">pgpool-committers@pgpool.net</a><br>
&gt; <a href="http://www.pgpool.net/mailman/listinfo/pgpool-committers" rel="noreferrer" target="_blank">http://www.pgpool.net/mailman/listinfo/pgpool-committers</a><br>
</blockquote></div></div></div>