Failed to export secret key

Alexander Leidinger Alexander at Leidinger.net
Fri Sep 8 15:40:43 CEST 2023


Am 2023-09-08 15:26, schrieb Werner Koch:
> On Fri,  8 Sep 2023 13:49, Alexander Leidinger said:

>> 2023-09-08 13:37:54 gpg-agent[94491] DBG: error calling pinentry:
>> Operation cancelled <Pinentry>
> 
> You clicked on CANCEL or closed the window.

No prompt at all in the console / ssh connection (and no graphics, so 
nothing to click on). So no manual cancelling from me.

>> gpg: key 89DE8BFC8A2A81F8C9BD2F7940C7373A4DE34E7C: asking agent for
>> the secret parts
> [...]
>> gpg: key 89DE8BFC8A2A81F8C9BD2F7940C7373A4DE34E7C: error receiving key
>> from agent: Operation cancelled - skipped
> 
> You canceled, gpg-agent could not unprotect the key and and thus you 
> get
> the error code.
> 
> Given that you said it worked in loopback mode - I assume the pinentry
> is broken and returns Cancel due to other reasons.  Did you
> 
> GPG=$(tty)
> export GPG_TTY

% echo $GPG_TTY
/dev/pts/5

> in your target's bashrc etc?  The simple tty pinentry is used and it
> needs to know its tty - is /dev/pts/5 the correct one?  Try running

Yes it is:
% tty
/dev/pts/5

And there is no other one (this is a FreeBSD jail):
% ll /dev/pts
total 0
crw--w----  1 netchild tty 0x190  8 Sep. 15:36 5

> pinentry on the target directly:
> 
> $ pinentry
> getpin
> 
> should show the prompt.  Does it - if not, strace the process etc.

I only have two pinentry binaries installed, both are not for a 
graphical environment:

% ll /usr/local/bin/pinentry*
lrwxr-xr-x  1 root wheel   12B 31 Aug. 08:20 /usr/local/bin/pinentry@ -> 
pinentry-tty
-r-xr-xr-x  1 root wheel   71K  1 Sep. 00:13 
/usr/local/bin/pinentry-curses*
-r-xr-xr-x  1 root wheel   61K 31 Aug. 03:00 
/usr/local/bin/pinentry-tty*

% pinentry
Warning: using insecure memory!
OK Pleased to meet you
getpin
pinentry-tty
PIN:
D asdf
OK
bye
OK closing connection

% pinentry-curses
Warning: using insecure memory!
OK Pleased to meet you
getpin
<courses dialog popped up in the ssh connection>
D asdf
OK
bye
OK closing connection

Bye,
Alexander.

-- 
http://www.Leidinger.net Alexander at Leidinger.net: PGP 0x8F31830F9F2772BF
http://www.FreeBSD.org    netchild at FreeBSD.org  : PGP 0x8F31830F9F2772BF
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.gnupg.org/pipermail/gnupg-users/attachments/20230908/10b4b7f6/attachment.sig>


More information about the Gnupg-users mailing list