-
Notifications
You must be signed in to change notification settings - Fork 2.7k
DTLS cookie verification failing using built-in cookie write/verify #1124
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
Comments
Hi @MrSurly, thanks for your inquiry! Did you capture a network dump to see which packets are being exchanged? The first Could you verify where your system's behavior deviates from the above expectation? Regards, |
@hanno-arm Thanks for the info. I'll revisit this when higher-priority issues have been resolved. I do know that handshake returns with I'll re-enable debugging, and get a full log. Packet sniffing will have to be via WiFi -- I'll look into how to do that. |
Hi @MrSurly |
I get the same behavior as described by #1124 (comment) See my Wireshark attached: |
@mbiuki For support questions, please post to the mailing list: https://lists.trustedfirmware.org/mailman/listinfo/mbed-tls |
I'm trying to make DTLS work in MicroPython for the ESP32. I've been using dtls_server.c and dtls_client.c as my template. Making this work in MicroPython is rather involved because of the layers of abstraction involved.
The good news: It works!
The bad news: Hello Verify does not work
At the moment, I simply call
mbedtls_ssl_conf_dtls_cookies
withNULL
for the callbacks to disable Hello Verify, and this works.It doesn't work when I use
mbedtls_ssl_cookie_write
andmbedtls_ssl_cookie_check
fromlibrary/ssl_cookie.c
I'm using the version of mbedtls (2.6.0) that's contained with the ESP IDF.
I traced it down to ssl_cookie.c line 219:
After adding instrumentation,
cookie_len
is 0, andCOOKIE_LEN
is 32.The actual question
Why is
cookie_len
zero?And that's were I'm stuck.
My code
My relevant changes to the MicroPython SSL wrapper are embedded:
https://github.com/MrSurly/micropython-esp32/blob/dev-dtls/extmod/modussl_mbedtls.c#L206
https://github.com/MrSurly/micropython-esp32/blob/dev-dtls/extmod/modussl_mbedtls.c#L223
I should note that I'm using a transport id of "abcdef" (for
mbedtls_ssl_set_client_transport_id
) since I don't yet have IP/PORT available to the SSL wrapper. This is only for testing, of a single connection, and I don't think it's relevant, since it need only be unique to the client, per the docs. Yeah, there's a memory leak there with the malloc =)The text was updated successfully, but these errors were encountered: