diff options
author | Tobias Brunner <tobias@strongswan.org> | 2015-10-23 14:34:54 +0200 |
---|---|---|
committer | Tobias Brunner <tobias@strongswan.org> | 2015-11-09 11:09:18 +0100 |
commit | f6083d350cc515e073e6223cb6b36694f5422bc2 (patch) | |
tree | fe9bd13d4a47f856817e91f1d88323723085b3bf /src/libstrongswan | |
parent | 403acf8614e4e78b976f2da5fdf72dfc10fa9556 (diff) | |
download | strongswan-f6083d350cc515e073e6223cb6b36694f5422bc2.tar.bz2 strongswan-f6083d350cc515e073e6223cb6b36694f5422bc2.tar.xz |
iv-gen: Use NULL IV generator for NULL encryption
We don't need an IV for NULL encryption, so we wouldn't technically need
an IV generator. But some of the code currently relies on an IV
generator to be present. So we don't have to change that code and
handle IV size == 0 specially we use the new NULL IV generator, which
handles this transparently to the existing code.
Before 3c81cb6fc322 ("aead: Create AEAD using traditional transforms
with an explicit IV generator") iv_gen_rand_t was used for NULL
encryption, which would work too but this way it's clearer.
Diffstat (limited to 'src/libstrongswan')
-rw-r--r-- | src/libstrongswan/crypto/iv/iv_gen.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libstrongswan/crypto/iv/iv_gen.c b/src/libstrongswan/crypto/iv/iv_gen.c index 7d6570a74..c70627723 100644 --- a/src/libstrongswan/crypto/iv/iv_gen.c +++ b/src/libstrongswan/crypto/iv/iv_gen.c @@ -1,4 +1,7 @@ /* + * Copyright (C) 2015 Tobias Brunner + * Hochschule fuer Technik Rapperswil + * * Copyright (C) 2015 Martin Willi * Copyright (C) 2015 revosec AG * @@ -16,6 +19,7 @@ #include "iv_gen.h" #include "iv_gen_rand.h" #include "iv_gen_seq.h" +#include "iv_gen_null.h" /** * See header. @@ -52,6 +56,7 @@ iv_gen_t* iv_gen_create_for_alg(encryption_algorithm_t alg) case ENCR_NULL_AUTH_AES_GMAC: return iv_gen_seq_create(); case ENCR_NULL: + return iv_gen_null_create(); case ENCR_UNDEFINED: case ENCR_DES_ECB: case ENCR_DES_IV32: |