Bug 510500 - gpg invalid packet error decrypting certain files
Summary: gpg invalid packet error decrypting certain files
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: gnupg
Version: 4.8
Hardware: All
OS: Linux
urgent
urgent
Target Milestone: rc
: ---
Assignee: Tomas Mraz
QA Contact: Ondrej Moriš
URL: https://bugs.g10code.com/gnupg/issue537
Whiteboard:
Depends On: 510503
Blocks: 592845
TreeView+ depends on / blocked
 
Reported: 2009-07-09 14:26 UTC by Casey Dahlin
Modified: 2018-12-01 16:53 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 510503 (view as bug list)
Environment:
Last Closed: 2012-06-14 20:58:15 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Reproducer (Top level of tar is NOT A DIRECTORY. Unpack carefully) (12.04 KB, application/x-gzip)
2009-07-09 14:26 UTC, Casey Dahlin
no flags Details
tweaked version of patch from https://bugs.g10code.com/gnupg/issue537 (4.55 KB, patch)
2009-07-22 17:33 UTC, Nalin Dahyabhai
no flags Details | Diff

Description Casey Dahlin 2009-07-09 14:26:27 UTC
Created attachment 351077 [details]
Reproducer (Top level of tar is NOT A DIRECTORY. Unpack carefully)

Description of problem:
Decrypting certain data (length of message seems to be the determining factor) causes this error message:

gpg: [don't know]: invalid packet (ctb=14)

This patch seems to fix it for the customer:
http://lists.gnupg.org/pipermail/gnupg-devel/2006-September/023180.html

Version-Release number of selected component (if applicable):
gnupg-1.2.6-9

How reproducible:
Always

Steps to Reproduce:
1. Unpack the attached tar in a new folder
2. Run:
echo foobar | gpg -d --passphrase-fd 0 --homedir dot.gnupg --yes -o 2019.dat 2019.dat.gpg
  
Actual results:
Error message

Expected results:
The file is decrypted

Additional info:
Customer claims this also reproduces on RHEL 3 and 5. In the case of RHEL 5, I will clone the bug if I can reproduce it myself.

Comment 1 Nalin Dahyabhai 2009-07-13 18:29:51 UTC
The patch used in 1.4.6 ended up being a bit different; we should use that one instead.  Has a bit of overlap with changes to fix CVE-2006-6235, so needs a bit of adjusting.

Comment 2 Casey Dahlin 2009-07-22 14:24:27 UTC
Could you point me to the actual patch? I'd like to get a test rpm to the customer.

Comment 3 Nalin Dahyabhai 2009-07-22 17:33:38 UTC
Created attachment 354751 [details]
tweaked version of patch from https://bugs.g10code.com/gnupg/issue537

This is more or less the patch I was thinking of.  Except for the hunk which updates the copyright, which are different between 1.2.6 and 1.4.5, it should apply without trouble.

Comment 12 Tomas Mraz 2010-05-14 16:03:04 UTC
Committed to the RHEL-4 trunk CVS.

Comment 14 Ondrej Moriš 2010-05-25 09:27:17 UTC
RHTS test proposed (see QA whiteboard).

Comment 15 Ondrej Moriš 2010-05-25 09:30:47 UTC
Before (gnupg-1.2.6-9):

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   LOG    ] :: Test
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   FAIL   ] :: Running 'echo foobar | gpg -d --passphrase-fd 0 --homedir 
     dot.gnupg --yes -o 2019.dat 2019.dat.gpg 1>out 2>&1' (Expected 0, got 2)
:: [   FAIL   ] :: File 'out' should not contain 'invalid packet' 
:: [   LOG    ] :: Duration: 0s
:: [   LOG    ] :: Assertions: 0 good, 2 bad
:: [   FAIL   ] :: RESULT: Test

After (gnupg-1.2.6-9.el4_8.1)

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   LOG    ] :: Test
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   PASS   ] :: Running 'echo foobar | gpg -d --passphrase-fd 0 --homedir 
                   dot.gnupg --yes -o 2019.dat 2019.dat.gpg 1>out 2>&1'
:: [   PASS   ] :: File 'out' should not contain 'invalid packet'
:: [   LOG    ] :: Duration: 0s
:: [   LOG    ] :: Assertions: 2 good, 0 bad
:: [   PASS   ] :: RESULT: Test


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