diff options
author | 2010-07-20 15:36:03 +0000 | |
---|---|---|
committer | 2010-07-20 15:36:03 +0000 | |
commit | e1212bed0e6d27dddcffd5e826c272e572fe475a (patch) | |
tree | ad14b67ba28704ce661ec01a9db4eceea3eefd60 /sys/netinet/tcp_input.c | |
parent | Add OpenSSH's timingsafe_bcmp() to libkern. (diff) | |
download | wireguard-openbsd-e1212bed0e6d27dddcffd5e826c272e572fe475a.tar.xz wireguard-openbsd-e1212bed0e6d27dddcffd5e826c272e572fe475a.zip |
Switch some obvious network stack MAC comparisons from bcmp() to
timingsafe_bcmp().
ok deraadt@; committed over WPA.
Diffstat (limited to 'sys/netinet/tcp_input.c')
-rw-r--r-- | sys/netinet/tcp_input.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 3516af7deb8..d923a3c6713 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcp_input.c,v 1.234 2010/07/09 16:58:06 reyk Exp $ */ +/* $OpenBSD: tcp_input.c,v 1.235 2010/07/20 15:36:03 matthew Exp $ */ /* $NetBSD: tcp_input.c,v 1.23 1996/02/13 23:43:44 christos Exp $ */ /* @@ -2351,7 +2351,7 @@ tcp_dooptions(struct tcpcb *tp, u_char *cp, int cnt, struct tcphdr *th, if (optlen != TCPOLEN_SIGNATURE) continue; - if (sigp && bcmp(sigp, cp + 2, 16)) + if (sigp && timingsafe_bcmp(sigp, cp + 2, 16)) return (-1); sigp = cp + 2; @@ -2419,7 +2419,7 @@ tcp_dooptions(struct tcpcb *tp, u_char *cp, int cnt, struct tcphdr *th, if (tcp_signature(tdb, tp->pf, m, th, iphlen, 1, sig) < 0) return (-1); - if (bcmp(sig, sigp, 16)) { + if (timingsafe_bcmp(sig, sigp, 16)) { tcpstat.tcps_rcvbadsig++; return (-1); } |