Bug 638635 - gpg-agent fails to encode "iteration count" into private keys, thus never unprotects secret key
gpg-agent fails to encode "iteration count" into private keys, thus never unp...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: gnupg2 (Show other bugs)
6.0
All Linux
low Severity high
: rc
: ---
Assigned To: Tomas Mraz
Martin Žember
: Patch, Triaged
Depends On:
Blocks: 947782
  Show dependency treegraph
 
Reported: 2010-09-29 10:41 EDT by Tomas Mraz
Modified: 2015-07-13 00:14 EDT (History)
10 users (show)

See Also:
Fixed In Version: gnupg2-2.0.14-7.el6
Doc Type: Bug Fix
Doc Text:
Previously, the secret key management daemon for GnuPG, gpg-agent, failed to encode a new iteration count value when it created a new protected key or changed an existing key. As a consequence, the key could not be unprotected and gpg-agent thus did not properly interact with a number of programs that use key decryption, such as KMail or Kleopatra. With this update, the new iteration count is encoded properly and the decryption of keys created or modified by gpg-agent no longer fails.
Story Points: ---
Clone Of: 637414
Environment:
Last Closed: 2014-06-30 06:25:40 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Tomas Mraz 2010-09-29 10:41:12 EDT
+++ This bug was initially created as a clone of Bug #637414 +++

Description of problem:
gnupg2 2.0.14 has a known regression bug that in all cases where gpg-agent creates a new protected key or changes the protection fails to encode a new iteration count into the file.  Instead the old constant value of 65536 (encoded as 96) is written to the file.  If you then try to use the key and enter the passphrase, gpg-agent uses the wrong iteration count from the file (65536) and thus can't unprotect the key.

The end result is that one is unable to properly interact with gpg-agent.  Specifically kmail cannot s/mime sign email, kleopatra cannot decrypt previously encrypted files, and gpgsm decryption fails.

Described by Werner Koch (developer) @:
http://marc.info/?l=gnupg-users&m=126451730710129&w=2
Patch provided @:
ftp://ftp.gnupg.org/gcrypt/gnupg/patches/gnupg-2.0.14-encode-s2k.patch

Version-Release number of selected component (if applicable):
Fedora 13
gnupg2-2.0.14-6.fc13.i686
gnupg2-smime-2.0.14-6.fc13.i686

How reproducible:
Always
According to above post, happens whenever gpg-agent (version 2.0.14) is used.

Steps to Reproduce:
Assuming you have an existing gpgsm certificate pair.
1. Create random text file - trash.txt
2. gpgsm -r <your key id> -o trast.txt.gpg -e trash.txt
3. gpgsm -d trast.txt.gpg
  
Actual results:
passphrase input fails, secret key decryption failure, contents of trast.txt.gpg cannot be seen

Expected results:
contents of trast.txt.gpg decrypted

Additional info:
Applying provided vendor patch to 2.0.14-6 src rpm, rebuilding (via specfile updates), and upgrading gnupg2 installation corrects this issue.
Comment 1 RHEL Product and Program Management 2011-01-07 10:29:10 EST
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated
in the current release, Red Hat is unfortunately unable to
address this request at this time. Red Hat invites you to
ask your support representative to propose this request, if
appropriate and relevant, in the next release of Red Hat
Enterprise Linux. If you would like it considered as an
exception in the current release, please ask your support
representative.
Comment 3 Suzanne Yeghiayan 2012-02-14 18:03:43 EST
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated
in the current release, Red Hat is unfortunately unable to
address this request at this time. Red Hat invites you to
ask your support representative to propose this request, if
appropriate and relevant, in the next release of Red Hat
Enterprise Linux. If you would like it considered as an
exception in the current release, please ask your support
representative.
Comment 4 RHEL Product and Program Management 2012-09-07 00:59:04 EDT
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated
in the current release, Red Hat is unable to address this
request at this time.

Red Hat invites you to ask your support representative to
propose this request, if appropriate, in the next release of
Red Hat Enterprise Linux.
Comment 16 errata-xmlrpc 2014-06-30 06:25:40 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2014-0806.html

Note You need to log in before you can comment on or make changes to this bug.