From d9a5f65e09d29eb1ea07d3c80689eb2b4c7a1ea9 Mon Sep 17 00:00:00 2001 From: Marek Goc Date: Sat, 22 Oct 2022 09:10:57 +0000 Subject: [PATCH] Update 'smime/smime.go' --- smime/smime.go | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/smime/smime.go b/smime/smime.go index bdc96bf..4761cef 100644 --- a/smime/smime.go +++ b/smime/smime.go @@ -1,6 +1,6 @@ -//Package smime implants parts of the S/MIME 4.0 specification rfc5751-bis-12. +// Package smime implants parts of the S/MIME 4.0 specification rfc5751-bis-12. // -//See https://www.ietf.org/id/draft-ietf-lamps-rfc5751-bis-12.txt +// See https://www.ietf.org/id/draft-ietf-lamps-rfc5751-bis-12.txt package smime import ( @@ -251,19 +251,19 @@ func (smime *SMIME) Sign(msg []byte) (signedMsg []byte, err error) { return } signedPart.SetHeaderField([]byte("Content-Type"), contentType[0]) - contentTransferEncoding := mail.GetHeaderField([]byte("Content-Transfer-Encoding")) - if len(contentType) == 1 { - signedPart.SetHeaderField([]byte("Content-Transfer-Encoding"), contentTransferEncoding[0]) - } - contentDisposition := mail.GetHeaderField([]byte("Content-Disposition")) - if len(contentType) == 1 { - signedPart.SetHeaderField([]byte("Content-Disposition"), contentDisposition[0]) - } + // contentTransferEncoding := mail.GetHeaderField([]byte("Content-Transfer-Encoding")) + // if len(contentType) == 1 { + // signedPart.SetHeaderField([]byte("Content-Transfer-Encoding"), contentTransferEncoding[0]) + // } + // contentDisposition := mail.GetHeaderField([]byte("Content-Disposition")) + // if len(contentType) == 1 { + // signedPart.SetHeaderField([]byte("Content-Disposition"), contentDisposition[0]) + // } // Sign lines := mime.ParseLines(signedPart.Full()) signatureDER, err := smime.CMS.Sign(lines.Bytes(mime.CRLF), true) - + // fmt.Println(signatureDER) // Encode signature signature := mime.MIME{}