Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[tinydtls-dev] ChangeCipherSpec and client_key_exchange problem

Hi,

I am testing tinydtls latest version from eclipse as Contiki application.
However, I do not have a complete handshake between a tinydtls server and client.

Server manages to find FOUND PEER but then it lose the peer as it is not able to interpret client_key_exchange sent by the client.

Debug messages show that SERVER prints "expected ChangeCipherSpec during handshake" whereas CLIENT keeps re-transmitting client_key_exchange (16) to the server.

Sometimes there is no crash but sometimes either the server or the client crashes after FOUND PEER and then if I restart the server or client to see if handshake gets complete, I have sequence no mismatch problem ( wrong epoch etc).
I found that this problem could arise when  ChangeCipherSpec message from server arrives out of order before client_key_exchange (16) is sent to the server. It was stated that cipher spec message should be stored in buffer before client key exchange could be sent.

Any idea how can I resolve this issue? I am testing only PSK.

SERVER 

dtls_handle_message: FOUND PEER
got packet 20 (14 bytes)
DEBG receive header: (13 bytes):
00000000 14 FE FD 00 00 00 00 00  00 00 06 00 01
DEBG receive unencrypted: (1 bytes):
00000000 01
expected ChangeCipherSpec during handshake
In udp_send
event timer!
node=0
node type:0, epoch:0, length:0

now:7978, node->t:0, node:0
now:7978 node:0

CLIENT 

In udp_found
found peer, try to re-connect
Client received message from aaaa::200:2f3c:c6b5:3:20220
dtls_handle_message: FOUND PEER
got packet 22 (25 bytes)
DEBG receive header: (13 bytes):
00000000 16 FE FD 00 00 00 00 00  00 00 04 00 0C
DEBG receive unencrypted: (12 bytes):
00000000 0E 00 00 00 00 02 00 00  00 00 00 00
received handshake packet of type: server_hello_done (14)
handle handshake packet of type: server_hello_done (14)
DEBG add MAC data: (12 bytes): 0E0000000002000000000000
DEBG add MAC data: (12 bytes): 100000110002000000000011
DEBG add MAC data: (17 bytes): 000F436C69656E745F6964656E74697479
send handshake packet of type: client_key_exchange (16)

Thanks
Priyanka

Back to the top