38 }) ip4_and_esp_header_t;
46 }) ip4_and_udp_and_esp_header_t;
53 }) ip6_and_esp_header_t;
56 #define ESP_WINDOW_SIZE (64) 57 #define ESP_SEQ_MAX (4294967295UL) 150 if (wrap == 0 && seq > sa->
last_seq)
246 i->
md = EVP_sha256 ();
250 i->
md = EVP_sha256 ();
254 i->
md = EVP_sha384 ();
258 i->
md = EVP_sha512 ();
265 for (thread_id = 0; thread_id < tm->
n_vlib_mains; thread_id++)
267 #if OPENSSL_VERSION_NUMBER >= 0x10100000L 283 u8 * data,
int data_len,
u8 * signature,
u8 use_esn,
u32 seq_hi)
287 #if OPENSSL_VERSION_NUMBER >= 0x10100000L 292 const EVP_MD *md =
NULL;
306 HMAC_Init_ex (ctx, key, key_len, md,
NULL);
308 HMAC_Update (ctx, data, data_len);
311 HMAC_Update (ctx, (
u8 *) & seq_hi,
sizeof (seq_hi));
312 HMAC_Final (ctx, signature, &len);
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
EVP_CIPHER_CTX * encrypt_ctx
ipsec_proto_main_integ_alg_t * ipsec_proto_main_integ_algs
static void esp_replay_advance(ipsec_sa_t *sa, u32 seq)
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
static unsigned int hmac_calc(ipsec_integ_alg_t alg, u8 *key, int key_len, u8 *data, int data_len, u8 *signature, u8 use_esn, u32 seq_hi)
#define vec_validate_aligned(V, I, A)
Make sure vector is long enough for given index (no header, specified alignment)
ipsec_proto_main_crypto_alg_t * ipsec_proto_main_crypto_algs
ipsec_proto_main_t ipsec_proto_main
static int esp_seq_advance(ipsec_sa_t *sa)
static void esp_replay_advance_esn(ipsec_sa_t *sa, u32 seq)
ipsec_proto_main_per_thread_data_t * per_thread_data
static int esp_replay_check_esn(ipsec_sa_t *sa, u32 seq)
typedef CLIB_PACKED(struct { ip4_header_t ip4;esp_header_t esp;}) ip4_and_esp_header_t
static_always_inline uword vlib_get_thread_index(void)
EVP_CIPHER_CTX * decrypt_ctx
u8 * format_esp_header(u8 *s, va_list *args)
static int esp_replay_check(ipsec_sa_t *sa, u32 seq)
static void ipsec_proto_init()
ipsec_integ_alg_t last_integ_alg
static vlib_thread_main_t * vlib_get_thread_main()
#define CLIB_CACHE_LINE_BYTES