unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Attila Lendvai <attila@lendvai.name>
To: "guix-devel@gnu.org" <guix-devel@gnu.org>
Subject: trezor-agent: using trezor as gpg key
Date: Fri, 03 Sep 2021 07:55:19 +0000	[thread overview]
Message-ID: <LG1FKqVJE9Wibs9b_cUrhBqy_1mcAO33xMiZ_CA35rmE1NEZNWo_6xWHm8h9w-4BN8d0DeX3LbMi5XdHb--ZcUwvUR4zKzDzVJ3YEhr8Skw=@lendvai.name> (raw)

[-- Attachment #1: Type: text/plain, Size: 3203 bytes --]

hello,

i'm failing to configure my gnupg to use Trezor (an USB hw key store).

i have installed the trezord-udev-rules system-wide, but the rules refer to the "plugdev" group that is not present on guix. i see that some other packages do this:

(add-after 'autoreconf 'change-udev-group
(lambda _
(substitute* "contrib/60-openocd.rules"
(("plugdev") "dialout"))
#t))

but "dialout", for a trezor?

so, i proceeded to add the plugdev group to my system config. this didn't seem to help, /dev/usb/hiddev0 remained root:root even after a reboot, which is strange.

then i manually chgrp and chmod the file:

$ ls -l /dev/usb/
crw-rw---- 1 root plugdev 180, 0 Sep 3 09:25 hiddev0

$ groups
users plugdev [...]

$ trezor-gpg-agent &
[1] 11223

$ gpg --sign /tmp/x
2021-09-03 09:41:19,129 ERROR Failed to enumerate WebUsbTransport. USBErrorAccess: LIBUSB_ERROR_ACCESS [-3] [__init__.py:126]
2021-09-03 09:41:19,132 ERROR handler failed: Trezor not connected [__init__.py:273]
Traceback (most recent call last):
File "/gnu/store/iy5xgmn2hdcnnl2d0n9zv15y2di7hl7n-python-trezor-agent-0.13.1/lib/python3.8/site-packages/libagent/gpg/__init__.py", line 265, in run_agent
handler.handle(conn)
File "/gnu/store/iy5xgmn2hdcnnl2d0n9zv15y2di7hl7n-python-trezor-agent-0.13.1/lib/python3.8/site-packages/libagent/gpg/agent.py", line 242, in handle
handler(conn, args)
File "/gnu/store/iy5xgmn2hdcnnl2d0n9zv15y2di7hl7n-python-trezor-agent-0.13.1/lib/python3.8/site-packages/libagent/gpg/agent.py", line 102, in <lambda>
b'HAVEKEY': lambda _, args: self.have_key(*args),
File "/gnu/store/iy5xgmn2hdcnnl2d0n9zv15y2di7hl7n-python-trezor-agent-0.13.1/lib/python3.8/site-packages/libagent/gpg/agent.py", line 205, in have_key
self.get_identity(keygrip=keygrip)
File "/gnu/store/iy5xgmn2hdcnnl2d0n9zv15y2di7hl7n-python-trezor-agent-0.13.1/lib/python3.8/site-packages/libagent/util.py", line 230, in wrapper
result = method(self, *args, **kwargs)
File "/gnu/store/iy5xgmn2hdcnnl2d0n9zv15y2di7hl7n-python-trezor-agent-0.13.1/lib/python3.8/site-packages/libagent/gpg/agent.py", line 170, in get_identity
verifying_key = self.client.pubkey(identity=identity, ecdh=ecdh)
File "/gnu/store/iy5xgmn2hdcnnl2d0n9zv15y2di7hl7n-python-trezor-agent-0.13.1/lib/python3.8/site-packages/libagent/gpg/client.py", line 27, in pubkey
with self.device:
File "/gnu/store/iy5xgmn2hdcnnl2d0n9zv15y2di7hl7n-python-trezor-agent-0.13.1/lib/python3.8/site-packages/libagent/device/interface.py", line 126, in __enter__
self.conn = self.connect()
File "/gnu/store/iy5xgmn2hdcnnl2d0n9zv15y2di7hl7n-python-trezor-agent-0.13.1/lib/python3.8/site-packages/libagent/device/trezor.py", line 51, in connect
raise interface.NotFoundError('{} not connected'.format(self))
libagent.device.interface.NotFoundError: Trezor not connected
gpg: Warning: not using 'Attila Lendvai <attila@lendvai.name>' as default key: No secret key
gpg: all values passed to '--default-key' ignored
gpg: keydb_search failed: Broken pipe
gpg: no default secret key: Broken pipe
gpg: signing failed: Broken pipe

how can i see/debug here which file has the wrong permissions? the python backtrace is not very useful without printing the variable values.

- attila
PGP: 5D5F 45C7 DFCD 0A39

[-- Attachment #2: Type: text/html, Size: 5404 bytes --]

             reply	other threads:[~2021-09-03  7:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-03  7:55 Attila Lendvai [this message]
2021-09-03 16:35 ` trezor-agent: using trezor as gpg key Danny Milosavljevic
2021-09-06 10:12   ` Attila Lendvai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='LG1FKqVJE9Wibs9b_cUrhBqy_1mcAO33xMiZ_CA35rmE1NEZNWo_6xWHm8h9w-4BN8d0DeX3LbMi5XdHb--ZcUwvUR4zKzDzVJ3YEhr8Skw=@lendvai.name' \
    --to=attila@lendvai.name \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).