From f8b3f214bfc9c08e7b4af9d1fd406573f5f28d9f Mon Sep 17 00:00:00 2001 From: Martin Date: Fri, 8 Nov 2024 08:42:10 +0100 Subject: [PATCH] Remove cleartext Encode header argument #239 (#240) --- openpgp/clearsign/clearsign.go | 2 +- openpgp/clearsign/clearsign_test.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/openpgp/clearsign/clearsign.go b/openpgp/clearsign/clearsign.go index 9d66e93a2..90bb9fc24 100644 --- a/openpgp/clearsign/clearsign.go +++ b/openpgp/clearsign/clearsign.go @@ -359,7 +359,7 @@ func (d *dashEscaper) Close() (err error) { // Encode returns a WriteCloser which will clear-sign a message with privateKey // and write it to w. If config is nil, sensible defaults are used. -func Encode(w io.Writer, privateKey *packet.PrivateKey, config *packet.Config, headers map[string]string) (plaintext io.WriteCloser, err error) { +func Encode(w io.Writer, privateKey *packet.PrivateKey, config *packet.Config) (plaintext io.WriteCloser, err error) { return EncodeMulti(w, []*packet.PrivateKey{privateKey}, config) } diff --git a/openpgp/clearsign/clearsign_test.go b/openpgp/clearsign/clearsign_test.go index 5d0396be4..0e93c8641 100644 --- a/openpgp/clearsign/clearsign_test.go +++ b/openpgp/clearsign/clearsign_test.go @@ -114,7 +114,7 @@ func TestSigning(t *testing.T) { for i, test := range signingTests { var buf bytes.Buffer - plaintext, err := Encode(&buf, keyring[0].PrivateKey, allowAllAlgorithmsConfig, nil) + plaintext, err := Encode(&buf, keyring[0].PrivateKey, allowAllAlgorithmsConfig) if err != nil { t.Errorf("#%d: error from Encode: %s", i, err) continue @@ -155,7 +155,7 @@ func TestSigningInterop(t *testing.T) { } var buf bytes.Buffer - plaintext, err := Encode(&buf, keyring[0].PrivateKey, nil, nil) + plaintext, err := Encode(&buf, keyring[0].PrivateKey, nil) if err != nil { t.Errorf("error from Encode") }