diff options
author | Yves-Alexis Perez <corsac@debian.org> | 2013-11-01 13:32:07 +0100 |
---|---|---|
committer | Yves-Alexis Perez <corsac@debian.org> | 2013-11-01 13:32:07 +0100 |
commit | a54780509260a8cb6f0344f531da168b34410dd5 (patch) | |
tree | 477239a312679174252f39f7a80bc8bf33836d9a /src/libipsec/esp_context.c | |
parent | 6e50941f7ce9c6f2d6888412968c7f4ffb495379 (diff) | |
parent | 5313d2d78ca150515f7f5eb39801c100690b6b29 (diff) | |
download | vyos-strongswan-a54780509260a8cb6f0344f531da168b34410dd5.tar.gz vyos-strongswan-a54780509260a8cb6f0344f531da168b34410dd5.zip |
Merge tag 'upstream/5.1.1'
Upstream version 5.1.1
Diffstat (limited to 'src/libipsec/esp_context.c')
-rw-r--r-- | src/libipsec/esp_context.c | 28 |
1 files changed, 5 insertions, 23 deletions
diff --git a/src/libipsec/esp_context.c b/src/libipsec/esp_context.c index bbcb62add..66e14f98b 100644 --- a/src/libipsec/esp_context.c +++ b/src/libipsec/esp_context.c @@ -224,7 +224,7 @@ static bool create_aead(private_esp_context_t *this, int alg, if (!this->aead) { DBG1(DBG_ESP, "failed to create ESP context: unsupported AEAD " - "algorithm"); + "algorithm %N", encryption_algorithm_names, alg); return FALSE; } if (!this->aead->set_key(this->aead, key)) @@ -244,19 +244,11 @@ static bool create_traditional(private_esp_context_t *this, int enc_alg, crypter_t *crypter = NULL; signer_t *signer = NULL; - switch (enc_alg) - { - case ENCR_AES_CBC: - crypter = lib->crypto->create_crypter(lib->crypto, enc_alg, - enc_key.len); - break; - default: - break; - } + crypter = lib->crypto->create_crypter(lib->crypto, enc_alg, enc_key.len); if (!crypter) { DBG1(DBG_ESP, "failed to create ESP context: unsupported encryption " - "algorithm"); + "algorithm %N", encryption_algorithm_names, enc_alg); goto failed; } if (!crypter->set_key(crypter, enc_key)) @@ -266,21 +258,11 @@ static bool create_traditional(private_esp_context_t *this, int enc_alg, goto failed; } - switch (int_alg) - { - case AUTH_HMAC_SHA1_96: - case AUTH_HMAC_SHA2_256_128: - case AUTH_HMAC_SHA2_384_192: - case AUTH_HMAC_SHA2_512_256: - signer = lib->crypto->create_signer(lib->crypto, int_alg); - break; - default: - break; - } + signer = lib->crypto->create_signer(lib->crypto, int_alg); if (!signer) { DBG1(DBG_ESP, "failed to create ESP context: unsupported integrity " - "algorithm"); + "algorithm %N", integrity_algorithm_names, int_alg); goto failed; } if (!signer->set_key(signer, int_key)) |