aboutsummaryrefslogtreecommitdiff
path: root/sys/netipsec/xform_esp.c
diff options
context:
space:
mode:
authorPawel Jakub Dawidek <pjd@FreeBSD.org>2011-11-26 23:27:41 +0000
committerPawel Jakub Dawidek <pjd@FreeBSD.org>2011-11-26 23:27:41 +0000
commitcdb7ebe38c5f24d4a7ecf2e0aef7b25f586a175e (patch)
tree4e46e2a49551e988af999fe8059052b875c4ad22 /sys/netipsec/xform_esp.c
parent5be4c9b9e6cf4041f3f4757b03bca6cfa83c3829 (diff)
downloadsrc-cdb7ebe38c5f24d4a7ecf2e0aef7b25f586a175e.tar.gz
src-cdb7ebe38c5f24d4a7ecf2e0aef7b25f586a175e.zip
The esp_max_ivlen global variable is not needed, we can just use
EALG_MAX_BLOCK_LEN.
Notes
Notes: svn path=/head/; revision=228012
Diffstat (limited to 'sys/netipsec/xform_esp.c')
-rw-r--r--sys/netipsec/xform_esp.c17
1 files changed, 1 insertions, 16 deletions
diff --git a/sys/netipsec/xform_esp.c b/sys/netipsec/xform_esp.c
index 8ee5e57ac1da..7ccd844e51fb 100644
--- a/sys/netipsec/xform_esp.c
+++ b/sys/netipsec/xform_esp.c
@@ -76,8 +76,6 @@
#include <opencrypto/cryptodev.h>
#include <opencrypto/xform.h>
-static int esp_max_ivlen; /* max iv length over all algorithms */
-
VNET_DEFINE(int, esp_enable) = 1;
VNET_DEFINE(struct espstat, espstat);
@@ -146,7 +144,7 @@ esp_hdrsiz(struct secasvar *sav)
* + sizeof (next header field)
* + max icv supported.
*/
- size = sizeof (struct newesp) + esp_max_ivlen + 9 + 16;
+ size = sizeof (struct newesp) + EALG_MAX_BLOCK_LEN + 9 + 16;
}
return size;
}
@@ -1020,20 +1018,7 @@ static struct xformsw esp_xformsw = {
static void
esp_attach(void)
{
-#define MAXIV(xform) \
- if (xform.blocksize > esp_max_ivlen) \
- esp_max_ivlen = xform.blocksize \
-
- MAXIV(enc_xform_des); /* SADB_EALG_DESCBC */
- MAXIV(enc_xform_3des); /* SADB_EALG_3DESCBC */
- MAXIV(enc_xform_rijndael128); /* SADB_X_EALG_AES */
- MAXIV(enc_xform_blf); /* SADB_X_EALG_BLOWFISHCBC */
- MAXIV(enc_xform_cast5); /* SADB_X_EALG_CAST128CBC */
- MAXIV(enc_xform_skipjack); /* SADB_X_EALG_SKIPJACK */
- MAXIV(enc_xform_null); /* SADB_EALG_NULL */
- MAXIV(enc_xform_camellia); /* SADB_X_EALG_CAMELLIACBC */
xform_register(&esp_xformsw);
-#undef MAXIV
}
SYSINIT(esp_xform_init, SI_SUB_PROTO_DOMAIN, SI_ORDER_MIDDLE, esp_attach, NULL);