Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prompting for two different challenge codes at once #37

Open
Lerrrtaste opened this issue Nov 21, 2022 · 1 comment
Open

Prompting for two different challenge codes at once #37

Lerrrtaste opened this issue Nov 21, 2022 · 1 comment

Comments

@Lerrrtaste
Copy link

After executing onlykey-gpg init "Name <email>"
The prompt for the 3 digit challenge code appears, but after pressing the first digit, I am being asked for a second, different challenge code. Typing the second digit causes the error below. None of the two codes are accepted, it always crashes after the second digit.

OnlyKey v2.1.2-prodc
onlykey-agent=1.1.13
lib-agent=1.0.4


$ rm .gnupg/onlykey -rf; onlykey-gpg init "Name <email>"
Enter the 3 digit challenge code on OnlyKey to authorize <gpg://Name <email>|ed25519>
3 6 3
Enter the 3 digit challenge code on OnlyKey to authorize <gpg://Name <email>|ed25519>
1 1 3
gpg: inserting ownertrust of 6
gpg: checking the trustdb
gpg: marginals needed: 3  completes needed: 1  trust model: pgp
gpg: depth: 0  valid:   1  signed:   0  trust: 0-, 0q, 0n, 0m, 0f, 1u
gpg: error reading key: No secret key
Traceback (most recent call last):
  File "/nix/store/4xdxhkmadnxspak0c8lhcqfc2ngx65l1-onlykey-agent-1.1.13/bin/.onlykey-gpg-wrapped", line 9, in <module>
    sys.exit(gpg_tool())
  File "/nix/store/4xdxhkmadnxspak0c8lhcqfc2ngx65l1-onlykey-agent-1.1.13/lib/python3.9/site-packages/onlykey_agent/__init__.py", line 6, in <lambda>
    gpg_tool = lambda: libagent.gpg.main(DeviceType)
  File "/nix/store/1kswc7h6ns4658pkymcfp0j8ss11wanb-python3.9-libagent-1.0.4/lib/python3.9/site-packages/libagent/gpg/__init__.py", line 392, in main
    return args.func(device_type=device_type, args=args)
  File "/nix/store/1kswc7h6ns4658pkymcfp0j8ss11wanb-python3.9-libagent-1.0.4/lib/python3.9/site-packages/libagent/gpg/__init__.py", line 226, in run_init
    check_call(keyring.gpg_command(['--homedir', homedir,
  File "/nix/store/1kswc7h6ns4658pkymcfp0j8ss11wanb-python3.9-libagent-1.0.4/lib/python3.9/site-packages/libagent/gpg/__init__.py", line 114, in check_call
    subprocess.check_call(args=args, stdin=stdin, env=env)
  File "/nix/store/j652sgyb3137c19v5vy5ziaarw5k5bf6-python3-3.9.15/lib/python3.9/subprocess.py", line 373, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/nix/store/1zxblwdng71wsl4lwwpl5gm1k533c1pi-gnupg-2.3.6/bin/gpg', '--homedir', '/home/username/.gnupg/onlykey', '--list-secret-keys', 'Name <email>']' returned non-zero exit status 2.
@onlykey
Copy link

onlykey commented Nov 21, 2022

Hey I wasn't able to replicate this. To use the GPG agent you do need to set derived key challenge mode to press only.

https://docs.onlykey.io/onlykey-agent.html#setting-derived-key-user-input-mode

% onlykey-gpg init "Name <email>"
Enter the 3 digit challenge code on OnlyKey to authorize <gpg://Name <email>|ed25519>
3 5 4
Enter the 3 digit challenge code on OnlyKey to authorize <gpg://Name <email>|ed25519>
6 3 6
gpg: inserting ownertrust of 6
gpg: checking the trustdb
gpg: marginals needed: 3  completes needed: 1  trust model: pgp
gpg: depth: 0  valid:   1  signed:   0  trust: 0-, 0q, 0n, 0m, 0f, 1u
sec   ed25519 1970-01-01 [SC]
      649BED8398B2593790FDC7DA
uid           [ultimate] Name <email>
ssb   cv25519 1970-01-01 [E]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants