Bug 841588
| Summary: | symmetric encryption exits with non-zero exit code | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Ondrej Moriš <omoris> |
| Component: | gnupg2 | Assignee: | Tomas Mraz <tmraz> |
| Status: | CLOSED DEFERRED | QA Contact: | BaseOS QE Security Team <qe-baseos-security> |
| Severity: | medium | Docs Contact: | |
| Priority: | high | ||
| Version: | 7.0 | CC: | rcritten |
| Target Milestone: | beta | Keywords: | Reopened |
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2016-09-02 12:12:51 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Bug Depends On: | |||
| Bug Blocks: | 1110706, 1191020 | ||
Reported upstream as https://bugs.g10code.com/gnupg/issue1427 Actually not a bug. The command line arguments do not make much sense. The proper line is: gpg2 --batch --passphrase password --output binary.msg.encrypted --cipher-algo 3DES --symmetric binary.msg The incorrect specification of --homedir is what causes the problem. (In reply to comment #2) > Actually not a bug. > > The command line arguments do nThis is confusing? ot make much sense. The proper line is: > > gpg2 --batch --passphrase password --output binary.msg.encrypted > --cipher-algo 3DES --symmetric binary.msg > > The incorrect specification of --homedir is what causes the problem. This is confusing - is "--homedir" prohibited in RHEL7? I do not want to use the default homedir on purpose. Moreover, this worked fine on RHEL6... You're right that with RHEL-6 it worked fine. But there was failure running agent as well just unreported in the exit code. I'll reopen the upstream bug report with more details. What works for me: 1. start the gpg-agent with the homedir specified as absolute path: gpg-agent --homedir $(pwd)/.gnupg --use-standard-socket --daemon 2. run gpg2 as you need gpg2 --homedir $(pwd)/.gnupg --batch --passphrase password --output binary.msg.encrypted --cipher-algo 3DES --symmetric binary.msg So there are 2 problems: 1. homedir must be absolute path not relative 2. homedir is not forwarded to the gpg-agent when it is started up by gpg2 Thanks a lot for this explanation, I have corrected my tests and they work now. Nevertheless, it would be nice to have both points you mentioned corrected even though they actually might not be "real" bugs. Let's see what the upstream will tell us. Well at least the item 2. from above is a real bug. The item 1. might be considered as missing feature. Unfortunately there is no reaction from upstream yet. *** Bug 884264 has been marked as a duplicate of this bug. *** Still no reaction from upstream https://bugs.g10code.com/gnupg/issue1427 |
Description of problem: Symmetric encryption in GnuPG2 exits with non-zero exit code (2) even though ecryption itself proceeds correctly (text is encrypted well). Whenever one tries to encrypt a text using a trusted key, the side-effect is as follows: gpg: can't connect to the agent: Invalid value passed to IPC gpg: problem with the agent: No agent running And exit code is 2. Asymmetric encryption / decryption works fine (exit code 0). Version-Release number of selected component (if applicable): gnupg2-2.0.18-3.el7 How reproducible: 100% Steps to Reproduce: gpg: can't connect to the agent: Invalid value passed to IPC gpg: problem with the agent: No agent running 1. Import some key into gnupg2 and make sure it is trusted 2. Encrypt some file, eg.: gpg2 --homedir ./.gnupg --batch --local-user bob-rsa-1024 --passphrase password --output binary.msg-rsa-1024-3DES --cipher-algo 3DES --symmetric binary.msg Actual results: gpg: can't connect to the agent: Invalid value passed to IPC gpg: problem with the agent: No agent running [exit code 2] Expected results: [exit code 0] Additional info: