DirectProject / nhin-d

The Direct Project reference implementations
http://wiki.directproject.org/Reference+Implementation+Workgroup
28 stars 36 forks source link

MirthMail Agent is not properly wrapping mail message signature #228

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Send direct message

What is the expected output? What do you see instead?

The base64 signature should have line breaks after the 75th character and 
instead there are no line breaks.

What version of the product are you using? On what operating system?

Gateway: 2.2 & 3.0.1
Agent: 1.6 / 2.0.1

Please provide any additional information below.

See RFC1341: 
http://www.w3.org/Protocols/rfc1341/5_Content-Transfer-Encoding.html and 
http://www.ietf.org/rfc/rfc1341.txt

----

Content-Type: application/pkcs7-signature; name=smime.p7s;
smime-type=signed-data
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

<SIGNATURE_DATA>

The <SIGNATURE_DATA> should be wrapped at 75 characters. Older versions of 
mirthmail properly did this, but the current release does not add any line 
breaks. This violates the email RFC, and at the very least, it prevents 
communication with NoMoreClipboard

Original issue reported on code.google.com by marc...@mirthcorp.com on 12 Dec 2013 at 11:33

GoogleCodeExporter commented 9 years ago
Would like to request that MirthMail be removed from the subject, apologies, I 
wrote this too quickly.

Original comment by marc...@mirthcorp.com on 13 Dec 2013 at 5:57

GoogleCodeExporter commented 9 years ago
Looking at:

org.nhindirect.stagent.cryptography.SMIMECryptographerImpl.createSignatureEntity
(byte[], Collection<X509Certificate>)

I am seeing this on line 584:

String encodedSig = Base64.encodeBase64String(signedData.getEncoded());

Pretty sure that needs to be:

byte[] binaryData = signedData.getEncoded();
String encodedSig = StringUtils.newStringUtf8(Base64.encodeBase64(binaryData, 
true));

Attaching a potential patch for Agent.

Original comment by marc...@mirthcorp.com on 16 Dec 2013 at 7:40

Attachments:

GoogleCodeExporter commented 9 years ago
Pretty sure it is 76 chars not 75.

Original comment by marc...@mirthcorp.com on 16 Dec 2013 at 8:08

GoogleCodeExporter commented 9 years ago
Has there been any status update to this?

Original comment by djunt...@mieweb.com on 24 Oct 2014 at 3:04

GoogleCodeExporter commented 9 years ago
Yes, I just added this fix today as part of the connect-a-thon.  It will go 
into agent-2.0.12 and go out into the Java RI 4.0 release (to be released in 
Feb 2015).

Original comment by gm2...@cerner.com on 22 Jan 2015 at 6:37