Importando certificados com gpgsm: o pinentry não é exibido

0

Eu instalei recentemente o GnuPG 2.0.19 para usar o GPGME com o mutt (1.5.21).

gpg-agent.conf tem

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

e .bash_profile contém export GPG_TTY='tty' .

Ao tentar importar um certificado (incluindo uma chave privada) -

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 

- a interface de pinagem não é exibida. ps waux mostra que gpg-protect-tool e pinentry são chamados -

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

- e gpg-agent.log tem

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

O manipulador é terminado manualmente (CTRL-C).

Quando gpgsm ou gpg são usados para gerar chaves, esse problema não ocorre (por exemplo, pinentry é exibido corretamente), como acontece ao assinar ou descriptografar arquivos com gpg . O que posso fazer para depurar isso?

    
por janeden 22.05.2013 / 21:58

1 resposta

0

Você tem que fazer

export LC_TYPE=UTF-8

Na verdade, na minha máquina OSX que está configurada por padrão.
(Embora eu tenha dificuldade em descobrir se o OSX realmente define isso.)

    
por 22.05.2013 / 22:34