diff options
-rw-r--r-- | sbin/pfctl/pfctl_parser.c | 6 | ||||
-rw-r--r-- | sys/net/pf_ioctl.c | 5 | ||||
-rw-r--r-- | sys/net/pfvar.h | 12 |
3 files changed, 15 insertions, 8 deletions
diff --git a/sbin/pfctl/pfctl_parser.c b/sbin/pfctl/pfctl_parser.c index 5c9f7f128c4..16c6e08654e 100644 --- a/sbin/pfctl/pfctl_parser.c +++ b/sbin/pfctl/pfctl_parser.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pfctl_parser.c,v 1.218 2005/06/13 20:17:26 henning Exp $ */ +/* $OpenBSD: pfctl_parser.c,v 1.219 2005/06/30 20:52:20 sturm Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -482,7 +482,7 @@ print_status(struct pf_status *s, int opts) char statline[80], *running; time_t runtime; int i; - char buf[MD5_DIGEST_LENGTH * 2 + 1]; + char buf[PF_MD5_DIGEST_LENGTH * 2 + 1]; static const char hex[] = "0123456789abcdef"; runtime = time(NULL) - s->since; @@ -521,7 +521,7 @@ print_status(struct pf_status *s, int opts) if (opts & PF_OPT_VERBOSE) { printf("Hostid: 0x%08x\n", ntohl(s->hostid)); - for (i = 0; i < MD5_DIGEST_LENGTH; i++) { + for (i = 0; i < PF_MD5_DIGEST_LENGTH; i++) { buf[i + i] = hex[s->pf_chksum[i] >> 4]; buf[i + i + 1] = hex[s->pf_chksum[i] & 0x0f]; } diff --git a/sys/net/pf_ioctl.c b/sys/net/pf_ioctl.c index d202aac1f38..5778dddf3cd 100644 --- a/sys/net/pf_ioctl.c +++ b/sys/net/pf_ioctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf_ioctl.c,v 1.144 2005/06/13 20:17:25 henning Exp $ */ +/* $OpenBSD: pf_ioctl.c,v 1.145 2005/06/30 20:52:20 sturm Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -63,6 +63,7 @@ #include <netinet/ip_icmp.h> #include <dev/rndvar.h> +#include <crypto/md5.h> #include <net/pfvar.h> #if NPFSYNC > 0 @@ -1091,7 +1092,7 @@ pf_calc_chksum(struct pf_ruleset *rs) MD5_CTX ctx; struct pf_rule *rule; int rs_cnt; - u_int8_t digest[MD5_DIGEST_LENGTH]; + u_int8_t digest[PF_MD5_DIGEST_LENGTH]; MD5Init(&ctx); for (rs_cnt = 0; rs_cnt < PF_RULESET_MAX; rs_cnt++) { diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index e768b369842..35813d6ed2f 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pfvar.h,v 1.224 2005/06/13 20:54:50 henning Exp $ */ +/* $OpenBSD: pfvar.h,v 1.225 2005/06/30 20:52:20 sturm Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -42,13 +42,19 @@ #include <net/route.h> #include <netinet/ip_ipsp.h> #include <netinet/tcp_fsm.h> -#include <crypto/md5.h> struct ip; #define PF_TCPS_PROXY_SRC ((TCP_NSTATES)+0) #define PF_TCPS_PROXY_DST ((TCP_NSTATES)+1) +#define PF_MD5_DIGEST_LENGTH 16 +#ifdef MD5_DIGEST_LENGTH +#if PF_MD5_DIGEST_LENGTH != MD5_DIGEST_LENGTH +#error +#endif +#endif + enum { PF_INOUT, PF_IN, PF_OUT }; enum { PF_LAN_EXT, PF_EXT_GWY, PF_ID }; enum { PF_PASS, PF_DROP, PF_SCRUB, PF_NOSCRUB, PF_NAT, PF_NONAT, @@ -1048,7 +1054,7 @@ struct pf_status { u_int32_t debug; u_int32_t hostid; char ifname[IFNAMSIZ]; - u_int8_t pf_chksum[MD5_DIGEST_LENGTH]; + u_int8_t pf_chksum[PF_MD5_DIGEST_LENGTH]; }; struct cbq_opts { |