GithubHelp home page GithubHelp logo

Comments (4)

kaleb-himes avatar kaleb-himes commented on May 28, 2024

Hi EILamparto,

Thank you so much for providing all the necessary debug information including the certificates. I was able to build/run the example using your cert and pwd. I can confirm the issue. If you turn on debugging you should get a log similar to this:

kalebs-MBP:pkcs12 khimes$ ./pkcs12-example 
extracting private key and certificate from PKCS12 (test-servercert.p12)
wolfSSL Entering wolfSSL_d2i_PKCS12_bio
wolfSSL Entering GetObjectId()
Found PKCS12 OBJECT: DATA
wolfSSL Entering GetObjectId()
wolfSSL Entering GetObjectId()
wolfSSL Entering GetAlgoId
wolfSSL Entering GetObjectId()
return value of d2i pkcs12 = 1 SUCCESS
wolfSSL Entering wc_PKCS12_parse
Parsing PKCS12 DATA Content Info Container
wolfSSL Entering GetObjectId()
PKCS12 Shrouded Key Bag found
wolfSSL Entering GetAlgoId
wolfSSL Entering GetObjectId()
wolfSSL Entering GetAlgoId
wolfSSL Entering GetObjectId()
Done Parsing PKCS12 Content Info Container
Decrypting PKCS12 Content Info Container
wolfSSL Entering GetObjectId()
wolfSSL Entering GetAlgoId
wolfSSL Entering GetObjectId()
Decryption failed, algorithm not compiled in?
return value of parsing pkcs12 = -154 FAIL
	 error parsing pkcs12

Since it was unable to identify which algorithm was used for encrypting that portion of the object I loaded this up into an online parser here: https://lapo.it/asn1js/

Here's what we see in part of the pk12 object:

SEQUENCE(2 elem)
Offset: 75
Length: 2+28
(constructed)
Value:
(2 elem)
OBJECT IDENTIFIER1.2.840.113549.1.12.1.6pbeWithSHAAnd40BitRC2-CBC(PKCS #12 PbeIds)

wolfSSL does not support RC2 unfortunately. If you check this blog post here you will notice we had a similar issue fairly recently:

https://www.wolfssl.com/forums/topic892-solved-does-wolf-support-pcks12-pfx-format.html

We do not currently support RC2, so encryption done with RC2 can not be decrypted by the API.

Is this something that is a requirement for you or are you able to use an alternate PKCS12 bundle?
If you need RC2 support please let us know and I can get you in touch with one of our business managers to discuss that feature addition!

Best Regards,

Kaleb

from wolfssl-examples.

ElLamparto avatar ElLamparto commented on May 28, 2024

Kaleb, thank you for your quick response.
Could you tell me, what encryption methods wolfSSL supports? I'll then try to get another version of the PKCS12...

from wolfssl-examples.

kaleb-himes avatar kaleb-himes commented on May 28, 2024

Hi EILamparto,

Happily! wolfSSL manual chapter 4 section 4.3.4 excerpt:

4.3.4 Block and Stream Ciphers

wolfSSL supports the AES, DES, 3DES, and Camellia block ciphers and the
RC4, RABBIT, HC-128 and CHACHA20 stream ciphers.

These may also be helpful if you are wondering about which hashing or public key algorithms wolfSSL also supports:
4.3.5 Hashing Functions
4.3.6 Public Key Options

I hope this is helpful.

Best Regards,

Kaleb

from wolfssl-examples.

ElLamparto avatar ElLamparto commented on May 28, 2024

Thank you very much for your analysis and help.

from wolfssl-examples.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.