Commit Graph

7 Commits

Author SHA1 Message Date
Achim Kraus
40d863c115 dtls.c: Check for optional handshake messages
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>
2021-12-08 10:11:06 +01:00
Achim Kraus
181330b4ab Fix processing received records of wrong epoch.
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>
2021-10-04 21:05:54 +02:00
Achim Kraus
c21c46c209 Add separate stateless processing for ClientHello of epoch 0.
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>
2021-09-30 19:19:54 +02:00
Gaëtan Harter
c9adbab655 tinydtls.h: include dtls_config.h in tinydtls.h
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>
2017-02-27 18:05:10 +01:00
Gaëtan Harter
091d134599 peer.h: include 'dtls_config.h' to have 'DTLS_PEERS_NOHASH' defined
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>
2017-02-27 18:05:10 +01:00
Olaf Bergmann
ae385945ed fixed function prototypes to shutup compiler warnings 2016-04-22 14:09:51 +02:00
Olaf Bergmann
e1388b3980 New initial commit 2016-02-02 18:39:21 +01:00