diff options
Diffstat (limited to 'sbin/ipsec/ipsecadm/xf_ahhmacmd5.c')
-rw-r--r-- | sbin/ipsec/ipsecadm/xf_ahhmacmd5.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/sbin/ipsec/ipsecadm/xf_ahhmacmd5.c b/sbin/ipsec/ipsecadm/xf_ahhmacmd5.c index a90db90b73c..b72c8d49b6b 100644 --- a/sbin/ipsec/ipsecadm/xf_ahhmacmd5.c +++ b/sbin/ipsec/ipsecadm/xf_ahhmacmd5.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xf_ahhmacmd5.c,v 1.3 1997/07/01 22:18:01 provos Exp $ */ +/* $OpenBSD: xf_ahhmacmd5.c,v 1.4 1997/07/11 23:50:21 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 ahhmacmd5_xencap *xd; + struct ah_new_xencap *xd; if (argc != 5) { fprintf(stderr, "usage: %s src dst spi key\n", argv[0]); @@ -74,20 +74,22 @@ char **argv; em = (struct encap_msghdr *)&buf[0]; - em->em_msglen = EMT_SETSPI_FLEN + 4 + AHHMACMD5_KMAX; + em->em_msglen = EMT_SETSPI_FLEN + AH_NEW_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_AHHMACMD5; - xd = (struct ahhmacmd5_xencap *)(em->em_dat); + em->em_alg = XF_NEW_AH; + em->em_sproto = IPPROTO_AH; - xd->amx_alen = 16; - xd->amx_rpl = 1; + xd = (struct ah_new_xencap *)(em->em_dat); + + xd->amx_hash_algorithm = ALG_AUTH_MD5; xd->amx_wnd = 32; + xd->amx_keylen = klen; - bzero(xd->amx_key, AHHMACMD5_KMAX); + bzero(xd->amx_key, klen); for (i = 0; i < klen; i++ ) xd->amx_key[i] = x2i(&(argv[4][2*i])); |