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

[Manjaro] Pius errors #131

Open
alexandre1985 opened this issue Jun 17, 2019 · 19 comments
Open

[Manjaro] Pius errors #131

alexandre1985 opened this issue Jun 17, 2019 · 19 comments

Comments

@alexandre1985
Copy link

When running pius -s "...." "...." I get this error:

Welcome to PIUS, the PGP Individual UID Signer.

Traceback (most recent call last):
  File "/usr/bin/pius", line 333, in <module>
    main()
  File "/usr/bin/pius", line 265, in main
    options.mail_host
  File "/usr/lib/python3.7/site-packages/libpius/signer.py", line 89, in __init__
    self.gpg2 = self._is_gpg2()
  File "/usr/lib/python3.7/site-packages/libpius/signer.py", line 121, in _is_gpg2
    m = re.match(r'^gpg \(GnuPG.*\) ([0-9\.]+)$', line)
  File "/usr/lib/python3.7/re.py", line 173, in match
    return _compile(pattern, flags).match(string)
TypeError: cannot use a string pattern on a bytes-like object

and if I change /usr/bin/pius shebang to #!/usr/bin/python2 I get this error:

Traceback (most recent call last):
  File "/usr/bin/pius", line 29, in <module>
    from libpius import mailer as pmailer
ImportError: No module named libpius

I need this fixed. Thank you

@lechner
Copy link
Contributor

lechner commented Jun 17, 2019

Are you using Debian?

@alexandre1985
Copy link
Author

alexandre1985 commented Jun 17, 2019

I'm using Manjaro Linux Deepin x64.
I installed pius through Manjaro's repository

@jaymzh
Copy link
Owner

jaymzh commented Jun 18, 2019

Sounds like Manjaro installed it as a py3 app instead of a py2 app, incorrectly. py3 support is experimental at best.

Your best get is just to pull down a git clone of the repo here, and then cd into the directory and do:

python2 pius

And run it directly from the source tree. Feel free to file a bug upstream againt Manjaro to repackage it properly as well.

We're working on PIUS 3.0 which will by full (and only) python 3.

@alexandre1985
Copy link
Author

I have download and build it from source.
I have cd into pius-2.2.7 directory, run: python2 ./pius -s "B13A XXXX XXXX XXXX" "1D51 XXXX XXXX XXXX" and I get this error:

pius: error: Keyring /home/me/.gnupg/pubring.gpg doesn't exist

@lechner
Copy link
Contributor

lechner commented Jun 18, 2019

Maybe run gpg one time to create the key ring?

@alexandre1985
Copy link
Author

alexandre1985 commented Jun 18, 2019

I have already have a gpg keyring. On ~/.gnupg/ there are (among others) pubring.kbx and trustdb.gpg files.
My gpg version is: 2.2.16

@jaymzh
Copy link
Owner

jaymzh commented Jun 18, 2019

Ah yeah, it assumes the ring is in pubring, not keybox format. It should be smarter about that.

In the meantime, use -r to point it to your keyring.

@alexandre1985
Copy link
Author

so it I should use -r ~/.gnupg?

@jaymzh
Copy link
Owner

jaymzh commented Jun 18, 2019

no, -r ~/.gnupg/pubring.kbx

@alexandre1985
Copy link
Author

;) 👍

@alexandre1985
Copy link
Author

I'm have my secret key on a yubikey.
When running python2 ./pius -r ~/.gnupg/pubring.kbx -s "XXXX..." "XXXXX...." I get this:

...
Have you verified this user/key, and if so, what level do you want to sign at?
  0-3, Show again, Next, Help, or Quit? [0|1|2|3|s|n|h|q] (default: n) 0

Signing all UIDs on key XXXX.....
  There are 3 UIDs on this key to sign
  UID 1 ([email protected]):   ERROR: Agent reported an error.

gpg-agent problems, bailing out!

@jaymzh
Copy link
Owner

jaymzh commented Jun 19, 2019

You're using py3 again, please use py2.

@alexandre1985
Copy link
Author

Well, I'm not.
I have tried running both:

python2 ./pius -r ~/.gnupg/pubring.kbx -s "XXX...." "XXXX......"

and

python2 pius -r ~/.gnupg/pubring.kbx -s "XXX...." "XXXX......"

and I still get the error above

@jaymzh
Copy link
Owner

jaymzh commented Jun 19, 2019

Oh sorry I read the wrong error. Can you run it in debug mode? Do you have an agent running?

@alexandre1985
Copy link
Author

alexandre1985 commented Jun 19, 2019 via email

@jaymzh
Copy link
Owner

jaymzh commented Jun 20, 2019

just run it again with -d to get debug output.

I've never tried it with the key on a yubikey, not sure how well it'll work as it expects the agent to be able to load the key. My suspicion is that the agent says something we don't know about yet that is supposed to tell us to tell you to touch your yubikey. Debug output should help.

@muelli
Copy link

muelli commented Jun 20, 2019

you can reproduce the setup with the Debian Subkeys approach: https://wiki.debian.org/Subkeys

We're "handling" this case in GNOME Keysign by ignoring it: https://gitlab.gnome.org/GNOME/gnome-keysign/issues/15

@alexandre1985
Copy link
Author

alexandre1985 commented Jun 20, 2019

python2 ./pius -r ~/.gnupg/pubring.kbx -s "A6XXXXXXXXXXXXXX" "1DXXXXXXXXXXXXXX"

Have you verified this user/key, and if so, what level do you want to sign at?
  0-3, Show again, Next, Help, or Quit? [0|1|2|3|s|n|h|q] (default: n) 0

Signing all UIDs on key 1DXXXXXXXXXXXXXX
DEBUG: Running: /usr/bin/gpg2 --keyid-format long --no-auto-check-trustdb -q --no-tty --batch --command-fd 0 --status-fd 1 --no-default-keyring --keyring /home/me/.gnupg/pubring.kbx --no-options --with-colons --edit-key 1DXXXXXXXXXXXXXX
DEBUG: Got a line [GNUPG:] KEY_CONSIDERED 50XXXXXXXXXXXXXXXXXXXXXX1DXXXXXXXXXXXXXX 0
DEBUG: Got a line pub:-:2048:1:1DXXXXXXXXXXXXXX:1400136652:1589538568::-:::sc
DEBUG: Got a line fpr:::::::::50XXXXXXXXXXXXXXXXXXXXXX1DXXXXXXXXXXXXXX:
DEBUG: Got a line sub:e:2048:1:8B76DAA995D0E6DC:1400136652:1526367052:::::e
DEBUG: Got a line fpr:::::::::F92881A08855A95FDF474F458B76DAA995D0E6DC:
DEBUG: Got a line uid:-::::::::Other Guy <[email protected]>:::S9 S8 S7 S3 H10 H9 H8 H11 Z2 Z3 Z1 Z0,mdc,no-ks-modify:1,p::
DEBUG: Got UID Other Guy <[email protected]> with status -
DEBUG: got email [email protected]
DEBUG: 1DXXXXXXXXXXXXXX__post_at_email.tld__A6XXXXXXXXXXXXXX isn't in []
DEBUG: Got a line uid:-::::::::Other Guy <[email protected]>:::S9 S8 S7 S3 H10 H9 H8 H11 Z2 Z3 Z1 Z0,mdc,no-ks-modify:2,::
DEBUG: Got UID Other Guy <[email protected]> with status -
DEBUG: got email [email protected]
DEBUG: 1DXXXXXXXXXXXXXX__bjorn_at_email.tld__A6XXXXXXXXXXXXXX isn't in ['1DXXXXXXXXXXXXXX__post_at_email.tld__A6XXXXXXXXXXXXXX']
DEBUG: Got a line uid:-::::::::Other Guy <[email protected]>:::S9 S8 S7 S3 H10 H9 H8 H11 Z2 Z3 Z1 Z0,mdc,no-ks-modify:3,::
DEBUG: Got UID Other Guy <[email protected]> with status -
DEBUG: got email [email protected]
DEBUG: 1DXXXXXXXXXXXXXX__bjorn_at_email.tld__A6XXXXXXXXXXXXXX isn't in ['1DXXXXXXXXXXXXXX__post_at_email.tld__A6XXXXXXXXXXXXXX', '1DXXXXXXXXXXXXXX__bjorn_at_email.tld__A6XXXXXXXXXXXXXX']
DEBUG: Got a line uat:-::::::::1 9828:::S9 S8 S7 S3 H10 H9 H8 H11 Z2 Z3 Z1 Z0,mdc,no-ks-modify:4,::
DEBUG: got to command prompt
DEBUG: quitting
DEBUG: waiting
  There are 3 UIDs on this key to sign
DEBUG: exporting A6XXXXXXXXXXXXXX
DEBUG: Running: /usr/bin/gpg2 --keyid-format long --no-auto-check-trustdb -q --no-tty --batch --no-default-keyring --keyring /home/me/.gnupg/pubring.kbx --armor --output /tmp/pius-tmp/A6XXXXXXXXXXXXXX.asc --export A6XXXXXXXXXXXXXX
DEBUG: exporting 1DXXXXXXXXXXXXXX
DEBUG: Running: /usr/bin/gpg2 --keyid-format long --no-auto-check-trustdb -q --no-tty --batch --no-default-keyring --keyring /home/me/.gnupg/pubring.kbx --armor --output /tmp/pius-tmp/1DXXXXXXXXXXXXXX.asc --export 1DXXXXXXXXXXXXXX
  UID 1 ([email protected]): DEBUG: importing A6XXXXXXXXXXXXXX
DEBUG: Running: /usr/bin/gpg2 --keyid-format long --no-auto-check-trustdb -q --no-tty --batch --no-default-keyring --keyring /tmp/pius-tmp/pius_keyring.gpg --import-options import-minimal,keep-ownertrust --import /tmp/pius-tmp/A6XXXXXXXXXXXXXX.asc
DEBUG: importing 1DXXXXXXXXXXXXXX
DEBUG: Running: /usr/bin/gpg2 --keyid-format long --no-auto-check-trustdb -q --no-tty --batch --no-default-keyring --keyring /tmp/pius-tmp/pius_keyring.gpg --import-options import-minimal --import /tmp/pius-tmp/1DXXXXXXXXXXXXXX.asc
DEBUG: Running: /usr/bin/gpg2 --keyid-format long --no-auto-check-trustdb -q --no-tty --batch --command-fd 0 --status-fd 1 --no-default-keyring --keyring /tmp/pius-tmp/pius_keyring.gpg -u A6XXXXXXXXXXXXXX --use-agent --default-cert-level 0 --no-ask-cert-level --edit-key 1DXXXXXXXXXXXXXX
DEBUG: Waiting for prompt
DEBUG: Waiting for line [GNUPG:] GET_LINE keyedit.prompt
DEBUG: got line [GNUPG:] KEY_CONSIDERED 50XXXXXXXXXXXXXXXXXXXXXX1DXXXXXXXXXXXXXX 0
DEBUG: Waiting for line [GNUPG:] GET_LINE keyedit.prompt
DEBUG: got line [GNUPG:] GET_LINE keyedit.prompt
DEBUG: Selecting UID 1
DEBUG: Waiting for ack
DEBUG: Waiting for line [GNUPG:] GOT_IT
DEBUG: got line [GNUPG:] GOT_IT
DEBUG: Running sign subcommand
DEBUG: Waiting for line [GNUPG:] GET_LINE keyedit.prompt
DEBUG: got line [GNUPG:] GET_LINE keyedit.prompt
DEBUG: Sending sign command
DEBUG: Waiting for line [GNUPG:] GOT_IT
DEBUG: got line [GNUPG:] GOT_IT
DEBUG: Waiting for response
DEBUG: Got [GNUPG:] KEY_CONSIDERED B8XXXXXXXXXXXXXXXXXXXXXXA6XXXXXXXXXXXXXX 0

DEBUG: Got KEY_CONSIDERED
DEBUG: Waiting for response
DEBUG: Got [GNUPG:] GET_BOOL sign_uid.okay

DEBUG: Confirming signing
DEBUG: Waiting for line [GNUPG:] GOT_IT
DEBUG: got line [GNUPG:] GOT_IT
DEBUG: Got [GNUPG:] ERROR keysig 67108881

  ERROR: Agent reported an error.

gpg-agent problems, bailing out!

My yubikey needs a touch for encryption and signing. It did not ask for such touch (running this command).

@jaymzh
Copy link
Owner

jaymzh commented May 24, 2023

Sorry I never responded to this. My guess is we'll have to do some extra work to support interaction-required key-storage. I would have thought that the agent would sorta handle that, but I guess not.

That said, with the DDOS's on the keyservers, and the significant disagreement between the gpg client developer and the new DDOS-resistant keyservers that have made using them near-impossible, I stopped using gpg to sign my email, and stopped running KSPs a few years back, and as such, haven't been very focused on PIUS. So changes of me addressing this soon are pretty low. I will, of course, be happy to help others who are interested in working on it, and I will review PRs in a timely fashion.

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

4 participants