summaryrefslogtreecommitdiff
path: root/src/libipsec
diff options
context:
space:
mode:
authorYves-Alexis Perez <corsac@debian.org>2015-06-01 14:46:30 +0200
committerYves-Alexis Perez <corsac@debian.org>2015-06-01 14:46:30 +0200
commitfc556ec2bc92a9d476c11406fad2c33db8bf7cb0 (patch)
tree7360889e50de867d72741213d534a756c73902c8 /src/libipsec
parent83b8aebb19fe6e49e13a05d4e8f5ab9a06177642 (diff)
downloadvyos-strongswan-fc556ec2bc92a9d476c11406fad2c33db8bf7cb0.tar.gz
vyos-strongswan-fc556ec2bc92a9d476c11406fad2c33db8bf7cb0.zip
Imported Upstream version 5.3.1
Diffstat (limited to 'src/libipsec')
-rw-r--r--src/libipsec/esp_context.c9
-rw-r--r--src/libipsec/ipsec_sa_mgr.c2
2 files changed, 9 insertions, 2 deletions
diff --git a/src/libipsec/esp_context.c b/src/libipsec/esp_context.c
index 5e58f66da..a2307e048 100644
--- a/src/libipsec/esp_context.c
+++ b/src/libipsec/esp_context.c
@@ -244,6 +244,7 @@ static bool create_traditional(private_esp_context_t *this, int enc_alg,
{
crypter_t *crypter = NULL;
signer_t *signer = NULL;
+ iv_gen_t *ivg;
crypter = lib->crypto->create_crypter(lib->crypto, enc_alg, enc_key.len);
if (!crypter)
@@ -272,7 +273,13 @@ static bool create_traditional(private_esp_context_t *this, int enc_alg,
"failed");
goto failed;
}
- this->aead = aead_create(crypter, signer);
+ ivg = iv_gen_create_for_alg(enc_alg);
+ if (!ivg)
+ {
+ DBG1(DBG_ESP, "failed to create ESP context: creating iv gen failed");
+ goto failed;
+ }
+ this->aead = aead_create(crypter, signer, ivg);
return TRUE;
failed:
diff --git a/src/libipsec/ipsec_sa_mgr.c b/src/libipsec/ipsec_sa_mgr.c
index 07ffa9e4f..9d461f2c1 100644
--- a/src/libipsec/ipsec_sa_mgr.c
+++ b/src/libipsec/ipsec_sa_mgr.c
@@ -482,7 +482,7 @@ METHOD(ipsec_sa_mgr_t, add_sa, status_t,
entry = create_entry(sa_new);
schedule_expiration(this, entry);
- this->sas->insert_last(this->sas, entry);
+ this->sas->insert_first(this->sas, entry);
this->mutex->unlock(this->mutex);
return SUCCESS;