lsalamon / nhin-d

Automatically exported from code.google.com/p/nhin-d
0 stars 0 forks source link

ContentTypeMismached bug #173

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. A client email send S/MIME with content type: application/pkcs7-mime; 
name=smime.p7m; smime-type=enveloped-data  

2. Direct received and throws Untrusted exception in the decryption step. It is 
in fact a ContentTypeMismatched exception. 

3. N/A

What is the expected output? What do you see instead?
A: Content Type should matched. But Direct throws UntrustedMessage exception, 
which is in fact a content type mismatched exception in the lower level. 

What version of the product are you using? On what operating system?
1.3, on Windows 

Please provide any additional information below.
I found the cause: 
In the code: org.nhindirect.stagent.mail.MimeEntity class, the 
verifyContentType method will compare the expected content type and parseType. 
It is expected S/MIME content type to be: EncryptedContentTypeHeaderValue, 
which is defined in  org.nhindirect.stagent.cryptography, and the value is: 
application/pkcs7-mime; name=smime.p7m; smime-type=enveloped-data

And the client send an email with content type: application/pkcs7-mime; 
smime-type=enveloped-data; name=smime.p7m

The content type is the same, only the parameter parts order is different. 

Perhaps the fix is to have the verifyContentType method to be more flexible. 

Original issue reported on code.google.com by zx...@health.state.ny.us on 25 Jan 2012 at 9:37

GoogleCodeExporter commented 9 years ago
Fixed in version agent-1.5.3.

Original comment by gm2...@cerner.com on 20 Nov 2012 at 3:38

GoogleCodeExporter commented 9 years ago
Verified while testing with NIST transport tools.

Original comment by gm2...@cerner.com on 20 Nov 2012 at 3:38

GoogleCodeExporter commented 9 years ago
Assigning owner

Original comment by gm2...@cerner.com on 20 Nov 2012 at 3:42