crypto/signify, build: fix archive signing with signify (#21977)

This fixes some issues in crypto/signify and makes release signing work.

The archive signing step in ci.go used getenvBase64, which decodes the key data.
This is incorrect here because crypto/signify already base64-decodes the key.
This commit is contained in:
Felix Lange
2020-12-09 15:43:36 +01:00
committed by GitHub
parent 915643a3e5
commit f935b1d542
4 changed files with 65 additions and 81 deletions

View File

@ -52,7 +52,7 @@ func TestSignify(t *testing.T) {
t.Fatal(err)
}
err = SignifySignFile(tmpFile.Name(), tmpFile.Name()+".sig", testSecKey, "clé", "croissants")
err = SignFile(tmpFile.Name(), tmpFile.Name()+".sig", testSecKey, "clé", "croissants")
if err != nil {
t.Fatal(err)
}
@ -96,7 +96,7 @@ func TestSignifyTrustedCommentTooManyLines(t *testing.T) {
t.Fatal(err)
}
err = SignifySignFile(tmpFile.Name(), tmpFile.Name()+".sig", testSecKey, "", "crois\nsants")
err = SignFile(tmpFile.Name(), tmpFile.Name()+".sig", testSecKey, "", "crois\nsants")
if err == nil || err.Error() == "" {
t.Fatalf("should have errored on a multi-line trusted comment, got %v", err)
}
@ -121,7 +121,7 @@ func TestSignifyTrustedCommentTooManyLinesLF(t *testing.T) {
t.Fatal(err)
}
err = SignifySignFile(tmpFile.Name(), tmpFile.Name()+".sig", testSecKey, "crois\rsants", "")
err = SignFile(tmpFile.Name(), tmpFile.Name()+".sig", testSecKey, "crois\rsants", "")
if err != nil {
t.Fatal(err)
}
@ -146,7 +146,7 @@ func TestSignifyTrustedCommentEmpty(t *testing.T) {
t.Fatal(err)
}
err = SignifySignFile(tmpFile.Name(), tmpFile.Name()+".sig", testSecKey, "", "")
err = SignFile(tmpFile.Name(), tmpFile.Name()+".sig", testSecKey, "", "")
if err != nil {
t.Fatal(err)
}