使用 gpgsm 导入证书:pinentry 未显示

使用 gpgsm 导入证书:pinentry 未显示

我最近安装了 GnuPG 2.0.19 以便将 GPGME 与 mutt(1.5.21)一起使用。

gpg-agent.conf 有

log-file /Users/jan/gpg-agent.log
debug-level guru
debug 1024
verbose
lc-ctype UTF-8
keep-tty
keep-display

.bash_profile包含export GPG_TTY=`tty`

尝试导入证书(包括私钥)时 –

jan$ eval `gpg-agent --daemon`
gpg-agent[823]: enabled debug flags: command mpi crypto memory cache memstat hashing assuan
jan$ gpgsm --import Backup/conf_home/certs/mycert.p12 

– pinentry 界面没有显示出来。ps waux显示gpg-protect-tool和都pinentry被调用 –

jan              827 100.0  0.0  2432948    848   ??  R     9:34AM   0:34.87 /usr/local/bin/pinentry
jan              826   0.0  0.0  2434032    896 s000  S+    9:34AM   0:00.00 gpg-protect-tool --homedir ~/.gnupg --p12-import --store --no-fail-on-exist --enable-status-msg --
jan              825   0.0  0.0  2434556   1112 s000  S+    9:34AM   0:00.01 gpgsm --import Backup/conf_home/certs/mycert.p12
jan              824   0.0  0.0  2434908    636   ??  Ss    9:33AM   0:00.01 gpg-agent --daemon

gpg-agent.log并且

2013-05-24 09:33:57 gpg-agent[823] listening on socket `/tmp/gpg-830NIC/S.gpg-agent'
2013-05-24 09:33:57 gpg-agent[824] gpg-agent (GnuPG) 2.0.19 started
2013-05-24 09:34:06 gpg-agent[824] handler 0x7f8d93404b50 for fd 7 started
gpg-agent[824]: chan_7 -> OK Pleased to meet you
gpg-agent[824]: chan_7 <- RESET
gpg-agent[824]: chan_7 -> OK
gpg-agent[824]: chan_7 <- OPTION ttyname=/dev/ttys000
gpg-agent[824]: chan_7 -> OK
gpg-agent[824]: chan_7 <- OPTION ttytype=xterm-256color
gpg-agent[824]: chan_7 -> OK
gpg-agent[824]: chan_7 <- OPTION lc-ctype=en_US.UTF-8
gpg-agent[824]: chan_7 -> OK
gpg-agent[824]: chan_7 <- OPTION lc-messages=en_US.UTF-8
gpg-agent[824]: chan_7 -> OK
gpg-agent[824]: chan_7 <- OPTION allow-pinentry-notify
gpg-agent[824]: chan_7 -> OK
gpg-agent[824]: chan_7 <- NOP
gpg-agent[824]: chan_7 -> OK
2013-05-24 09:34:06 gpg-agent[824] handler 0x7f8d93404f50 for fd 8 started
gpg-agent[824]: chan_8 -> OK Pleased to meet you
gpg-agent[824]: chan_8 <- RESET
gpg-agent[824]: chan_8 -> OK
gpg-agent[824]: chan_8 <- OPTION allow-pinentry-notify
gpg-agent[824]: chan_8 -> OK
gpg-agent[824]: chan_8 <- GETINFO cmd_has_option GET_PASSPHRASE repeat
gpg-agent[824]: chan_8 -> OK
gpg-agent[824]: chan_8 <- GET_PASSPHRASE --data --repeat=0 -- X X Passphrase: Please+enter+the+passphrase+to+unprotect+the+PKCS#12+object.
2013-05-24 09:34:06 gpg-agent[824] starting a new PIN Entry
gpg-agent[824]: chan_9 <- OK Your orders please
2013-05-24 09:34:06 gpg-agent[824] DBG: connection to PIN entry established
gpg-agent[824]: chan_9 -> OPTION grab
gpg-agent[824]: chan_9 <- OK
gpg-agent[824]: chan_9 -> OPTION ttytype=xterm-256color
gpg-agent[824]: chan_9 <- OK
gpg-agent[824]: chan_9 -> OPTION lc-ctype=UTF-8
gpg-agent[824]: chan_9 <- OK
gpg-agent[824]: chan_9 -> OPTION default-ok=_OK
gpg-agent[824]: chan_9 <- OK
gpg-agent[824]: chan_9 -> OPTION default-cancel=_Cancel
gpg-agent[824]: chan_9 <- OK
gpg-agent[824]: chan_9 -> OPTION default-prompt=PIN:
gpg-agent[824]: chan_9 <- OK
gpg-agent[824]: chan_9 -> OPTION touch-file=/tmp/gpg-830NIC/S.gpg-agent
gpg-agent[824]: chan_9 <- OK
gpg-agent[824]: chan_9 -> GETINFO pid
gpg-agent[824]: chan_9 <- D 827
gpg-agent[824]: chan_9 <- OK
gpg-agent[824]: chan_8 -> INQUIRE PINENTRY_LAUNCHED 827
gpg-agent[824]: chan_8 <- END
gpg-agent[824]: chan_9 -> SETDESC Please enter the passphrase to unprotect the PKCS#12 object.
gpg-agent[824]: chan_9 <- OK
gpg-agent[824]: chan_9 -> SETPROMPT Passphrase:
gpg-agent[824]: chan_9 <- OK
gpg-agent[824]: chan_9 -> [[Confidential data not shown]]
gpg-agent[824]: chan_9 <- [[Confidential data not shown]]
gpg-agent[824]: chan_9 -> BYE
gpg-agent[824]: chan_7 <- [eof]
2013-05-24 09:35:52 gpg-agent[824] handler 0x7f8d93404b50 for fd 7 terminated
2013-05-24 09:35:58 gpg-agent[824] command get_passphrase failed: Invalid IPC response
gpg-agent[824]: chan_8 -> ERR 67109124 Invalid IPC response <GPG Agent>
2013-05-24 09:35:58 gpg-agent[824] Assuan processing failed: Broken pipe
2013-05-24 09:35:58 gpg-agent[824] handler 0x7f8d93404f50 for fd 8 terminated

处理程序被手动终止(CTRL-C)。

当使用gpgsmgpg生成密钥时,不会出现此问题(即pinentry正确显示),而使用 签名或解密文件时会出现此问题gpg。我该如何调试此问题?

答案1

你必须做

export LC_TYPE=UTF-8

事实上,在我的 OSX 机器上,这是默认设置的。
(尽管我很难弄清楚 OSX 实际上在哪里设置了它。)

相关内容