From b4370ded125dbac89ccd18c65ef274811edf1193 Mon Sep 17 00:00:00 2001 From: theexiile1305 Date: Wed, 9 Oct 2024 12:10:03 +0200 Subject: [PATCH] fix: micalg part of content-type --- encoding.go | 2 +- msgwriter_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/encoding.go b/encoding.go index 77243fc..dbe57ee 100644 --- a/encoding.go +++ b/encoding.go @@ -157,7 +157,7 @@ const ( MIMEAlternative MIMEType = "alternative" MIMEMixed MIMEType = "mixed" MIMERelated MIMEType = "related" - MIMESMime MIMEType = `signed; protocol="application/pkcs7-signature"; micalg=sha256` + MIMESMime MIMEType = `signed; protocol="application/pkcs7-signature"; micalg=sha-256` ) // String is a standard method to convert an Charset into a printable format diff --git a/msgwriter_test.go b/msgwriter_test.go index ca1a982..3466199 100644 --- a/msgwriter_test.go +++ b/msgwriter_test.go @@ -173,7 +173,7 @@ func TestMsgWriter_writeMsg_SMime(t *testing.T) { mw := &msgWriter{writer: &buf, charset: CharsetUTF8, encoder: mime.QEncoding} mw.writeMsg(m) ms := buf.String() - if !strings.Contains(ms, `multipart/signed; protocol="application/pkcs7-signature"; micalg=sha256;`) { + if !strings.Contains(ms, `multipart/signed; protocol="application/pkcs7-signature"; micalg=sha-256;`) { t.Errorf("writeMsg failed. Expected PGP encoding header but didn't find it in message output") } }