STM32 NetXDuo not properly working when using ECDSA or TLS 1.3
Hello,
I have been trying to connect my STM32H573I-DK to our web server for some time now, unsuccessfully.
I am basing my secure application on the X-CUBE-AZURE-H5 Expansion Package project.
I can successfully run the example and connect (and publish) to Azure DPS.
The main issue I am facing is that there seem to be something wrong when using any cipher suite that isn't TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, despite them being defined and supported throughout the NetXDuo stack. This also happens to be the one cipher suite used to establish the connection with Azure in the example.
This cipher suite is considered to be weak and unsecure, hence our preference in using a different one.
We tried the following cipher suites, with no luck:
TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
Use GCM instead of CBC. This errors during the TLS handshake with "bad record MAC" (Authentication tag check failed)
TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
Use ECDSA and GCM (preferred TLS 1.2 method). This fails the TLS handshake with "client's Finished message is incorrect" (Invalid Finished verify data)
TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256
Use ECDSA instead of RSA, keep CBC. This fails the TLS handshake with "client's Finished message is incorrect" (Invalid Finished verify data)
We finally tried enabling TLS 1.3:
TLS_AES_128_GCM_SHA256
Use TLS 1.3 instead of TLS 1.2. This fails the handshake with "bad record MAC" (Message authentication failed)
From the above there appear to be two separate issues:
- Using ECDSA causes the client finished message to be built incorrectly
- Using GCM causes the authentication to fail
I now wonder whether there is a known issue with supporting the cipher suites above? Could it be somewhere that different algorithms are actually uses within the Secure Manager?
Was the choice of using an obsolete cipher suite in the Azure example deliberate for this reason?
It seems odd that we can't use any of the cipher suites deemed secure, can anyone help us solve this problem?
Many thanks,
Alex
