Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[tinydtls-dev] Debugging the TinyDTLS with session_t and data-app modified


I have been toying with TinyDTLS and RIOT OS (and free-source OS that each day is more close to Contiki's quality) and wanted to make a question about a issue I'm having. 

I have been  making small changes to TinyDTLS's code at my fork,  probably the most relevant to my question  is this commit [3].  The session_t is modified for supporting the structures of GNRC (RIOT tries to avoid to use sockets) [2], and the ctx->App-data is receiving a single string with the IPv6 addresses. 

The client side is in [4], it is still not complet, due that I was trying to generate  only the first Client Hello message. Thus the dtls_handle_read() is not implemented (and the server only prints what receives).  When I run the code,  the Client Hello message is unable to be send with the following  TinyDTLS debug messages:

Apr 11 18:45:41 DEBG DTLSv12: initialize HASH_SHA256
Apr 11 18:45:41 DEBG send handshake packet of type: client_hello (1)
Apr 11 18:45:41 DEBG send header: (13 bytes):
00000000 16 FE FD 00 00 00 00 00  00 00 00 00 34
Apr 11 18:45:41 DEBG send unencrypted: (12 bytes):
00000000 01 00 00 28 00 00 00 00  00 00 00 28
Apr 11 18:45:41 DEBG send unencrypted: (40 bytes):
00000000 FE FD 00 00 00 00 CE 37  24 7B 07 7B 7F C2 D9 9C
00000010 19 B7 2A 10 DB 6F 60 49  52 36 77 69 15 3F CF 65
00000020 A0 39 00 00 00 00 01 00 
Apr 11 18:45:41 WARN cannot send ClientHello 4
Apr 11 18:45:41 DEBG found peer, try to re-connect

I was trying to track the problem: One the dtls_connect is invoked, everything seems to be OK  until reaching the CALL inside of the  dtls.c: dtls_send_multi() function. Yet,   I'm not sure if the operation returning -1 at this point  is correct or  I screwed something  in session.c, when was updating  the define clause for _dtls_address_equals_impl

Another question,  related to the TinyDTLS machine states. TinyDTLS will update that requires to send something with "try_send" but this should be triggering the  
send_to_peer right ?  And is there when the messages will be sent. 

Maybe someone in this channel, can give some hints about what I could be  missing.

Sincerely, Raul Fuentes

Back to the top