Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 541f2be

Browse files
authored
Fix md5 checksum for big RPMs (#34)
1 parent b2e876b commit 541f2be

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

signature.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,12 @@ func MD5Check(r io.Reader) error {
144144
if err != nil {
145145
return err
146146
}
147-
payloadSize := sigheader.GetTag(1000).Int64() // RPMSIGTAG_SIZE
147+
payloadSize := sigheader.GetTag(270).Int64() // RPMSIGTAG_LONGSIGSIZE
148148
if payloadSize == 0 {
149-
return errorf("tag not found: RPMSIGTAG_SIZE")
149+
payloadSize = sigheader.GetTag(1000).Int64() // RPMSIGTAG_SIGSIZE
150+
if payloadSize == 0 {
151+
return fmt.Errorf("tag not found: RPMSIGTAG_SIZE")
152+
}
150153
}
151154
expect := sigheader.GetTag(1004).Bytes() // RPMSIGTAG_MD5
152155
if expect == nil {

0 commit comments

Comments
 (0)