Fix retransmission according to RFC
tinyDTLS does not satisfy RFC (https://tools.ietf.org/html/rfc6347):
1. "Partial reads (whether partial messages or only some of the messages
in the flight) do not cause state transitions or timer resets.
2. "In addition, for at least twice the default MSL defined for [TCP],
when in the FINISHED state, the node that transmits the last flight
(the server in an ordinary handshake or the client in a resumed
handshake) MUST respond to a retransmit of the peer's last flight"
List of changes:
1. Changed 'dtls_stop_retransmission' function. It clears timer only.
Needed to save server's last flight in retransmission buffer.
2. Added 'dtls_start_retransmission' function. It can resume the
retransmission after 'dtls_stop_retransmission'.
Needed for responding to the client's last flight in FINISHED state.
3. New function 'dtls_clear_retransmission' clears retransmission buffer
instead of 'dtls_stop_retransmission'.
4. Disabled clearing retransmission buffer in case of partial flight
in 'handle_handshake_msg' function.
5. Added answering HELLO_VERIFY_REQUEST if client retransmit CLIENT_HELLO
in 'handle_handshake_msg' function.
Change-Id: Ief775733e52a0e5f2e663b0317ed3f922bd92629
Signed-off-by: Dmitriy Zhuravlev <d.zhuravlev@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/8371
Reviewed-by: Craig Pratt <craig@ecaspia.com>
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Randeep Singh <randeep.s@samsung.com>