Uploaded image for project: 'SignServer'
  1. SignServer
  2. DSS-2007

Password prompt not working under Cygwin

    Details

      Description

      Running SignClient on Windows with Cygwin and not specifying the keystore password the application is supposed to prompt for the password, but instead it fails:

      Caused by: java.io.IOException: org.signserver.cli.spi.CommandFailureException: Failed to read password
              at org.signserver.client.cli.defaultimpl.KeyStoreOptions$1.handle(KeyStoreOptions.java:299)
              at sun.security.pkcs11.SunPKCS11.login(SunPKCS11.java:1198)
              ... 15 more
      Caused by: org.signserver.cli.spi.CommandFailureException: Failed to read password
              at org.signserver.client.cli.defaultimpl.DefaultConsolePasswordReader.readPassword(DefaultConsolePasswordReader.java:22)
              at org.signserver.client.cli.defaultimpl.KeyStoreOptions$1.handle(KeyStoreOptions.java:293)
              ... 16 more
      

      The issue seems to be that Cygwin does not offer a real console and thus the password prompt (which does not echo the characters typed) are not available.

      See for instance:
      https://stackoverflow.com/questions/42233846/java-console-in-cygwin
      https://github.com/mintty/mintty/issues/56

       

      Workarounds:

      • Don't use Cygwin (or instead invoke cmd.exe)
      • Specify password as a command line flag

      Possible improvments:

      • We could consider falling back to reading the password from stdin either with a warning printed that the password will not be hidden or with an additional -passwordfromstdin flag that would have to be provided.

        Attachments

          Activity

            People

            Assignee:
            marcus.lundblad@primekey.se Marcus Lundblad
            Reporter:
            markus Markus Kilås
            Verified by:
            Markus Kilås
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours, 4 minutes
                2h 4m