File tree Expand file tree Collapse file tree 1 file changed +3
-11
lines changed
Expand file tree Collapse file tree 1 file changed +3
-11
lines changed Original file line number Diff line number Diff line change @@ -24,22 +24,14 @@ func (m *Message) WriteTo(w io.Writer) (n int64, err error) {
2424 if n , encErr := messageEncryptionWriter .writeMessage (m ); encErr != nil {
2525 return n , encErr
2626 }
27- // wt, _ := pgp.Encrypt(&b, []string{"foo@bar.de"}, mockPublicProvider)
28- // wt.WriteTo(os.Stdout)
2927
3028 s , err := m .protectionWriter .GetEncryptedString ()
3129 if err != nil {
3230 return 0 , err
3331 }
3432
35- // create envelope
36- envelope := NewMessage ()
37- envelope .SetHeaders (m .header )
38- envelope .SetProtocol (m .protocol )
39- envelope .SetControlPart (m .protocol , m .controlBody )
40- envelope .SetProtectedPart (m .protectionType , s )
41-
42- return mw .writeMessage (envelope )
33+ n , err := w .Write ([]byte (s ))
34+ return int64 (n ), nil
4335 }
4436
4537 return mw .writeMessage (m )
@@ -54,7 +46,7 @@ func (w *messageWriter) writeMessage(m *Message) (int64, error) {
5446 }
5547 w .writeHeaders (m .header )
5648
57- if m .isSetProtocol () && ! m . isSecuredMIME () { // fetch the enveloped case
49+ if m .isSetProtocol () { // fetch the enveloped case
5850 mime := fmt .Sprintf ("encrypted;\r \n protocol=\" %s\" " , m .protocol )
5951 w .openMultipart (mime , m .boundary )
6052
You can’t perform that action at this time.
0 commit comments