In general the handshake state machine forces the handshakes to go
through a defined order. But optional handshake message are not
controlled by that.
This fix introduces a optional handshake message field. This new
field enables the state-machine to check if this message
is (optionally) expected. When processed, the field is reset and
receiving the optional message twice will therefore fail the
handshake.
Fixes: Issue #78
Signed-off-by: Achim Kraus <achim.kraus@bosch.io>
Introduce a read_epoch to be used during the handshake.
Increment that, when the ccs is handled.
Drop received none matching records.
Signed-off-by: Achim Kraus <achim.kraus@bosch.io>
Use the record and message sequence numbers of that ClientHellos for
either sending a HelloVerifyRequest or starting the handshake on the
server side with sending a ServerHello.
To reduce the complexity, this stateless processing is separated in a
set of special functions, which use the new ephemeral_peer instead of
the old peer. The names of those function follow the pattern xxx_0_yyy
to indicate their usage in epoch 0.
Using a HelloRequest in epoch 0 is removed. If required, a
clarification about the processing details is required ahead.
Remove checks for peers and code/parameter, which have been used to
handle that missing peer.
(Fix some minor typos in comments and log messages.)
Signed-off-by: Achim Kraus <achim.kraus@bosch.io>
Fixes dtls_config.h not visible in headers
Include dtls_config.h in tinydtls.h and include tinydtls.h in all necessary
headers.
Remaining headers do not use 'ifdef', but they may require it too.
Change-Id: I39c86dffc8bbc8bd7551e74386994f92f49d00ec
Signed-off-by: Gaëtan Harter <gaetan.harter@inria.fr>
In contiki mode, without this 'peer.c' does not take the configuration into
account and 'dtls.c' and 'peer.c' have a different 'dtls_peer_t' definition.
Change-Id: I084b580bb1173a2bbf7f3a95d65b364b59706094
Signed-off-by: Gaëtan Harter <gaetan.harter@inria.fr>