summaryrefslogtreecommitdiff
path: root/sbin/ipsec/ipsecadm/xf_ahmd5.c
diff options
context:
space:
mode:
Diffstat (limited to 'sbin/ipsec/ipsecadm/xf_ahmd5.c')
-rw-r--r--sbin/ipsec/ipsecadm/xf_ahmd5.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/sbin/ipsec/ipsecadm/xf_ahmd5.c b/sbin/ipsec/ipsecadm/xf_ahmd5.c
index a1884ec1e83..1b95d9f9d35 100644
--- a/sbin/ipsec/ipsecadm/xf_ahmd5.c
+++ b/sbin/ipsec/ipsecadm/xf_ahmd5.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xf_ahmd5.c,v 1.3 1997/07/01 22:18:03 provos Exp $ */
+/* $OpenBSD: xf_ahmd5.c,v 1.4 1997/07/11 23:50:22 provos Exp $ */
/*
* The author of this code is John Ioannidis, ji@tla.org,
* (except when noted otherwise).
@@ -63,7 +63,7 @@ char **argv;
int klen, i;
struct encap_msghdr *em;
- struct ahmd5_xdata *xd;
+ struct ah_old_xencap *xd;
if (argc != 5) {
fprintf(stderr, "usage: %s src dst spi key\n", argv[0]);
@@ -74,22 +74,22 @@ char **argv;
em = (struct encap_msghdr *)&buf[0];
- em->em_msglen = EMT_SETSPI_FLEN + 4 + klen;
+ em->em_msglen = EMT_SETSPI_FLEN + AH_OLD_XENCAP_LEN + klen;
em->em_version = PFENCAP_VERSION_1;
em->em_type = EMT_SETSPI;
em->em_spi = htonl(strtoul(argv[3], NULL, 16));
em->em_src.s_addr = inet_addr(argv[1]);
em->em_dst.s_addr = inet_addr(argv[2]);
- em->em_alg = XF_AHMD5;
- xd = (struct ahmd5_xdata *)(em->em_dat);
+ em->em_alg = XF_OLD_AH;
+ em->em_sproto = IPPROTO_AH;
+
+ xd = (struct ah_old_xencap *)(em->em_dat);
+
+ xd->amx_hash_algorithm = ALG_AUTH_MD5;
+ xd->amx_keylen = klen;
- xd->amx_klen = klen;
- xd->amx_alen = 16;
-
for (i = 0; i < klen; i++ )
xd->amx_key[i] = x2i(&(argv[4][2*i]));
return xf_set(em);
}
-
-