diablodale / pinentry-wsl-ps1

GUI for GPG within Windows WSL for passwords, pinentry, etc.
Mozilla Public License 2.0
97 stars 9 forks source link

Does not work #3

Closed sarunint closed 5 years ago

sarunint commented 6 years ago

Same as #2, but this time with logs!

Here we go:

2018-11-05 21:23:45 gpg-agent[3036] DBG: chan_10 -> OK Pleased to meet you, process 3042
2018-11-05 21:23:45 gpg-agent[3036] DBG: chan_10 <- RESET
2018-11-05 21:23:45 gpg-agent[3036] DBG: chan_10 -> OK
2018-11-05 21:23:45 gpg-agent[3036] DBG: chan_10 <- OPTION ttyname=/dev/tty1
2018-11-05 21:23:45 gpg-agent[3036] DBG: chan_10 -> OK
2018-11-05 21:23:45 gpg-agent[3036] DBG: chan_10 <- OPTION ttytype=xterm-256color
2018-11-05 21:23:45 gpg-agent[3036] DBG: chan_10 -> OK
2018-11-05 21:23:45 gpg-agent[3036] DBG: chan_10 <- OPTION lc-ctype=en_US.UTF-8
2018-11-05 21:23:45 gpg-agent[3036] DBG: chan_10 -> OK
2018-11-05 21:23:45 gpg-agent[3036] DBG: chan_10 <- OPTION lc-messages=en_US.UTF-8
2018-11-05 21:23:45 gpg-agent[3036] DBG: chan_10 -> OK
2018-11-05 21:23:45 gpg-agent[3036] DBG: chan_10 <- GETINFO version
2018-11-05 21:23:45 gpg-agent[3036] DBG: chan_10 -> D 2.2.4
2018-11-05 21:23:45 gpg-agent[3036] DBG: chan_10 -> OK
2018-11-05 21:23:45 gpg-agent[3036] DBG: chan_10 <- OPTION allow-pinentry-notify
2018-11-05 21:23:45 gpg-agent[3036] DBG: chan_10 -> OK
2018-11-05 21:23:45 gpg-agent[3036] DBG: chan_10 <- OPTION agent-awareness=2.1.0
2018-11-05 21:23:45 gpg-agent[3036] DBG: chan_10 -> OK
2018-11-05 21:23:45 gpg-agent[3036] DBG: chan_10 <- GETINFO s2k_count
2018-11-05 21:23:47 gpg-agent[3036] S2K calibration: 64423936 -> 359ms
2018-11-05 21:23:47 gpg-agent[3036] DBG: chan_10 -> D 64423936
2018-11-05 21:23:47 gpg-agent[3036] DBG: chan_10 -> OK
2018-11-05 21:23:47 gpg-agent[3036] DBG: chan_10 <- GETINFO cmd_has_option GET_PASSPHRASE repeat
2018-11-05 21:23:47 gpg-agent[3036] DBG: chan_10 -> OK
2018-11-05 21:23:47 gpg-agent[3036] DBG: chan_10 <- GET_PASSPHRASE --data --repeat=1 -- S37AFE6F44FE7851F X X Enter+passphrase%0A
2018-11-05 21:23:47 gpg-agent[3036] starting a new PIN Entry
2018-11-05 21:23:47 gpg-agent[3036] DBG: chan_11 <- OK Your orders please
2018-11-05 21:23:47 gpg-agent[3036] DBG: connection to PIN entry established
2018-11-05 21:23:47 gpg-agent[3036] DBG: chan_11 -> OPTION no-grab
2018-11-05 21:23:47 gpg-agent[3036] DBG: chan_11 <- OK
2018-11-05 21:23:47 gpg-agent[3036] DBG: chan_11 -> OPTION ttyname=/dev/tty1
2018-11-05 21:23:47 gpg-agent[3036] DBG: chan_11 <- OK
2018-11-05 21:23:47 gpg-agent[3036] DBG: chan_11 -> OPTION ttytype=xterm-256color
2018-11-05 21:23:47 gpg-agent[3036] DBG: chan_11 <- OK
2018-11-05 21:23:47 gpg-agent[3036] DBG: chan_11 -> OPTION lc-ctype=en_US.UTF-8
2018-11-05 21:23:47 gpg-agent[3036] DBG: chan_11 <- OK
2018-11-05 21:23:47 gpg-agent[3036] DBG: chan_11 -> OPTION lc-messages=en_US.UTF-8
2018-11-05 21:23:48 gpg-agent[3036] DBG: chan_11 <- OK
2018-11-05 21:23:48 gpg-agent[3036] DBG: chan_11 -> OPTION allow-external-password-cache
2018-11-05 21:23:48 gpg-agent[3036] DBG: chan_11 <- OK
2018-11-05 21:23:48 gpg-agent[3036] DBG: chan_11 -> OPTION default-ok=_OK
2018-11-05 21:23:48 gpg-agent[3036] DBG: chan_11 <- OK
2018-11-05 21:23:48 gpg-agent[3036] DBG: chan_11 -> OPTION default-cancel=_Cancel
2018-11-05 21:23:48 gpg-agent[3036] DBG: chan_11 <- OK
2018-11-05 21:23:48 gpg-agent[3036] DBG: chan_11 -> OPTION default-yes=_Yes
2018-11-05 21:23:48 gpg-agent[3036] DBG: chan_11 <- OK
2018-11-05 21:23:48 gpg-agent[3036] DBG: chan_11 -> OPTION default-no=_No
2018-11-05 21:23:48 gpg-agent[3036] DBG: chan_11 <- OK
2018-11-05 21:23:48 gpg-agent[3036] DBG: chan_11 -> OPTION default-prompt=PIN:
2018-11-05 21:23:49 gpg-agent[3036] DBG: chan_11 <- OK
2018-11-05 21:23:49 gpg-agent[3036] DBG: chan_11 -> OPTION default-pwmngr=_Save in password manager
2018-11-05 21:23:49 gpg-agent[3036] DBG: chan_11 <- OK
2018-11-05 21:23:49 gpg-agent[3036] DBG: chan_11 -> OPTION default-cf-visi=Do you really want to make your passphrase visible on the screen?
2018-11-05 21:23:49 gpg-agent[3036] DBG: chan_11 <- OK
2018-11-05 21:23:49 gpg-agent[3036] DBG: chan_11 -> OPTION default-tt-visi=Make passphrase visible
2018-11-05 21:23:49 gpg-agent[3036] DBG: chan_11 <- OK
2018-11-05 21:23:49 gpg-agent[3036] DBG: chan_11 -> OPTION default-tt-hide=Hide passphrase
2018-11-05 21:23:49 gpg-agent[3036] DBG: chan_11 <- OK
2018-11-05 21:23:49 gpg-agent[3036] DBG: chan_11 -> OPTION touch-file=/home/sarunint/.gnupg/S.gpg-agent
2018-11-05 21:23:49 gpg-agent[3036] DBG: chan_11 <- OK
2018-11-05 21:23:49 gpg-agent[3036] DBG: chan_11 -> OPTION owner=3042 DESKTOP-OD0TNGB
2018-11-05 21:23:49 gpg-agent[3036] DBG: chan_11 <- OK
2018-11-05 21:23:49 gpg-agent[3036] DBG: chan_11 -> GETINFO flavor
2018-11-05 21:23:50 gpg-agent[3036] DBG: chan_11 <- ERR 83886355 unknown command
2018-11-05 21:23:50 gpg-agent[3036] DBG: chan_11 -> GETINFO version
2018-11-05 21:23:50 gpg-agent[3036] DBG: chan_11 <- D 0.2.0
2018-11-05 21:23:50 gpg-agent[3036] DBG: chan_11 <- OK
2018-11-05 21:23:50 gpg-agent[3036] DBG: chan_11 -> GETINFO ttyinfo
2018-11-05 21:23:50 gpg-agent[3036] DBG: chan_11 <- ERR 83886355 unknown command
2018-11-05 21:23:50 gpg-agent[3036] DBG: chan_11 -> GETINFO pid
2018-11-05 21:23:50 gpg-agent[3036] DBG: chan_11 <- D 3044
2018-11-05 21:23:50 gpg-agent[3036] DBG: chan_11 <- OK
2018-11-05 21:23:50 gpg-agent[3036] DBG: chan_10 -> INQUIRE PINENTRY_LAUNCHED 3044 unknown 0.2.0 ? ? ?
2018-11-05 21:23:50 gpg-agent[3036] DBG: chan_11 -> SETKEYINFO u/S37AFE6F44FE7851F
2018-11-05 21:23:50 gpg-agent[3036] DBG: chan_11 <- OK
2018-11-05 21:23:50 gpg-agent[3036] DBG: chan_11 -> SETDESC Enter passphrase%0A

Looks like gpg check for GET_PASSPHRASE command with GETINFO cmd_has_option GET_PASSPHRASE repeat and since your script returns OK it fires that command.

EDIT: my environment Windows 10 version 1809 Ubuntu 18.04

sarunint@DESKTOP-OD0TNGB:~$ gpg --version
gpg (GnuPG) 2.2.4
libgcrypt 1.8.1
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Home: /home/sarunint/.gnupg
Supported algorithms:
Pubkey: RSA, ELG, DSA, ECDH, ECDSA, EDDSA
Cipher: IDEA, 3DES, CAST5, BLOWFISH, AES, AES192, AES256, TWOFISH,
        CAMELLIA128, CAMELLIA192, CAMELLIA256
Hash: SHA1, RIPEMD160, SHA256, SHA384, SHA512, SHA224
Compression: Uncompressed, ZIP, ZLIB, BZIP2

(Yes, Ubuntu 18.04's gpg is version 2 by default, so no more gpg2.)

diablodale commented 6 years ago

Hello. thanks for the initial issue information. I do need to get the step-by-step information of how to reproduce your issue. I see that you have Windows 10 and the newer 18.04 Ubuntu WSL (I personally haven't tested 18.04). What are the detailed steps that I need to follow to reproduce your issue? What is your issue? Meaning what is the errant result that you get? What is your expected result rather than the errant result?

sarunint commented 6 years ago

Hi @diablodale, I'll provide you with information later today.

sarunint commented 6 years ago

How to reproduce

  1. Install the script as instructed in the README
  2. Restart gpg-agent using gpg-connect-agent killagent /bye then gpg-connect-agent /bye
  3. Run echo "test" | gpg -a -c

After step 3, I should get a dialog prompting for a passphrase, but GPG simply just hangs indefinitely.

The log is as shown in the original post.

diablodale commented 5 years ago

Hello. I found a one-line bug with my handing of the SETDESC command. Please try this branch which has the fix in it. Does it work and no longer hang? https://github.com/diablodale/pinentry-wsl-ps1/tree/handle-newkey

sarunint commented 5 years ago

Hmm, let me check.

sarunint commented 5 years ago

Hi @diablodale, it does not hang anymore!

diablodale commented 5 years ago

:-) good news. I will close this issue as resolved fixed.

hugmanrique commented 5 years ago

I'm using the bash script on the handle-newkey branch (it doesn't seem like it got merged to master) and gpg still hangs. I ran the same command (echo "test" | gpg -a -c) and got the following output:

gpg: problem with the agent: Timeout
gpg: error creating passphrase: Operation cancelled
gpg: symmetric encryption of '[stdin]' failed: Operation cancelled
diablodale commented 5 years ago

Oops, I did forget to merge it to master. I just did that now. @hugmanrique , please open a new bug with very much more information so that I can help you with your specific issues.