RFR: 8366261: Provide utility methods for sun.security.util.Password [v2]
Chen Liang
liach at openjdk.org
Thu Aug 28 13:44:44 UTC 2025
On Wed, 27 Aug 2025 23:48:28 GMT, Naoto Sato <naoto at openjdk.org> wrote:
>> Providing a couple of utility methods using the "built-in" `Console` implementation to support tools that require password input, such as `keytool`, ensuring they work even when std0ut is redirected.
>
> Naoto Sato has updated the pull request incrementally with one additional commit since the last revision:
>
> @Native annotated
src/java.base/share/classes/jdk/internal/io/JdkConsoleImpl.java line 117:
> 115: return INSTANCE.orElseSet(() -> {
> 116: // If there's already a proper console, throw an exception
> 117: if (System.console() != null) {
Since this initializes the console, this means the console can only be available when there is no provider and stdin is tty, but stdout is not. Is this intended? (In other words, should we make System.console() lazy, as it is initialized with java.io.Console as Console.cons?)
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26973#discussion_r2307460301
More information about the security-dev
mailing list