Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[tinydtls-dev] Add a way to know who send data in read data callback


   Currently, in tinyDTLS there is a callback to handle decrypted packet received :

   int read_from_peer(struct dtls_context_t *ctx, session_t *session, uint8 *data, size_t len) 

   When you are using tinyDTLS as server, you would like to known from which you received data ?
   You can use session_t but the only information available is the peer address.
   Having access to DTLS identity would be relevant.
   DTLS identity would be like PSK identity for PSK, Public Key for RPK (if X509 was supported this would be Certificate/or Certchain)

    I made a modification about that in a branch[1], this is clearly a quick&dirty work just to ensure that it could work in my PoC [2].

    Olaf, do you think this make sense to add this to tinyDTLS ?
    What could be the good way to do ?
    In my modification, I add a new parameter dtls_handshake_parameters_t to read_from_peer. Maybe this is  not a good idea as it hold too many data ?
    So maybe adding a new type like dtls_identity_t (with union for psk/rpk) would be better ?
    Or directly add a new field in session_t ?

I hope it's not too confuse.


[1]: (see 2 last commit)

P.S : It seems to me there is no way in tinyDTLS git repository to do push force or delete a branch ?  For master I can understand this restriction, for other branches is it a bit too strict ?

Back to the top