-
Notifications
You must be signed in to change notification settings - Fork 424
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
Platform specific support for random number generation #313
Comments
@jitin17 How are you planning to add in tinydtls? In answer to your question, an updated prng.h in tindtls/port/include should be all that is needed to handle what you are trying to do. |
@mrdeep1 I suppose The problem I am facing is in
This doesn't work in ESP-IDF, which provides If my understanding is correct, then to solve issues like these we need platform-dependent sub tree illustrated in this PR: #6. |
Ah - I had not appreciated that the It may be that we just have to add a modified version of dtls.c to coap/port directory. I will take a look at this. Certainly platform dependent trees may be the way to go - there are to many #ifdefs in the code as it is. |
@jitin17 For TinyDTLS, this is a work in progress to create some more platform independent code. |
This is great. But I think there is a need to include |
You are correct. I discovered that when I went back to build things that were using all the latest code. I am shortly (probably tomorrow morning if all goes well) about to push a PR request for https://github.com/mrdeep1/esp-idf/pull/new/libcoap-tinydtls which has DTLS enabled within libcoap. If you could test this code out, it would be great as I do not have a ESP-IDF test environment. You will need to make the URI for the coap_client something like coaps://127.0.0.1/Espressif to make it do DTLS. |
@mrdeep1 Hey, any updates on raising a PR in esp-idf? |
@jitin17 When testing code (thanks @leenowell as I do not have a esp-idf test environment), it highlighted a couple of issues - the primary one being the excessive use of stack - in particular when logging is enabled - and there is a constrained stack with esp-idf. There was a secondary issue where "WARN dtls_send_to_peer: cannot find local interface" was getting reported. The constrained stack and handling the consequences of fixing "WARN dtls_send_to_peer: cannot find local interface" have been fixed in tinydtls, and the code committed, but am waiting for libcoap to have the code version updated for the submodule tinydtls to get in the new changes. There is a code fix for constrained stack in the libcoap code, but that has not been accepted yet. When the git submodule tinydtls code version is updated and the constrained stack PR is accepted, then it makes sense to get this fixed code into esp-idf. |
Looking at the constrained stack PR right now, will do the tinydtls submodule update immediately... |
Code fix has been pushed to espressif/esp-idf#3345 . |
I tried to test your code, but unfortunately, I did not succeed. |
@ghorbanis Can you please try again with a clean clone? |
@mrdeep1 Yes, It worked fine. |
Currently, I am adding support for
tinydtls
inlibcoap
in ESP_IDF. I don't see platform specific layer to add support for random number generation, as ESP_IDF uses an internal API to do so.The text was updated successfully, but these errors were encountered: