-
Notifications
You must be signed in to change notification settings - Fork 370
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
Issue with running Contiki-NG with latest release of Leshan (2.0.0-M15) #2255
Comments
@joakimeriksson do you have a dump of the packet exchange, especially the CLIENT_HELLO from the client? It would be easier to reproduce |
I will try to fix that later today. It is trivially "repeatable" by running the Contiki example also (with Leshan). But I will capture some pcap files for you - if that is what would be most useful? |
Yes, the main goal is to avoid having to install/build/run Contiki and try to unit-test this bug |
Thanks for reporting!
As jvermillard already wrote, captures would be very helpful. I guess, commit 332b8a3 2024-02-28 Reduce cookie data for better DTLS 1.3 compatibility. introduced that issue, but without capture, it's hard too see, why that fails. |
Just to mention: Any plans / interest to update to the current develop branch of eclipse/tinydtls? The contiki-ng fork of tinydtls seems to be not maintained. That fork is vulnerable by a couple of CVEs, which are fixed on the Eclipse origin fork. |
We are, in fact, replacing the TinyDTLS with mbedTLS at the moment, and that one triggered the problem first, so we assumed it was that - but then it was exactly the same with TinyDTLS. |
In general, there are some interoperability-tests for openssl, mbedtls, gnutls and tinydtls. But it seems, that these tests didn't cover your case. Therefore a capture would be great. |
Use COMPRESSION_METHODS_LENGTH_BITS instead of CIPHER_SUITES_LENGTH_BITS. Fixes issue eclipse-californium#2255 Signed-off-by: Achim Kraus <achim.kraus@cloudcoap.net>
Maybe I found the bug. See PR #2256 . (I'm currently too busy with other stuff. I'm not sure, if I find some time before the 2. week in July to really work on this. Afterward I will add some unit tests and try to reproduce the bug and verify the fix.) |
I can try to move this into the leshan demo server and see if it fix the issue. |
Use COMPRESSION_METHODS_LENGTH_BITS instead of CIPHER_SUITES_LENGTH_BITS. Skip SupportedSignatureAndHashAlgorithms list, if no certificate exchange is used. Add unit tests to verify fix of cookie generation. Fixes issue eclipse-californium#2255 Signed-off-by: Achim Kraus <achim.kraus@cloudcoap.net>
(I adapted my prios and added some unit tests. Without the fix, the new unit test fails with the above exception, with the fix it passes the test.) |
Here is a capture with the final packet here being the first DTLS package.
Will try to build with the update DTLS and put that into leshan to confirm if it works later also! |
Thanks. The ClientHello is without any Extensions. So the 2 bytes for the compression methods length instead of 1 bytes is wrong and so the calculated tail-length exceeds the message length. PR #2256 will fix it. Waiting for your feedback and then the PR will be merged soon. |
Tried building on a regular linux (ubuntu / java 19) but failed for some reason on the element connector. Do you now if there are any specific requirements?
|
I haven't tried java 19 so far. |
Do you have a docker setup? With all the correct versions of JDK, maven, etc? Or a description of the required build-environment? (I can do a retry over the weekend...) Or if you just send me the built-files. |
I will merge it and trigger a SNAPSHOT build in the afternoon. |
Use COMPRESSION_METHODS_LENGTH_BITS instead of CIPHER_SUITES_LENGTH_BITS. Skip SupportedSignatureAndHashAlgorithms list, if no certificate exchange is used. Add unit tests to verify fix of cookie generation. Fixes issue #2255 Signed-off-by: Achim Kraus <achim.kraus@cloudcoap.net>
3.13.0-SNAPSHOT including PR #2256 is available. The failing unit test indicates, that a "daemon thread group" isn't destroyed with the last thread. Not sure, maybe intended by java 19, maybe a timing question. The test was added some years ago to test and prevent from resource/heap leaks. If you run it with java 19 and you detect such a leak, it would be very welcome, if you could report that. My plan is still to switch to Californium 4 with java 8 as minimum requirement starting in summer. If java 19 comes with some extra requirements, I would prefer to move the support then to Californium version 4. |
I am having a hard time finding the assets here... How do I get hold of any of the built assets for the SNAPSHOT? (they are not in Maven repos, and I did not find the binaries on Jenkins - but I am not using Jenkins, so I am probably not sure where to look...). |
I did a quick replacement of the class (that seems to be built to exactly the same size as before?) but got the same error (copied from the SNAPSHOT jar into the M15 release jar). I guess I will need to be able to build everything to make things reasonably fast... Do you have a build environment in docker - then I could add some debugging? |
The SNAPSHOTS are not in maven, but in the eclipse repo. Just add that repo as described here: |
Though it works for you, could this issue be closed? |
Yes, absolutely. Now I only need to wait out the update to Leshan. Many thanks! |
@boaks do you think this issue deserve to lead to release a 3.13 soon ? (or maybe even a 3.12.1?) |
Currently my plans are a 3.13 minor release end of this month (July). Issue #2252 seems to be fixed as well with PR #2253, but I need to find some time for a couple of unit tests for that issue/PR. I would also like to use the release to publish an "auto-provisioning" feature for the cf-cloud-demo-server and the cf-s3-proxy-server. I will try to finish that work this month. If that fails, then I would go for a 3.13 without that new feature. |
Maybe it's anyway worth to enable the "recommended" extensions: RFC 5746 - Transport Layer Security (TLS) Renegotiation Indication Extension and that would be a "workaround" ;-). |
Thx for input. |
Use COMPRESSION_METHODS_LENGTH_BITS instead of CIPHER_SUITES_LENGTH_BITS. Skip SupportedSignatureAndHashAlgorithms list, if no certificate exchange is used. Add unit tests to verify fix of cookie generation. Fixes issue #2255 Signed-off-by: Achim Kraus <achim.kraus@cloudcoap.net>
I spent yesterday some time in the other bug/issue and prepared a solution without API change. Just in the case you want to do some tests and next Tuesday is too early, we can also shift the date. |
For tests, the "3.12.1-SNAPSHOT" is available at the eclipse repo. |
I tried to build Leshan with cf
It builds without issue. |
Thanks.
My idea was to give @joakimeriksson a chance to do a final test before I release CF 3.12.1. |
I tried to build a version of Leshan with 3.12.1 SNAPSHOT. (I tried to do that last Friday but face an issue : https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/issues/4781) |
Bugfix release 3.12.1 is available. |
DTLS Client Hello issue
The Contiki-NG LwM2M with DTLS can no longer join the Leshan server. It seems to be related to DTLS implementation (Scandium). Problem occurs already at the Client hello stage.
Error description
Contiki-NG LwM2M IPSO Objects example
When the client tries to join the server using DTLS there is an issue at the client hello stage:
It might be related to an update in the Scandium DTLS implementation that seems to have a change in the implementation of the client hello (including that specific line).
Information ahead to speed up the processing of issues - how to repeat the problem:
Likely possible to reproduce with any client using PSK and DTLS with our settings in contiki-ng's lwm2m example.
Run the leshan demo server locally then do the following in contiki-ng.
This will cause the problem.
The MAC call code update seems to have been changed by this commit and I assume that is in the current Leshan version (2.0.0-M15).
332b8a3
(but I can not spot any specific issues - just that this commit changed the code around where the error happens).
The text was updated successfully, but these errors were encountered: