]> git.hungrycats.org Git - linux/commitdiff
[IPSEC]: Add support for Twofish and Serpent.
authorKyle McMartin <kyle@debian.org>
Sat, 16 Aug 2003 00:36:53 +0000 (17:36 -0700)
committerStephen Hemminger <shemminger@osdl.org>
Sat, 16 Aug 2003 00:36:53 +0000 (17:36 -0700)
This patch adds support for the use of twofish and serpent as
ESP algorithms. The ESP index numbers given are in accordance
with RFC2407, draft-ietf-ipsec-ciph-aes-cbc-00 (before Rijndael
was selected), and KAME which assigns 253 to twofishcbc.

Support for using twofish was requested on linux-kernel, and
since I noticed serpent was missing too, included that as well.

include/linux/pfkeyv2.h
net/xfrm/xfrm_algo.c

index df957cba539a958d16101a1db66799cccf49bc78..81807d58bb3e65bddba1825d4f13f731aa7eba19 100644 (file)
@@ -284,7 +284,10 @@ struct sadb_x_nat_t_port {
 #define SADB_X_EALG_BLOWFISHCBC                7
 #define SADB_EALG_NULL                 11
 #define SADB_X_EALG_AESCBC             12
-#define SADB_EALG_MAX                  12
+#define SADB_EALG_MAX                   253 /* last EALG */
+/* private allocations should use 249-255 (RFC2407) */
+#define SADB_X_EALG_SERPENTCBC  252     /* draft-ietf-ipsec-ciph-aes-cbc-00 */
+#define SADB_X_EALG_TWOFISHCBC  253     /* draft-ietf-ipsec-ciph-aes-cbc-00 */
 
 /* Compression algorithms */
 #define SADB_X_CALG_NONE               0
index cd9327b9672c28b86339944604d5a6e117f7af48..4e8871f4cc392a41bb7b88615d8beba5cc8dff0f 100644 (file)
@@ -217,6 +217,40 @@ static struct xfrm_algo_desc ealg_list[] = {
                .sadb_alg_maxbits = 256
        }
 },
+{
+        .name = "serpent",
+
+        .uinfo = {
+                .encr = {
+                        .blockbits = 128,
+                        .defkeybits = 128,
+                }
+        },
+
+        .desc = {
+                .sadb_alg_id = SADB_X_EALG_SERPENTCBC,
+                .sadb_alg_ivlen = 8,
+                .sadb_alg_minbits = 128,
+                .sadb_alg_maxbits = 256,
+        }
+},
+{
+        .name = "twofish",
+                 
+        .uinfo = {
+                .encr = {
+                        .blockbits = 128,
+                        .defkeybits = 128,
+                }
+        },
+
+        .desc = {
+                .sadb_alg_id = SADB_X_EALG_TWOFISHCBC,
+                .sadb_alg_ivlen = 8,
+                .sadb_alg_minbits = 128,
+                .sadb_alg_maxbits = 256
+        }
+},
 };
 
 static struct xfrm_algo_desc calg_list[] = {