File tree 2 files changed +5
-5
lines changed
2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 79
79
}
80
80
commit .Committer = sig
81
81
case "gpgsig" :
82
- verif , err := newVerificationFromCommitline (data [ nextline + spacepos + 1 :] )
82
+ verif , err := newVerificationFromCommitline (data , nextline + spacepos + 1 )
83
83
if err != nil {
84
84
return nil , err
85
85
}
Original file line number Diff line number Diff line change @@ -36,11 +36,11 @@ type Verification struct {
36
36
// -----END PGP SIGNATURE-----
37
37
// but without the "gpgsig " at the beginning
38
38
//
39
- func newVerificationFromCommitline (line []byte ) (_ * Verification , err error ) {
39
+ func newVerificationFromCommitline (data []byte , signatureStart int ) (_ * Verification , err error ) {
40
40
verif := new (Verification )
41
-
42
- signatureEnd := bytes .LastIndex (line , []byte ("-----END PGP SIGNATURE-----" ))
43
- verif .Signature = string (line [: signatureEnd + 27 ])
41
+ verif . Payload = string ( data [: signatureStart - 8 ])
42
+ signatureEnd := bytes .LastIndex (data , []byte ("-----END PGP SIGNATURE-----" ))
43
+ verif .Signature = string (data [ signatureStart : signatureEnd + 27 ])
44
44
45
45
return verif , nil
46
46
}
You can’t perform that action at this time.
0 commit comments