summaryrefslogtreecommitdiff
path: root/sys/netinet/ip_esp.c
diff options
context:
space:
mode:
authorMarkus Friedl <markus@cvs.openbsd.org>2005-05-25 05:47:54 +0000
committerMarkus Friedl <markus@cvs.openbsd.org>2005-05-25 05:47:54 +0000
commit2e172c5c337953c5b261a718c224233f55f766fa (patch)
tree04020363676641299cc1fc4c174c92903fc2557d /sys/netinet/ip_esp.c
parentda59a2318f0f71de02a778d5bfa0e8c13ea567d4 (diff)
AESCTR support for ESP (RFC 3686); ok hshoexer
Diffstat (limited to 'sys/netinet/ip_esp.c')
-rw-r--r--sys/netinet/ip_esp.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/netinet/ip_esp.c b/sys/netinet/ip_esp.c
index 47cff502423..26f2a1eff29 100644
--- a/sys/netinet/ip_esp.c
+++ b/sys/netinet/ip_esp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_esp.c,v 1.89 2005/05/10 13:42:11 markus Exp $ */
+/* $OpenBSD: ip_esp.c,v 1.90 2005/05/25 05:47:53 markus Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
* Angelos D. Keromytis (kermit@csd.uch.gr) and
@@ -113,6 +113,10 @@ esp_init(struct tdb *tdbp, struct xformsw *xsp, struct ipsecinit *ii)
txform = &enc_xform_rijndael128;
break;
+ case SADB_X_EALG_AESCTR:
+ txform = &enc_xform_aes_ctr;
+ break;
+
case SADB_X_EALG_BLF:
txform = &enc_xform_blf;
break;
@@ -145,10 +149,7 @@ esp_init(struct tdb *tdbp, struct xformsw *xsp, struct ipsecinit *ii)
DPRINTF(("esp_init(): initialized TDB with enc algorithm %s\n",
txform->name));
- if (ii->ii_encalg == SADB_EALG_NULL)
- tdbp->tdb_ivlen = 0;
- else
- tdbp->tdb_ivlen = txform->blocksize;
+ tdbp->tdb_ivlen = txform->ivsize;
if (tdbp->tdb_flags & TDBF_HALFIV)
tdbp->tdb_ivlen /= 2;
}