change the way to get keys
Status: Alpha
Brought to you by:
obgm
I will talk about the PSK issue but there are the same issue for ECC.
Currently, to pass the key from user code to tinyDTLS, we must use the :
get_psk_key from dtls_handler_t.
The current implementation force user to store the key in a static way.
There are 2 problems for me with this :
So a better implementation could be that tinyDTLS allocate memory for the key, then call the get_psk_key which will fill the struct, then with a memset clean the memory.
I completely agree with your concerns and will fix this as suggested.
This is fixed for PSK in commit 046f9d62. To save some overhead, the psk_hint and psk are now retrieved independent from each other. dtls_psk_key_t is now obsolete and has been removed in 1fba423.
For ECC, this is a bit more difficult hence the bug is not yet closed.
Thx Olaf, I just integrate it now.
(off topic, but could you add ".project" entry to .gitignore as I can open tiny dtls in eclipse CDT)