Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
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:
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.
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: