sergiosorias / jscep

Automatically exported from code.google.com/p/jscep
MIT License
0 stars 0 forks source link

Wrong cipher name in AlgorithmDictionary #17

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

When using jSCEP to parse an iPhone-generated POST to ScepServlet, 
PkcsEnvelopeParser chokes when looking up the "3DES" algorithm, throwing an 
Exception indicating that the cipher "3DES//CBC/PKCS5Padding" can't be 
supported (or found).

What is the expected output? What do you see instead?
ScepServlet should be able to successfully parse the POST contents.

What version of the product are you using? On what operating system?
iPhone 3.1.2 (client); Mac OS X Snow Leopard + Java 6 (server).

Please provide any additional information below.

The following representative test code (lightly modified from ScepServlet) will 
reproduce the error:

        byte[] post = getTestFile("9_scep-PKIOperationPost-withChallenge");
        ContentInfo contentInfo = ContentInfo.getInstance(ASN1Object.fromByteArray(post));
        PkiMessageParser msgParser = new PkiMessageParser();
        msgParser.setPrivateKey(messenger.scepKey);
        PkiMessage msg = msgParser.parse(contentInfo);

        MessageType msgType = msg.getMessageType();
        ASN1Encodable msgData = msg.getPkcsPkiEnvelope().getMessageData();

        if (msgType == MessageType.PKCSReq) {
            final PKCS10CertificationRequest certReq = new PKCS10CertificationRequest(msgData.getEncoded());
....

To resolve this issue, line 73 of AlgorithmDictionary can be changed as follows:

contents.put(SMIMECapabilities.dES_EDE3_CBC, "DESede/CBC/PKCS5Padding"); // 
DESEDE

Note the "DESede" instead of "3DES" (as it is now).

I haven't attached the JKS private key used to decrypt the enveloped content, 
but can do that out-of-band if needed (these are test certs, after all).

Patch file attached.

Original issue reported on code.google.com by andrew.r...@gmail.com on 28 Aug 2010 at 4:04

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks for the patch!

Original comment by davidgrant41 on 2 Nov 2010 at 4:11

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r988.

Original comment by davidgrant41 on 2 Nov 2010 at 4:15

GoogleCodeExporter commented 9 years ago

Original comment by da...@grant.org.uk on 13 Jul 2011 at 6:37

GoogleCodeExporter commented 9 years ago

Original comment by da...@grant.org.uk on 13 Jul 2011 at 6:43

GoogleCodeExporter commented 9 years ago

Original comment by da...@grant.org.uk on 21 Aug 2012 at 12:06