Update deps

This commit is contained in:
Frank Denis 2021-01-19 23:05:16 +01:00
parent fcd9225121
commit 213695f651
19 changed files with 657 additions and 67 deletions

View file

@ -1,4 +0,0 @@
sudo: false
language: go
go:
- 1.10.2

View file

@ -45,18 +45,22 @@ func DecodePublicKey(in string) (PublicKey, error) {
return NewPublicKey(lines[1])
}
func trimCarriageReturn(input string) string {
return strings.TrimRight(input, "\r")
}
func DecodeSignature(in string) (Signature, error) {
var signature Signature
lines := strings.SplitN(in, "\n", 4)
if len(lines) < 4 {
return signature, errors.New("Incomplete encoded signature")
}
signature.UntrustedComment = lines[0]
signature.UntrustedComment = trimCarriageReturn(lines[0])
bin1, err := base64.StdEncoding.DecodeString(lines[1])
if err != nil || len(bin1) != 74 {
return signature, errors.New("Invalid encoded signature")
}
signature.TrustedComment = lines[2]
signature.TrustedComment = trimCarriageReturn(lines[2])
bin2, err := base64.StdEncoding.DecodeString(lines[3])
if err != nil || len(bin2) != 64 {
return signature, errors.New("Invalid encoded signature")