diff options
author | roberto <roberto@FreeBSD.org> | 2009-12-12 22:29:30 +0000 |
---|---|---|
committer | roberto <roberto@FreeBSD.org> | 2009-12-12 22:29:30 +0000 |
commit | 76d0d9559c6c64adb0eec290749ddb0bc85c99ec (patch) | |
tree | 5a9f13891d1608baf9ad2436ec526b57ad47d3e6 /libntp/authparity.c | |
parent | c5461d7d838ecf010f9a551e548b1330f2201aaa (diff) | |
download | FreeBSD-src-76d0d9559c6c64adb0eec290749ddb0bc85c99ec.zip FreeBSD-src-76d0d9559c6c64adb0eec290749ddb0bc85c99ec.tar.gz |
Update ntp vendor code to 4.2.4p8.
This is mainly to fix CVE-2009-3563, a remote DOS.
MFC after: 3 days
Security: CVE-2009-3563
Diffstat (limited to 'libntp/authparity.c')
-rw-r--r-- | libntp/authparity.c | 66 |
1 files changed, 0 insertions, 66 deletions
diff --git a/libntp/authparity.c b/libntp/authparity.c deleted file mode 100644 index ea5eac0..0000000 --- a/libntp/authparity.c +++ /dev/null @@ -1,66 +0,0 @@ -/* - * auth_parity - set parity on a key/check for odd parity - */ - -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - -#ifdef DES -#include "ntp_stdlib.h" - -int -DESauth_parity( - u_int32 *key - ) -{ - u_int32 mask; - int parity_err; - int bitcount; - int half; - int byte; - int i; - - /* - * Go through counting bits in each byte. Check to see if - * each parity bit was set correctly. If not, note the error - * and set it right. - */ - parity_err = 0; - for (half = 0; half < 2; half++) { /* two halves of key */ - mask = 0x80000000; - for (byte = 0; byte < 4; byte++) { /* 4 bytes per half */ - bitcount = 0; - for (i = 0; i < 7; i++) { /* 7 data bits / byte */ - if (key[half] & mask) - bitcount++; - mask >>= 1; - } - - /* - * If bitcount is even, parity must be set. If - * bitcount is odd, parity must be clear. - */ - if ((bitcount & 0x1) == 0) { - if (!(key[half] & mask)) { - parity_err++; - key[half] |= mask; - } - } else { - if (key[half] & mask) { - parity_err++; - key[half] &= ~mask; - } - } - mask >>= 1; - } - } - - /* - * Return the result of the parity check. - */ - return (parity_err == 0); -} -#else -int authparity_bs; -#endif /* DES */ |