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: add support for AES CTR
[vpp.git]
/
src
/
vnet
/
ipsec
/
ipsec_sa.c
diff --git
a/src/vnet/ipsec/ipsec_sa.c
b/src/vnet/ipsec/ipsec_sa.c
index
71e86ac
..
515eb25
100644
(file)
--- a/
src/vnet/ipsec/ipsec_sa.c
+++ b/
src/vnet/ipsec/ipsec_sa.c
@@
-108,8
+108,13
@@
ipsec_sa_set_crypto_alg (ipsec_sa_t * sa, ipsec_crypto_alg_t crypto_alg)
if (IPSEC_CRYPTO_ALG_IS_GCM (crypto_alg))
{
sa->integ_icv_size = im->crypto_algs[crypto_alg].icv_size;
if (IPSEC_CRYPTO_ALG_IS_GCM (crypto_alg))
{
sa->integ_icv_size = im->crypto_algs[crypto_alg].icv_size;
+ ipsec_sa_set_IS_CTR (sa);
ipsec_sa_set_IS_AEAD (sa);
}
ipsec_sa_set_IS_AEAD (sa);
}
+ else if (IPSEC_CRYPTO_ALG_IS_CTR (crypto_alg))
+ {
+ ipsec_sa_set_IS_CTR (sa);
+ }
}
void
}
void
@@
-211,8
+216,7
@@
ipsec_sa_add_and_lock (u32 id,
sa->tunnel_flags = tunnel_flags;
sa->dscp = dscp;
sa->salt = salt;
sa->tunnel_flags = tunnel_flags;
sa->dscp = dscp;
sa->salt = salt;
- sa->encrypt_thread_index = (vlib_num_workers ())? ~0 : 0;
- sa->decrypt_thread_index = (vlib_num_workers ())? ~0 : 0;
+ sa->thread_index = (vlib_num_workers ()) ? ~0 : 0;
if (integ_alg != IPSEC_INTEG_ALG_NONE)
{
ipsec_sa_set_integ_alg (sa, integ_alg);
if (integ_alg != IPSEC_INTEG_ALG_NONE)
{
ipsec_sa_set_integ_alg (sa, integ_alg);
@@
-460,11
+464,11
@@
ipsec_sa_walk (ipsec_sa_walk_cb_t cb, void *ctx)
ipsec_sa_t *sa;
/* *INDENT-OFF* */
ipsec_sa_t *sa;
/* *INDENT-OFF* */
- pool_foreach (sa, im->sad
,
-
(
{
+ pool_foreach (sa, im->sad
)
+
{
if (WALK_CONTINUE != cb(sa, ctx))
break;
if (WALK_CONTINUE != cb(sa, ctx))
break;
- }
));
+ }
/* *INDENT-ON* */
}
/* *INDENT-ON* */
}