Code Review
/
vpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
IPSec AH protocol enhancement in VPP native core
[vpp.git]
/
src
/
vnet
/
ipsec
/
esp_encrypt.c
diff --git
a/src/vnet/ipsec/esp_encrypt.c
b/src/vnet/ipsec/esp_encrypt.c
index
b6ee258
..
3e196b3
100644
(file)
--- a/
src/vnet/ipsec/esp_encrypt.c
+++ b/
src/vnet/ipsec/esp_encrypt.c
@@
-22,7
+22,7
@@
#include <vnet/ipsec/ipsec.h>
#include <vnet/ipsec/esp.h>
#include <vnet/ipsec/ipsec.h>
#include <vnet/ipsec/esp.h>
-
esp_main_t esp
_main;
+
ipsec_proto_main_t ipsec_proto
_main;
#define foreach_esp_encrypt_next \
_(DROP, "error-drop") \
#define foreach_esp_encrypt_next \
_(DROP, "error-drop") \
@@
-88,21
+88,26
@@
always_inline void
esp_encrypt_aes_cbc (ipsec_crypto_alg_t alg,
u8 * in, u8 * out, size_t in_len, u8 * key, u8 * iv)
{
esp_encrypt_aes_cbc (ipsec_crypto_alg_t alg,
u8 * in, u8 * out, size_t in_len, u8 * key, u8 * iv)
{
-
esp_main_t *em = &esp
_main;
+
ipsec_proto_main_t *em = &ipsec_proto
_main;
u32 thread_index = vlib_get_thread_index ();
u32 thread_index = vlib_get_thread_index ();
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L
+ EVP_CIPHER_CTX *ctx = em->per_thread_data[thread_index].encrypt_ctx;
+#else
EVP_CIPHER_CTX *ctx = &(em->per_thread_data[thread_index].encrypt_ctx);
EVP_CIPHER_CTX *ctx = &(em->per_thread_data[thread_index].encrypt_ctx);
+#endif
const EVP_CIPHER *cipher = NULL;
int out_len;
ASSERT (alg < IPSEC_CRYPTO_N_ALG);
const EVP_CIPHER *cipher = NULL;
int out_len;
ASSERT (alg < IPSEC_CRYPTO_N_ALG);
- if (PREDICT_FALSE (em->esp_crypto_algs[alg].type == IPSEC_CRYPTO_ALG_NONE))
+ if (PREDICT_FALSE
+ (em->ipsec_proto_main_crypto_algs[alg].type == IPSEC_CRYPTO_ALG_NONE))
return;
if (PREDICT_FALSE
(alg != em->per_thread_data[thread_index].last_encrypt_alg))
{
return;
if (PREDICT_FALSE
(alg != em->per_thread_data[thread_index].last_encrypt_alg))
{
- cipher = em->
esp
_crypto_algs[alg].type;
+ cipher = em->
ipsec_proto_main
_crypto_algs[alg].type;
em->per_thread_data[thread_index].last_encrypt_alg = alg;
}
em->per_thread_data[thread_index].last_encrypt_alg = alg;
}