Comments (4)
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.
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.
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.
Thank you very much for your analysis and help.
from wolfssl-examples.
Related Issues (20)
- ERROR: Failed to connect to wolfSSL HOT 1
- Camellia example HOT 2
- wc_ChaCha_Setkey return -173 despite following example HOT 1
- README.md typo HOT 3
- does wolfssl support tls connection establishment with client-secret-based and server-cert-based authentication? Thx HOT 5
- failed to build tls-sock-client HOT 3
- -lsgx_tstdcxx is deprecated
- wc_AesSetKey len parameter in aes-file-encrypt example HOT 4
- Build error after make command HOT 4
- Error: failed to load certificates HOT 5
- Generation of sphincs certificates HOT 2
- Espressif idf refuses to clean shared VisualGDB build directory
- Some TLS certificates expired HOT 2
- Update Espressif examples to use new "no setup" CMakeFiles.txt
- Unable to verify a certificate chain using certverify.c in certmangaer directory HOT 4
- Problem receiving messages on the dtls threaded server HOT 8
- Unable to run aesgcm-file-encrypt.c file HOT 3
- unable to run crypto/aes/aesgcm-file-encrypt HOT 1
- How to load more than one certificate HOT 4
- [DTLS] Problem processing queued client connections with multi-threaded server HOT 13
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wolfssl-examples.