Skip to content

Conversation

@chrysn
Copy link
Contributor

@chrysn chrysn commented Dec 21, 2020

This is extending #94 based on the tinydtls addition of #91.

It's as WIP as #94, and once #91 is merged, it makes sense to concentrate the efforts here: With two implementations it's clearer how HKDF can be built on either library's KDF.

chrysn and others added 24 commits January 14, 2020 10:54
Given that AES-CCM comes in various shapes and sizes, the function may
still need renaming (not sure whether it makes sense to have it
parametrized like AES-GCM), but the constants should be good.
... fixing failure to build with strict RIOT configurations.

Checking for <0 before casting to unsigned ensures that all cases are
covered; the compiler is invited to do any further optimization.
In scenarios where no signature algorithms are present (like when using
only a backend that can do AEAD), this prevents "unused parameter"
compiler errors.
Following the precendent in suit.c that already uses that condition.
Along with its Makefile, tinydtls also needs a minimal configuration
header as it might be output by a configure script (but its complexity
is low enough that a static file does just as well for our purposes, and
is much less of a hassle).

For AES-CCM, a single encrypt-decrypt test is run, based on the Packet
Vector 1 of <https://www.rfc-editor.org/rfc/rfc3610.html#section-8>.
Since the silkeh/clang images use Debian buster now, libgcc-6-dev is not
available any more; replacing with the latest that is.
Clang is a bit stricter when it comes to static arrays with the size of
a static const, replacing with defined expressions.

The removed allowed compiler warnings were only relevant to the older
released versions of tinydtls ("master") branch, which was never used in
a committed version of this port -- but the new ones are required for
Clang and do not disturb GCC operation.
The compatibility API's behavior changed in
eclipse-tinydtls/tinydtls#34; this picks the parameters
that work for AES-CCM-16-64-128.
in analogy to cose_crypto_is_aead
There is no need for a selector on this branch, but one is coming up.
@chrysn chrysn marked this pull request as draft December 21, 2020 14:48
@chrysn chrysn mentioned this pull request May 12, 2021
@chrysn
Copy link
Contributor Author

chrysn commented Dec 31, 2022

I think that with the additions that are now in already (AES-CCM through tinycrypt in #103, HKDF from #94), and given how much headache tinyDTLS has caused me (I don't have concrete points, only vague memories of their master branch being old and develop moving erratically, plus lots of workarounds in libCOSE), it's best to close this one unfinished. The cryptographic operations I need are in, and I see no need to add an extra backend just because.

@chrysn chrysn closed this Dec 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants