Commit Graph

15 Commits

Author SHA1 Message Date
Tobias Brunner 1b67166921 Unify format of HSR copyright statements 2018-05-23 16:32:53 +02:00
Tobias Brunner 896d729a60 libipsec: Add support for AES and Camellia in CCM mode
Fixes #2172.
2017-01-25 17:26:45 +01:00
Andreas Steffen b12c53ce77 Use standard unsigned integer types 2016-03-24 18:52:48 +01:00
Tobias Brunner 1f3a9fdde5 libipsec: Properly support CAMELLIA in CTR mode 2015-10-30 11:04:42 +01:00
Tobias Brunner 0e80127691 libipsec: Fix crypter lookup for AES-CTR
Due to the nonce, the ESP key material is four bytes longer than needed for
the actual AES key.  The crypto plugins, however, register their AES-CTR
implementations with the AES key length, so the lookup here failed.

For IKEv2 the key material is allocated after creating a crypter instance
with the negotiated AES key size.  The length of the actual key material is
retrieved via get_key_size(), which adds the four bytes to the AES key length.

Fixes #1124.
2015-10-30 10:54:45 +01:00
Martin Willi 19e0a71c73 libipsec: Create AEAD with four byte salt for ChaCha20-Poly1305 2015-06-29 17:32:13 +02:00
Martin Willi 3c81cb6fc3 aead: Create AEAD using traditional transforms with an explicit IV generator
Real AEADs directly provide a suitable IV generator, but traditional crypters
do not. For some (stream) ciphers, we should use sequential IVs, for which
we pass an appropriate generator to the AEAD wrapper.
2015-04-13 15:06:15 +02:00
Martin Willi e5d73b0dfa aead: Support custom AEAD salt sizes
The salt, or often called implicit nonce, varies between AEAD algorithms and
their use in protocols. For IKE and ESP, GCM uses 4 bytes, while CCM uses
3 bytes. With TLS, however, AEAD mode uses 4 bytes for both GCM and CCM.

Our GCM backends currently support 4 bytes and CCM 3 bytes only. This is fine
until we go for CCM mode support in TLS, which requires 4 byte nonces.
2014-03-31 15:56:12 +02:00
Tobias Brunner a4b996c0bc libipsec: Properly initialize variables when creating AEAD wrapper 2013-09-04 16:18:29 +02:00
Tobias Brunner 3f29ff82c3 libipsec: Don't limit traditional algorithms to AES and SHA1/2
Closes #377.
2013-08-12 12:21:57 +02:00
Tobias Brunner 051fc25d92 libipsec: Add support for AES-GCM 2013-05-03 15:13:57 +02:00
Tobias Brunner 24a8d1253f libipsec: Wrap traditional algorithms in AEAD wrapper 2013-05-03 15:13:57 +02:00
Tobias Brunner f05b427265 Moved debug.[ch] to utils folder 2012-10-24 16:00:51 +02:00
Tobias Brunner 55e05aa226 Include stdint.h for UINT32_MAX on FreeBSD 2012-08-29 15:32:26 +02:00
Tobias Brunner 64004973e3 Adding class to manage ESP context (crypto, sequence numbers) 2012-08-08 15:41:02 +02:00