Bug 123650

Summary: [PATCH] b64encode() doesn't like leading NUL (was 'tgpg' fails to check some packages)
Product: [Fedora] Fedora Reporter: Enrico Scholz <rh-bugzilla>
Component: beecryptAssignee: Paul Nasrat <nobody+pnasrat>
Status: CLOSED RAWHIDE QA Contact: Mike McLean <mikem>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: mattdm, mitr, wtogami
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 4.1.2-7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-05-17 18:36:46 UTC Type: ---
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: 123268, 136451    
Attachments:
Description Flags
Don't return "" for binary data starting with NUL none

Description Enrico Scholz 2004-05-19 20:09:06 UTC
Description of problem:

http://download.fedora.us/fedora/fedora/2/i386/RPMS.stable/lzo-1.08-0.fdr.2.2.i386.rpm
is signed correctly, but 'tgpg' fails because of a malformed CRC.

| # wget http://www.fedora.us/FEDORA-GPG-KEY
| # rpm --import FEDORA-GPG-KEY
| # gpg --import FEDORA-GPG-KEY
| # wget http://download.fedora.us/fedora/fedora/2/i386/RPMS.stable/lzo-1.08-0.fdr.2.2.i386.rpm
| # rpm -K lzo-1.08-0.fdr.2.2.i386.rpm
| lzo-1.08-0.fdr.2.2.i386.rpm: (sha1) dsa sha1 md5 gpg OK
| 
| # /usr/lib/rpm/tgpg lzo-1.08-0.fdr.2.2.i386.rpm 
| ...
| gpg: malformed CRC
| ...

I know some other rpms also:
2-stable/i386/graphviz-1.10-0.fdr.3.2.i386.rpm
2-stable/i386/lzo-1.08-0.fdr.2.2.i386.rpm
2-stable/i386/nethack-falconseye-1.9.4-0.fdr.4.a.1.90.i386.rpm


Btw, it would be nice when 'tgpg' could be used in scripts. E.g. be
more quietly and return a meaningful return code.



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

rpm-4.3.1-0.3

Comment 1 Matthew Miller 2005-04-26 16:00:01 UTC
Fedora Core 2 is now maintained by the Fedora Legacy project for
security updates only. If this problem is a security issue, please
reopen and reassign to the Fedora Legacy product. If it is not a
security issue and hasn't been resolved in the current FC3 updates or
in the FC4 test release, reopen and change the version to match.

Comment 2 Miloslav Trmač 2005-04-26 20:06:46 UTC
gnupg-1.4.1-1 handles the rpm armored output correctly,
but that looks like the two bugs cancelling each other.

The RPM output doesn't seem to be a valid ASCII armor,
beecrypt's fault.

Comment 3 Miloslav Trmač 2005-04-26 20:10:56 UTC
Created attachment 113689 [details]
Don't return "" for binary data starting with NUL

The attached patch (I'll send it upstream shortly) fixes b64encode().
The check for "" is invalid for binary data.  For NUL-terminated
data it is superfluous, the function does the right thing for zero-length
data anyway.

Paul, if you want me to build an updated package, just yell.

Comment 4 Paul Nasrat 2005-05-17 17:15:07 UTC
Mitr - if you could build a beecrypt with this in that'd be great.

Thanks