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

GPG PINENTRY_LAUNCHED error when sources are deleted #4294

Closed
heartsucker opened this issue Mar 25, 2019 · 7 comments · Fixed by #4365
Closed

GPG PINENTRY_LAUNCHED error when sources are deleted #4294

heartsucker opened this issue Mar 25, 2019 · 7 comments · Fixed by #4365
Assignees
Milestone

Comments

@heartsucker
Copy link
Contributor

heartsucker commented Mar 25, 2019

Description

Deleting a source raises this error.

Exception in thread Thread-39:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 754, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/usr/local/lib/python2.7/dist-packages/pretty_bad_protocol/_meta.py", line 670, in _read_response
    result._handle_status(keyword, value)
  File "/usr/local/lib/python2.7/dist-packages/pretty_bad_protocol/_parsers.py", line 1024, in _handle_status
    raise ValueError("Unknown status message: %r" % key)
ValueError: Unknown status message: u'PINENTRY_LAUNCHED'

Steps to Reproduce

  • Start container
  • Start client
  • Delete source

Expected Behavior

No errors.

Actual Behavior

There are errors but the HTTP code is still 200, and the key is still deleted on the server side.

@eloquence eloquence added the bug label Apr 9, 2019
@kushaldas
Copy link
Contributor

I can see the same errors.

@redshiftzero
Copy link
Contributor

Background: I made this change 62bd71a such that secret keys would be properly deleted on Xenial (due to upstream issues with --pinentry-mode loopback and --delete-secret-keys)

redshiftzero added a commit that referenced this issue Apr 23, 2019
redshiftzero added a commit that referenced this issue Apr 23, 2019
@redshiftzero redshiftzero self-assigned this Apr 23, 2019
@redshiftzero redshiftzero changed the title GPG PINENTRY_LAUNCHED error in dev container GPG PINENTRY_LAUNCHED error when sources are deleted Apr 23, 2019
redshiftzero added a commit that referenced this issue Apr 23, 2019
redshiftzero added a commit that referenced this issue Apr 23, 2019
Mock internal python-gnupg method to generate ValueError from
the _handle_status method on DeleteResult
@kushaldas
Copy link
Contributor

If I install pinentry-gtk2 package on Xenial, then this error goes away. 🤕

@eloquence
Copy link
Member

eloquence commented Apr 23, 2019

@kushaldas Do you subsequently get the OSSEC alert described in #4362 after deleting a source?

@redshiftzero
Copy link
Contributor

If I install pinentry-gtk2 on Xenial on branch test-pinentry, the following happens:

  1. the web UI blocks when I delete a source
  2. (presumably) eventually the call to pinentry-gtk2 times out
  3. I still see the above ValueError: Unknown status message: u'PINENTRY_LAUNCHED'

it's worth noting that any attempt by gpg to launch a passphrase prompt is futile in this scenario as we don't have the source key passphrase stored directly anywhere (only the source does, we only have the hash)

@kushaldas
Copy link
Contributor

@kushaldas Do you subsequently get the OSSEC alert described in #4362 after deleting a source?

I saw the OSSEC logs (when I checked), but, just now we deleted another source, and this time no alert in OSSEC.

@emkll
Copy link
Contributor

emkll commented Apr 24, 2019

On an instance upgraded from Trusty to Xenial (one that has pinentry-gtk2 installed) this error does not appear in journalist logs on source deletion.

This bug appears to only affect instances that are using pinentry-curses (the Xenial default, which is present on Xenial clean installs)

EDIT: The error is not visible in logs due to #4362 : once the AppArmor profile is updated, the PINTENTRY_LAUNCHED error appears.

rmol pushed a commit to rmol/securedrop that referenced this issue Apr 24, 2019
to handle PINENTRY_LAUNCHED key

ref: freedomofpress#4294
(cherry picked from commit 745ca50)
rmol pushed a commit to rmol/securedrop that referenced this issue Apr 24, 2019
Mock internal python-gnupg method to generate ValueError from
the _handle_status method on DeleteResult

(cherry picked from commit 16ec570)
kushaldas pushed a commit that referenced this issue Sep 25, 2019
kushaldas pushed a commit that referenced this issue Sep 25, 2019
Mock internal python-gnupg method to generate ValueError from
the _handle_status method on DeleteResult
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants