This repository was archived by the owner on Sep 11, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 530
This repository was archived by the owner on Sep 11, 2020. It is now read-only.
Message on signed tagged commits contains extra new line #1111
Copy link
Copy link
Closed
Description
The following code reads one extra new line past the PGP signature block and appends it to Message:
Lines 140 to 159 in 8c3c8b3
| for _, l := range messageAndSig { | |
| if pgpsig { | |
| if bytes.Contains(l, []byte(endpgp)) { | |
| t.PGPSignature += endpgp + "\n" | |
| pgpsig = false | |
| } else { | |
| t.PGPSignature += string(l) + "\n" | |
| } | |
| continue | |
| } | |
| // Check if it's the beginning of a PGP signature. | |
| if bytes.Contains(l, []byte(beginpgp)) { | |
| t.PGPSignature += beginpgp + "\n" | |
| pgpsig = true | |
| continue | |
| } | |
| t.Message += string(l) + "\n" | |
| } |
I am not sure what a proper fix is, but bailing out of the loop on this line instead of setting pgpsig = false seemed to correct the problem:
Line 144 in 8c3c8b3
| pgpsig = false |
We noticed this when trying to manually reconstruct the payload and verify the PGP signature.
Commit 8c3c8b3 seems to partially mask the problem.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels