summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sbin/ipsecadm/ipsecadm.c3
-rw-r--r--sys/crypto/cryptodev.h5
-rw-r--r--sys/crypto/xform.c19
-rw-r--r--sys/crypto/xform.h4
-rw-r--r--sys/net/pfkeyv2.c10
-rw-r--r--sys/net/pfkeyv2_convert.c5
6 files changed, 37 insertions, 9 deletions
diff --git a/sbin/ipsecadm/ipsecadm.c b/sbin/ipsecadm/ipsecadm.c
index a19735a4d2f..718befb9a7e 100644
--- a/sbin/ipsecadm/ipsecadm.c
+++ b/sbin/ipsecadm/ipsecadm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ipsecadm.c,v 1.64 2002/07/03 22:32:33 deraadt Exp $ */
+/* $OpenBSD: ipsecadm.c,v 1.65 2003/02/15 22:57:58 jason Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
* Angelos D. Keromytis (kermit@csd.uch.gr) and
@@ -105,6 +105,7 @@ transform xf[] = {
{ "sha1", SADB_X_AALG_SHA1, XF_AUTH | AH_OLD },
{ "rmd160", SADB_AALG_RIPEMD160HMAC, XF_AUTH | AH_NEW | ESP_NEW },
{ "deflate", SADB_X_CALG_DEFLATE, XF_COMP | IPCOMP },
+ { "lzs", SADB_X_CALG_LZS, XF_COMP | IPCOMP },
};
#define ROUNDUP(x) (((x) + sizeof(u_int64_t) - 1) & ~(sizeof(u_int64_t) - 1))
diff --git a/sys/crypto/cryptodev.h b/sys/crypto/cryptodev.h
index 5e6dd370f10..8cc9ccc1690 100644
--- a/sys/crypto/cryptodev.h
+++ b/sys/crypto/cryptodev.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cryptodev.h,v 1.36 2003/02/15 18:55:50 jason Exp $ */
+/* $OpenBSD: cryptodev.h,v 1.37 2003/02/15 22:57:58 jason Exp $ */
/*
* The author of this code is Angelos D. Keromytis (angelos@cis.upenn.edu)
@@ -94,7 +94,8 @@
#define CRYPTO_SHA1 14
#define CRYPTO_DEFLATE_COMP 15 /* Deflate compression algorithm */
#define CRYPTO_NULL 16
-#define CRYPTO_ALGORITHM_MAX 16 /* Keep updated - see below */
+#define CRYPTO_LZS_COMP 17 /* LZS compression algorithm */
+#define CRYPTO_ALGORITHM_MAX 17 /* Keep updated - see below */
#define CRYPTO_ALGORITHM_ALL (CRYPTO_ALGORITHM_MAX + 1)
diff --git a/sys/crypto/xform.c b/sys/crypto/xform.c
index f8d1ae58508..a1687fb607a 100644
--- a/sys/crypto/xform.c
+++ b/sys/crypto/xform.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xform.c,v 1.20 2002/11/12 18:23:13 jason Exp $ */
+/* $OpenBSD: xform.c,v 1.21 2003/02/15 22:57:58 jason Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
* Angelos D. Keromytis (kermit@csd.uch.gr) and
@@ -95,6 +95,7 @@ int RMD160Update_int(void *, u_int8_t *, u_int16_t);
u_int32_t deflate_compress(u_int8_t *, u_int32_t, u_int8_t **);
u_int32_t deflate_decompress(u_int8_t *, u_int32_t, u_int8_t **);
+u_int32_t lzs_dummy(u_int8_t *, u_int32_t, u_int8_t **);
/* Encryption instances */
struct enc_xform enc_xform_des = {
@@ -226,6 +227,12 @@ struct comp_algo comp_algo_deflate = {
deflate_decompress
};
+struct comp_algo comp_algo_lzs = {
+ CRYPTO_DEFLATE_COMP, "LZS",
+ 90, lzs_dummy,
+ lzs_dummy
+};
+
/*
* Encryption wrapper routines.
*/
@@ -478,3 +485,13 @@ deflate_decompress(data, size, out)
{
return deflate_global(data, size, 1, out);
}
+
+u_int32_t
+lzs_dummy(data, size, out)
+ u_int8_t *data;
+ u_int32_t size;
+ u_int8_t **out;
+{
+ *out = NULL;
+ return (0);
+}
diff --git a/sys/crypto/xform.h b/sys/crypto/xform.h
index a44b6102a55..330e6931a35 100644
--- a/sys/crypto/xform.h
+++ b/sys/crypto/xform.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: xform.h,v 1.11 2002/11/12 18:23:13 jason Exp $ */
+/* $OpenBSD: xform.h,v 1.12 2003/02/15 22:57:58 jason Exp $ */
/*
* The author of this code is Angelos D. Keromytis (angelos@cis.upenn.edu)
@@ -84,4 +84,6 @@ extern struct auth_hash auth_hash_hmac_sha1_96;
extern struct auth_hash auth_hash_hmac_ripemd_160_96;
extern struct comp_algo comp_algo_deflate;
+extern struct comp_algo comp_algo_lzs;
+
#endif /* _CRYPTO_XFORM_H_ */
diff --git a/sys/net/pfkeyv2.c b/sys/net/pfkeyv2.c
index 30655fcbb0d..02ce61ecfa3 100644
--- a/sys/net/pfkeyv2.c
+++ b/sys/net/pfkeyv2.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfkeyv2.c,v 1.84 2002/07/31 00:13:36 itojun Exp $ */
+/* $OpenBSD: pfkeyv2.c,v 1.85 2003/02/15 22:57:58 jason Exp $ */
/*
* @(#)COPYRIGHT 1.1 (NRL) 17 January 1995
@@ -113,6 +113,7 @@ static struct sadb_alg aalgs[] =
static struct sadb_alg calgs[] =
{
{ SADB_X_CALG_DEFLATE, 0, 0, 0},
+ { SADB_X_CALG_LZS, 0, 0, 0},
};
extern uint32_t sadb_exts_allowed_out[SADB_MAX+1];
@@ -2035,11 +2036,14 @@ pfkeyv2_acquire(struct ipsec_policy *ipo, union sockaddr_union *gw,
else if (ipo->ipo_sproto == IPPROTO_IPCOMP)
{
/* Set the compression algorithm */
- if (!strncasecmp(ipsec_def_comp, "deflate", sizeof("deflate")))
- {
+ if (!strncasecmp(ipsec_def_comp, "deflate", sizeof("deflate"))) {
sadb_comb->sadb_comb_encrypt = SADB_X_CALG_DEFLATE;
sadb_comb->sadb_comb_encrypt_minbits = 0;
sadb_comb->sadb_comb_encrypt_maxbits = 0;
+ } else if (!strncasecmp(ipsec_def_comp, "lzs", sizeof("lzs"))) {
+ sadb_comb->sadb_comb_encrypt = SADB_X_CALG_LZS;
+ sadb_comb->sadb_comb_encrypt_minbits = 0;
+ sadb_comb->sadb_comb_encrypt_maxbits = 0;
}
}
diff --git a/sys/net/pfkeyv2_convert.c b/sys/net/pfkeyv2_convert.c
index 76b70ce42c8..fefb11a37b1 100644
--- a/sys/net/pfkeyv2_convert.c
+++ b/sys/net/pfkeyv2_convert.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfkeyv2_convert.c,v 1.12 2002/06/09 23:15:42 angelos Exp $ */
+/* $OpenBSD: pfkeyv2_convert.c,v 1.13 2003/02/15 22:57:59 jason Exp $ */
/*
* The author of this code is Angelos D. Keromytis (angelos@keromytis.org)
*
@@ -163,6 +163,9 @@ export_sa(void **p, struct tdb *tdb)
case CRYPTO_DEFLATE_COMP:
sadb_sa->sadb_sa_encrypt = SADB_X_CALG_DEFLATE;
break;
+ case CRYPTO_LZS_COMP:
+ sadb_sa->sadb_sa_encrypt = SADB_X_CALG_LZS;
+ break;
}
}