-
Notifications
You must be signed in to change notification settings - Fork 832
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TLS handshake fails for 4096 bit CA on ESP32s3 #6108
Comments
Hi @PaulMartinsen , Does defining Thanks, |
Also make sure |
Thanks for the suggestions @kareem-wolfssl & @dgarske . To my
Unfortunately the call to Incidentally, when I have the hardware acceleration on, it fails in
|
Hi @PaulMartinsen , Looks like ESP32 hardware acceleration is forcing on fast math. For fast math to support 4096-bit keys, please |
Connection succeeded to a server with a certificate signed by a 4096 bit CA when:
I will find a ESP32 to see what happens with the hw acceleration there. |
Oh. Thanks @kareem-wolfssl . I'll try that first. |
After adding |
I tested on the ESP32 and was able to connect using both software and hardware acceleration. I didn't need
I couldn't find any documentation for This also provided the clue to the underlying problem with the ESP32s3. On the ESP32, I received the warning: This bug wasn't detected by tests on that PR. So two extra questions:
|
@PaulMartinsen That's excellent you were able to resolve this. Good suggestion on the new test case. Perhaps that belongs in a separate issue? As for the handshake, do you actually mean SSL, or TLS (or TLS1.3) ? We have some client and server examples that could be used as a starting point. There are also some heavily-commented examples over in wolfssl-examples/ESP32, such as this enc28j60 wired ethernet. |
@gojimmypi , i meant that I found out about the bug by calling But the problem was caused by trying to use the hardware acceleration for keys larger than it supported. So a test case for this bug could just do that, without needing a client/server rig. Agree about making it a separate issue. I also found Thanks for your help @kareem-wolfssl , @dgarske , @gojimmypi , @BrianAker . Much appreciated. |
Hi @PaulMartinsen regarding your question:
I suppose everyone has their own preference, but I would just call it a "TLS1.3 connection", and in a technical written document, might even go as far as explicitly state what cipher suite(s) are used. Regarding #5950, note that I have another relatively large change in the One of the tips @dgarske gave me was regarding TLS1.3: if you can use that everywhere and exclusively, there would be benefits to turning off everything else. If you could please, go ahead and open a new issue regarding keys larger than supported. I see you also opened #6148 today, I'll take a look at that soon. Thanks for all your help and feedback. Cheers |
Version
5.5.4
Description
wolfSSL_connect
fails connecting to a server that supplies a certificate signed by a certificate authority that use a 4096 bit RSA key when running on ESP32s3 hardware (no hardware acceleration). The same connection completes successfully when running on:The failure occurs when
ParseCertRelative
inasn.c
callsConfirmSignature
, which returnsASN_SIG_CONFIRM_E
along the following path:ConfirmSignature
→wc_RsaSSL_VerifyInline
→RsaPrivateDecryptEx
→wc_RsaFunction_ex
→wc_RsaFunctionSync
→wc_RsaFunctionSync
(line 2797 in caseRSA_PUBLIC_DECRYPT
,RSA_PUBLIC_ENCRYPT
) when it callsmp_exptmod_nct
.wc_RsaFunctionSync
returnsMP_EXPTMOD_E
whenmp_exptmod_nct
fails, which gets translated intoASN_SIG_CONFIRM_E
further up the call-stack.mp_exptmod_nct
returnsMP_VAL
when it fails the test withm->used
= 128 andr->size
= 193:When running on Windows with the same trust chain,
m->used
= 128 andr->size
= 257 (so it doesn't fail).I attached my
user_settings.zip
configuration file. Notably, I'm not using hardware acceleration for this test.Is there some configuration I need to enable to support 4096 bit keys on embedded devices, or is this a bug or a known library limitation?
@gojimmypi
The text was updated successfully, but these errors were encountered: