Conversation
|
I also plan to implement Kconfig options for wolfssl and refactor common config options (e.g. DEBUG, PSK, ECC) under the sock DTLS Kconfig module but dependencies seem a bit complicated to define in Kconfig. Other than that, I think we need a general recommendation of which information should go in |
|
Great! Now that there are more than one implementations and the API has proven to be flexible enough for other stacks than tinydtls (does it?), it would also be great to have some kind of API tests, like we have in |
|
From the API perspective, I think From the OP:
Other than that, I would like to wait until the async part is implemented before I'm comfortable to say that the API is flexible enough. |
|
@leandrolanzieri @akshaim currently wolfssl defines pseudomodules to be used in its |
If we are currently using pseudomodules to enable/disable features, then this falls into the 'Module dependency modelling' part of Kconfig. This means that it would not be visible unless
Which configurations would be the common ones? I agree that the more we can factor out to a common DTLS config the better. |
What I have in mind right are enabling debug options, which cipher to enable, hanshake timeout. |
|
Is there something comparable to |
|
Closing since I don't have much time to look at this nowadays. Feel free to takeover this PR :) |
Contribution description
This PR implements the synchronous part DTLS sock API for wolfSSL. An async implementation will be done as a follow-up.
This PR also moves the existing sock_tls implementation provided by the wolfSSL team to its own directory under the contrib directory. sock_tls is a wrapper around wolfSSL functions to setup and destroys sessions when using wolfSSL directly. Although the similarity the name is similar, it is not related to the sock_dtls API.
Testing procedure
Use the
dtls-sockexample to test. Make sure that in the Makefile,USEPKG += wolfssland one ofUSEMODULE += wolfssl_pskorUSEMODULE += wolfcrypt_eccare uncommented. Try sending messages between client and server. The behavior should be the same as when using tinydtls apart from the issues mentioned below.Known Issues
I tried to make sure this implementation behaves as close as possible to the existing tinydtls implementation but there are some parts that are harder to do so:
dtls_timeout_init,dtls_timeout, anddtls_timeout_maxdtls_timeoutis set todtls_timeout_initat the start and multiplied by 2 each time the_recvcallback returns until it reachesdtls_timeout_maxwhere it will returntimeoutvalue of 1 second to listen to new connections, it might actually wait for more than that_recvcallbackSOCK_NO_TIMEOUTequivalent in wolfSSL which means the server might return an error when waiting for a long time even though timeout is set toSOCK_NO_TIMEOUT_recvcallback to listen to handshake packets after a new ClientHello is sent which is not the expected behavior of thesock_dtls_session_initfunctionUseful Links
Documentation of the wolfSSL API