=== freeswan-ext-v0.6-1.94-ext_null.diff ===
--- freeswan-1.94/klips/net/ipsec/ext/Config.ext_null.in	Wed Dec 31 21:00:00 1969
+++ freeswan-1.94.jjo/klips/net/ipsec/ext/Config.ext_null.in	Tue Dec 18 11:09:51 2001
@@ -0,0 +1,3 @@
+if [ "$CONFIG_IPSEC_EXT_ALG" = "y" ]; then
+  tristate '        NULL encryption algorithm' CONFIG_IPSEC_ENC_NULL
+fi
--- freeswan-1.94/klips/net/ipsec/ext/Makefile.ext_null	Wed Dec 31 21:00:00 1969
+++ freeswan-1.94.jjo/klips/net/ipsec/ext/Makefile.ext_null	Tue Dec 18 11:09:23 2001
@@ -0,0 +1,8 @@
+EXT_MODULES += ipsec_null.o
+
+obj-$(CONFIG_IPSEC_ENC_NULL) += ipsec_null.o
+
+IPSEC_EXT_NULL_OBJS=ipsec_ext_null.o
+ipsec_null.o: $(IPSEC_EXT_NULL_OBJS)
+	$(LD) -r $(IPSEC_EXT_NULL_OBJS) -o $@
+
--- freeswan-1.94/klips/net/ipsec/ext/ipsec_ext_null.c	Wed Dec 31 21:00:00 1969
+++ freeswan-1.94.jjo/klips/net/ipsec/ext/ipsec_ext_null.c	Tue Dec 18 11:32:37 2001
@@ -0,0 +1,112 @@
+/*
+ * ipsec_ext NULL cipher stubs
+ *
+ * Author: JuanJo Ciarlante <jjo-ipsec@mendoza.gov.ar>
+ * 
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.
+ * 
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * for more details.
+ *
+ */
+#include <linux/config.h>
+#include <linux/version.h>
+
+#include <linux/module.h>
+#include <linux/init.h>
+
+#include <linux/kernel.h> /* printk() */
+#include <kversions.h>
+#include <linux/errno.h>  /* error codes */
+#include <linux/types.h>  /* size_t */
+#include <linux/string.h>
+
+/* Check if __exit is defined, if not null it */
+#ifndef __exit
+#define __exit
+#endif
+
+/*	Low freeswan header coupling	*/
+#include "ipsec_ext.h"
+
+#define ESP_NULL		11	/* from ipsec drafts */
+
+#define ESP_NULL_CBC_BLK_LEN	8
+
+static int debug=0;
+MODULE_PARM(debug, "i");
+static int test=0;
+MODULE_PARM(test, "i");
+
+struct esp_null
+{
+	__u32   esp_spi;			/* Security Parameters Index */
+	__u32   esp_rpl;			/* Replay counter */
+	__u8    esp_iv[ESP_NULL_CBC_BLK_LEN];	/* iv */
+};
+typedef int null_context;
+struct null_eks{
+	null_context null_ctx;
+};
+static int _null_set_key(caddr_t key_e, caddr_t key, int keysize) {
+	null_context *null_ctx_p=&((struct null_eks*)key_e)->null_ctx;
+	if (debug > 0)
+		printk(KERN_DEBUG "klips_debug:_null_set_key:"
+				"key_e=%p key=%p keysize=%d\n",
+				key_e, key, keysize);
+	*null_ctx_p = 1;
+	return 0;
+}
+static int _null_cbc_encrypt(caddr_t key_e, caddr_t in, caddr_t out, int ilen, caddr_t iv, int encrypt) {
+	null_context *null_ctx_p=&((struct null_eks*)key_e)->null_ctx;
+	if (debug > 0)
+		printk(KERN_DEBUG "klips_debug:_null_cbc_encrypt:"
+				"key_e=%p in=%p out=%p ilen=%d iv=%p encrypt=%d\n",
+				key_e, in, out, ilen, iv, encrypt);
+	return ilen;
+}
+static struct ipsec_ext ipsec_ext_NULL = {
+	name: 		"null",
+	enc_alg: 	ESP_NULL,
+	blocksize:	ESP_NULL_CBC_BLK_LEN, 
+	esphlen:	sizeof(struct esp_null),
+	keyminbits:	0,
+	keymaxbits:	0,
+	keysize:	0,
+	key_e_size:	sizeof(struct null_eks),
+	refcnt:		ATOMIC_INIT(0),
+	new_key:	NULL,
+	set_key:	_null_set_key,
+	cbc_encrypt:	_null_cbc_encrypt,
+	support_p:	NULL,
+};
+	
+static int __init ipsec_null_init(void)
+{
+	int ret, test_ret;
+	ret=register_ipsec_ext(&ipsec_ext_NULL);
+	printk(__FUNCTION__ "(enc_alg=%d name=%s): ret=%d\n", 
+			ipsec_ext_NULL.enc_alg, ipsec_ext_NULL.name, ret);
+	if (test) {
+		test_ret=ipsec_ext_test(ipsec_ext_NULL.enc_alg, test);
+		printk(__FUNCTION__ "(enc_alg=%d): test_ret=%d\n", 
+				ipsec_ext_NULL.enc_alg, test_ret);
+	}
+	return ret;
+}
+static void __exit ipsec_null_fini(void)
+{
+	unregister_ipsec_ext(&ipsec_ext_NULL);
+	return;
+}
+#ifdef MODULE_LICENSE
+MODULE_LICENSE("GPL");
+#endif
+
+module_init(ipsec_null_init);
+module_exit(ipsec_null_fini);
--- freeswan-1.94.jjo/klips/net/ipsec/ext/Config.in	Sun Dec 16 10:24:55 2001
+++ freeswan-1.94.jjo/klips/net/ipsec/ext/Config.in	Sun Dec 16 10:24:52 2001
@@ -0,0 +1 @@
+source net/ipsec/ext/Config.ext_null.in

