Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nDWGG-0004u4-SN for pgsql-jdbc@arkaria.postgresql.org; Fri, 28 Jan 2022 18:46:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nDWGF-0003D2-9H for pgsql-jdbc@arkaria.postgresql.org; Fri, 28 Jan 2022 18:46:15 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nDWGE-0003Cp-Vs for pgsql-jdbc@lists.postgresql.org; Fri, 28 Jan 2022 18:46:15 +0000 Received: from out-26.smtp.github.com ([192.30.252.209] helo=smtp.github.com) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nDWG7-0000aj-Tb for pgsql-jdbc@lists.postgresql.org; Fri, 28 Jan 2022 18:46:13 +0000 Received: from github.com (hubbernetes-node-5fd7c56.ash1-iad.github.net [10.56.131.50]) by smtp.github.com (Postfix) with ESMTPA id CE6E75E1640 for ; Fri, 28 Jan 2022 10:46:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=github.com; s=pf2014; t=1643395566; bh=kdx+I8UeBqe/ztvTuDGRQ/e1R9/8/uPcytr2Ahs0yng=; h=Date:From:To:Subject:From; b=Ko8fi2rpZGwngbCM3htq7LIqnX/jTu0Vv+FSq8+BnfLniOWs/BDaQ4LxxvtsDcdRt qZC+5qBhoaLIAqLY/pEFjPxAtu9EyyYbSywaUIpDfT99JkgoFDjzyTpSq2QSmA0Gh0 G28TLYxd9xU170jlIShHuR6IQC3iQcgaWCIkjmuQ= Date: Fri, 28 Jan 2022 10:46:06 -0800 From: Sehrope Sarkuni To: pgsql-jdbc@lists.postgresql.org Message-ID: Subject: [pgjdbc/pgjdbc] dd6000: feat: Change AuthenticationPlugin interface to use... Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Approved: 58GruLoMopuc X-GitHub-Recipient-Address: pgsql-jdbc@lists.postgresql.org X-Auto-Response-Suppress: All List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Branch: refs/heads/master Home: https://github.com/pgjdbc/pgjdbc Commit: dd6000e290f55aa79467c85f641f0099c644bf07 https://github.com/pgjdbc/pgjdbc/commit/dd6000e290f55aa79467c85f641f0099c644bf07 Author: Sehrope Sarkuni Date: 2022-01-28 (Fri, 28 Jan 2022) Changed paths: R pgjdbc/src/main/java/org/postgresql/core/AuthenticationPluginManager.java A pgjdbc/src/main/java/org/postgresql/core/v3/AuthenticationPluginManager.java M pgjdbc/src/main/java/org/postgresql/core/v3/ConnectionFactoryImpl.java M pgjdbc/src/main/java/org/postgresql/gss/GSSCallbackHandler.java M pgjdbc/src/main/java/org/postgresql/gss/MakeGSS.java M pgjdbc/src/main/java/org/postgresql/plugin/AuthenticationPlugin.java M pgjdbc/src/test/java/org/postgresql/test/plugin/AuthenticationPluginTest.java Log Message: ----------- feat: Change AuthenticationPlugin interface to use char[] rather than String Changes AuthenticationPlugin interface for dynamic passwords to supply passwords as a char[] rather than a String. This changes the currently unreleased public interface of AuthenticationPlugin and allows the driver to clear the user provided char[] array after it is finished using it for authentication. Users implementing that interface must ensure that each invocation of the method provides a new char[] array as the contents will be filled with zeroes by the driver after use. Call sites within the driver have been updated to use the char[] directly wherever possible. This includes direct usage in the GSS authentication code paths that internally were already converting the String password into a char[] for internal usage. The SASL (i.e. "SCRAM") internals have not been updated to use a char[] array as the entirety of that library uses String types for provided passwords. Assuming that it is not exposed in other parts of the driver, that could be updated as a standalone PR. For now the entrypoint from the ConnectionFactoryImpl into the SASL library simply converts the char[] array to a String at it's single usage point. Co-Authored-By: Vladimir Sitnikov