Commit Graph

14 Commits

Author SHA1 Message Date
Achim Kraus
f08802f93d dtls.c: add callback for peer specific selection of parameters as cipher
suites.

Adds dtls_user_parameters_t for these user parameters.

Signed-off-by: Achim Kraus <achim.kraus@cloudcoap.net>
2023-04-17 14:07:10 +02:00
Achim Kraus
004aba8f7a dtls.c: add cipher_suite_param_t
Use cipher_suite_param_t for cipher-suite specific mac_len and
key_exchange_algorithm. Introduce dtls_cipher_index_t for simplified
cipher-suite parameter lookup. Cleanup old functions.

Signed-off-by: Achim Kraus <achim.kraus@cloudcoap.net>
2023-04-01 10:29:04 +02:00
Jon Shallow
1e1edc0da6 doc: Correct Doxygen information
Dynamically build DoxygenLayout.xml to get the latest layout for the current
version of doxygen.

Update Doxyfile.in to the Ubuntu20 version.

Signed-off-by: Jon Shallow <supjps-libcoap@jpshallow.com>
2022-10-05 11:00:50 +02:00
Achim Kraus
3ed526d1e8 dtls.c: cleanup record_sequence_filter.
Reorder check and reuse record_sequence difference and drop duplicates
earlier.

Fixes: Issue #71

Signed-off-by: Achim Kraus <achim.kraus@bosch.io>
2022-02-04 09:57:19 +01:00
Achim Kraus
4e2f6a77fe crypto.h: correct documentation about overlapping of src and buf.
The implementation allows both, encrypt and decrypt, to use overlapping
src and buf.
Add missing documentation for src to dtls_decrypt_params.

Fixes: Issue #24

Signed-off-by: Achim Kraus <achim.kraus@bosch.io>
2021-12-10 07:46:04 +01:00
Jon Shallow
740589ecdc sha256: Better clarification of ec_keys that are in ASN.1 integer format
Rename dtls_ec_key_from_uint32_asn1() to dtls_ec_key_asn1_from_uint32()
to better describe what the function does, as well as add in the ASN.1
header defining it is a ASN.1 positive integer.

Rename dtls_asn1_integer_ec_key() to dtls_asn1_integer_to_ec_key to better
describe what it is actually doing.

Update dtls_add_ecdsa_signature_elem() to handle the updated
dtls_ec_key_asn1_from_uint32() function which now becomes more readable.

Signed-off-by: Jon Shallow <supjps-libcoap@jpshallow.com>
2021-06-22 11:57:51 +01:00
Jon Shallow
8e7c7d391c Add extended master secret support (RFC7627)
Needed to enable EC interopability with GnuTLS and Californium.

crypto.h:

Track extended_master_secret in dtls_handshake_parameters_t.

state.h:

Extended master secret hash info in dtls_hs_state_t.

global.h:

Add in #define for TLS_EXT_EXTENDED_MASTER_SECRET.

dtls.c:

Send out signature/hash algorithm in client hello so gnutls does not choose
SHA1. Verify signature/hash algorithm is supported in client hello.

Add in support for extended master secret as per RFC7627.

Allow server not to include client certificate type in server hello.

Define p before buf in stack so assert checking of buf overflow works.

Support servers that do not send back a hello verify request triggering
a second client hello.

Signed-off-by: Jon Shallow <supjps-libcoap@jpshallow.com>
2020-06-29 13:30:10 +01:00
Olaf Bergmann
d99fb8c4d9 crypto: Make key and nonce const for dtls_encrypt/decrypt
The key and nonce argument of the (deprecated) functions dtls_encrypt()
and dtls_decrypt() should be const as noted in [1]. This change requires
nonce also to be const in dtls_ccm_params_t.

[1] https://github.com/eclipse/tinydtls/issues/25

Closes #25

Change-Id: Ic6a0801d48eb88c726eee232c8971449c459be29
2020-01-14 10:24:31 +01:00
Olaf Bergmann
62f2e25463 crypto.h: Make DTLS_PSK_MAX_CLIENT_IDENTITY_LEN configurable
The maximum size for psk_indentity now can be changed during
build. Default is 32 bytes.

Change-Id: Id4c03f96c4fcad2dd942a9c84cef1fc15ad2da92
2019-10-02 23:15:21 +02:00
Olaf Bergmann
cbe1810f8c crypto.[hc]: Support encrypt/decrypt with parameters
The new functions dtls_encrypt_params() and dtls_decrypt_params()
provide an improved interface for AEAD crypto compared to
dtls_encrypt() and dtls_decrypt(). The former take a parameter
set of type dtls_ccm_params_t as first argument, containing the
nonce as well as the M and L values.

The new functions deprecate dtls_encrypt() and dtls_decrypt().

Change-Id: I4bded5da5c433b3192e361d70f23fa563399ae91
2019-10-02 23:06:52 +02:00
Jannis Konrad
62797ee85f check sequence Numbers of received messages
Signed-off-by: Jannis Konrad <jannis.Konrad@h-brs.de>
2017-02-28 05:29:55 -04: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
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