aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/ntp/sntp
diff options
context:
space:
mode:
authorXin LI <delphij@FreeBSD.org>2016-12-22 16:19:05 +0000
committerXin LI <delphij@FreeBSD.org>2016-12-22 16:19:05 +0000
commitb06b7e647fe7b4eefbd29369cf0c24e1902bf72a (patch)
treed18590df36faea870c6827c64a75516475938e4d /contrib/ntp/sntp
parent8c7ff71d356bdceffa6cd5b5017c65d0d63d9abc (diff)
downloadsrc-b06b7e647fe7b4eefbd29369cf0c24e1902bf72a.tar.gz
src-b06b7e647fe7b4eefbd29369cf0c24e1902bf72a.zip
Fix multiple vulnerabilities of ntp.releng/9.3
Approved by: so
Notes
Notes: svn path=/releng/9.3/; revision=310419
Diffstat (limited to 'contrib/ntp/sntp')
-rwxr-xr-xcontrib/ntp/sntp/configure20
-rw-r--r--contrib/ntp/sntp/crypto.c18
-rw-r--r--contrib/ntp/sntp/include/version.def2
-rw-r--r--contrib/ntp/sntp/include/version.texi6
-rw-r--r--contrib/ntp/sntp/invoke-sntp.texi4
-rw-r--r--contrib/ntp/sntp/m4/version.m42
-rw-r--r--contrib/ntp/sntp/sntp-opts.c14
-rw-r--r--contrib/ntp/sntp/sntp-opts.h6
-rw-r--r--contrib/ntp/sntp/sntp.1sntpman6
-rw-r--r--contrib/ntp/sntp/sntp.1sntpmdoc6
-rw-r--r--contrib/ntp/sntp/sntp.html4
-rw-r--r--contrib/ntp/sntp/sntp.man.in6
-rw-r--r--contrib/ntp/sntp/sntp.mdoc.in4
-rw-r--r--contrib/ntp/sntp/tests/packetProcessing.c196
-rw-r--r--contrib/ntp/sntp/tests/run-packetProcessing.c36
-rw-r--r--contrib/ntp/sntp/unity/Makefile.am2
-rw-r--r--contrib/ntp/sntp/unity/Makefile.in37
-rw-r--r--contrib/ntp/sntp/unity/ulib_setup.c14
-rw-r--r--contrib/ntp/sntp/unity/ulib_teardown.c13
-rw-r--r--contrib/ntp/sntp/unity/unity_fixture.c4
-rw-r--r--contrib/ntp/sntp/version.c2
21 files changed, 241 insertions, 161 deletions
diff --git a/contrib/ntp/sntp/configure b/contrib/ntp/sntp/configure
index db89397bc0e6..45431df9d37c 100755
--- a/contrib/ntp/sntp/configure
+++ b/contrib/ntp/sntp/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for sntp 4.2.8p8.
+# Generated by GNU Autoconf 2.69 for sntp 4.2.8p9.
#
# Report bugs to <http://bugs.ntp.org./>.
#
@@ -590,8 +590,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='sntp'
PACKAGE_TARNAME='sntp'
-PACKAGE_VERSION='4.2.8p8'
-PACKAGE_STRING='sntp 4.2.8p8'
+PACKAGE_VERSION='4.2.8p9'
+PACKAGE_STRING='sntp 4.2.8p9'
PACKAGE_BUGREPORT='http://bugs.ntp.org./'
PACKAGE_URL='http://www.ntp.org./'
@@ -1496,7 +1496,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures sntp 4.2.8p8 to adapt to many kinds of systems.
+\`configure' configures sntp 4.2.8p9 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1566,7 +1566,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of sntp 4.2.8p8:";;
+ short | recursive ) echo "Configuration of sntp 4.2.8p9:";;
esac
cat <<\_ACEOF
@@ -1712,7 +1712,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-sntp configure 4.2.8p8
+sntp configure 4.2.8p9
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2542,7 +2542,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by sntp $as_me 4.2.8p8, which was
+It was created by sntp $as_me 4.2.8p9, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -3539,7 +3539,7 @@ fi
# Define the identity of the package.
PACKAGE='sntp'
- VERSION='4.2.8p8'
+ VERSION='4.2.8p9'
cat >>confdefs.h <<_ACEOF
@@ -31184,7 +31184,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by sntp $as_me 4.2.8p8, which was
+This file was extended by sntp $as_me 4.2.8p9, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -31251,7 +31251,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-sntp config.status 4.2.8p8
+sntp config.status 4.2.8p9
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
diff --git a/contrib/ntp/sntp/crypto.c b/contrib/ntp/sntp/crypto.c
index a534239a31f8..7b4e63833ac1 100644
--- a/contrib/ntp/sntp/crypto.c
+++ b/contrib/ntp/sntp/crypto.c
@@ -2,6 +2,7 @@
#include "crypto.h"
#include <ctype.h>
#include "isc/string.h"
+#include "libssl_compat.h"
struct key *key_ptr;
size_t key_cnt = 0;
@@ -17,7 +18,7 @@ make_mac(
{
u_int len = mac_size;
int key_type;
- EVP_MD_CTX ctx;
+ EVP_MD_CTX * ctx;
if (cmp_key->key_len > 64)
return 0;
@@ -26,11 +27,14 @@ make_mac(
INIT_SSL();
key_type = keytype_from_text(cmp_key->type, NULL);
- EVP_DigestInit(&ctx, EVP_get_digestbynid(key_type));
- EVP_DigestUpdate(&ctx, (const u_char *)cmp_key->key_seq, (u_int)cmp_key->key_len);
- EVP_DigestUpdate(&ctx, pkt_data, (u_int)pkt_size);
- EVP_DigestFinal(&ctx, digest, &len);
-
+
+ ctx = EVP_MD_CTX_new();
+ EVP_DigestInit(ctx, EVP_get_digestbynid(key_type));
+ EVP_DigestUpdate(ctx, (const u_char *)cmp_key->key_seq, (u_int)cmp_key->key_len);
+ EVP_DigestUpdate(ctx, pkt_data, (u_int)pkt_size);
+ EVP_DigestFinal(ctx, digest, &len);
+ EVP_MD_CTX_free(ctx);
+
return (int)len;
}
@@ -64,7 +68,7 @@ auth_md5(
* with. sntp is a 1-shot program, so snooping for
* timing attacks is Harder.
*/
- authentic = !memcmp(digest, pkt_data + pkt_size + 4,
+ authentic = !memcmp(digest, (const char*)pkt_data + pkt_size + 4,
hash_len);
}
return authentic;
diff --git a/contrib/ntp/sntp/include/version.def b/contrib/ntp/sntp/include/version.def
index add303dcf9cc..6886dc2191c9 100644
--- a/contrib/ntp/sntp/include/version.def
+++ b/contrib/ntp/sntp/include/version.def
@@ -1 +1 @@
-version = '4.2.8p8';
+version = '4.2.8p9';
diff --git a/contrib/ntp/sntp/include/version.texi b/contrib/ntp/sntp/include/version.texi
index 9f303b21024a..7099eb825c57 100644
--- a/contrib/ntp/sntp/include/version.texi
+++ b/contrib/ntp/sntp/include/version.texi
@@ -1,3 +1,3 @@
-@set UPDATED 02 June 2016
-@set EDITION 4.2.8p8
-@set VERSION 4.2.8p8
+@set UPDATED 21 November 2016
+@set EDITION 4.2.8p9
+@set VERSION 4.2.8p9
diff --git a/contrib/ntp/sntp/invoke-sntp.texi b/contrib/ntp/sntp/invoke-sntp.texi
index 256ff86a30cc..4879df3c6c28 100644
--- a/contrib/ntp/sntp/invoke-sntp.texi
+++ b/contrib/ntp/sntp/invoke-sntp.texi
@@ -6,7 +6,7 @@
#
# EDIT THIS FILE WITH CAUTION (invoke-sntp.texi)
#
-# It has been AutoGen-ed June 2, 2016 at 07:19:58 AM by AutoGen 5.18.5
+# It has been AutoGen-ed November 21, 2016 at 07:58:29 AM by AutoGen 5.18.5
# From the definitions sntp-opts.def
# and the template file agtexi-cmd.tpl
@end ignore
@@ -101,7 +101,7 @@ with a status code of 0.
@exampleindent 0
@example
-sntp - standard Simple Network Time Protocol client program - Ver. 4.2.8p8
+sntp - standard Simple Network Time Protocol client program - Ver. 4.2.8p9
Usage: sntp [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... \
[ hostname-or-IP ...]
Flg Arg Option-Name Description
diff --git a/contrib/ntp/sntp/m4/version.m4 b/contrib/ntp/sntp/m4/version.m4
index 35297303ac4f..8366527bd27e 100644
--- a/contrib/ntp/sntp/m4/version.m4
+++ b/contrib/ntp/sntp/m4/version.m4
@@ -1 +1 @@
-m4_define([VERSION_NUMBER],[4.2.8p8])
+m4_define([VERSION_NUMBER],[4.2.8p9])
diff --git a/contrib/ntp/sntp/sntp-opts.c b/contrib/ntp/sntp/sntp-opts.c
index e469d3e76ca0..014b9642a12c 100644
--- a/contrib/ntp/sntp/sntp-opts.c
+++ b/contrib/ntp/sntp/sntp-opts.c
@@ -1,7 +1,7 @@
/*
* EDIT THIS FILE WITH CAUTION (sntp-opts.c)
*
- * It has been AutoGen-ed June 2, 2016 at 07:18:42 AM by AutoGen 5.18.5
+ * It has been AutoGen-ed November 21, 2016 at 07:38:40 AM by AutoGen 5.18.5
* From the definitions sntp-opts.def
* and the template file options
*
@@ -70,7 +70,7 @@ extern FILE * option_usage_fp;
* static const strings for sntp options
*/
static char const sntp_opt_strs[2549] =
-/* 0 */ "sntp 4.2.8p8\n"
+/* 0 */ "sntp 4.2.8p9\n"
"Copyright (C) 1992-2016 The University of Delaware and Network Time Foundation, all rights reserved.\n"
"This is free software. It is licensed for use, modification and\n"
"redistribution under the terms of the NTP License, copies of which\n"
@@ -155,7 +155,7 @@ static char const sntp_opt_strs[2549] =
/* 2298 */ "LOAD_OPTS\0"
/* 2308 */ "no-load-opts\0"
/* 2321 */ "SNTP\0"
-/* 2326 */ "sntp - standard Simple Network Time Protocol client program - Ver. 4.2.8p8\n"
+/* 2326 */ "sntp - standard Simple Network Time Protocol client program - Ver. 4.2.8p9\n"
"Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \\\n"
"\t\t[ hostname-or-IP ...]\n\0"
/* 2485 */ "$HOME\0"
@@ -163,7 +163,7 @@ static char const sntp_opt_strs[2549] =
/* 2493 */ ".ntprc\0"
/* 2500 */ "http://bugs.ntp.org, bugs@ntp.org\0"
/* 2534 */ "\n\0"
-/* 2536 */ "sntp 4.2.8p8";
+/* 2536 */ "sntp 4.2.8p9";
/**
* ipv4 option description with
@@ -1173,7 +1173,7 @@ static void bogus_function(void) {
translate option names.
*/
/* referenced via sntpOptions.pzCopyright */
- puts(_("sntp 4.2.8p8\n\
+ puts(_("sntp 4.2.8p9\n\
Copyright (C) 1992-2016 The University of Delaware and Network Time Foundation, all rights reserved.\n\
This is free software. It is licensed for use, modification and\n\
redistribution under the terms of the NTP License, copies of which\n\
@@ -1263,7 +1263,7 @@ implied warranty.\n"));
puts(_("load options from a config file"));
/* referenced via sntpOptions.pzUsageTitle */
- puts(_("sntp - standard Simple Network Time Protocol client program - Ver. 4.2.8p8\n\
+ puts(_("sntp - standard Simple Network Time Protocol client program - Ver. 4.2.8p9\n\
Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \\\n\
\t\t[ hostname-or-IP ...]\n"));
@@ -1271,7 +1271,7 @@ Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \\\n\
puts(_("\n"));
/* referenced via sntpOptions.pzFullVersion */
- puts(_("sntp 4.2.8p8"));
+ puts(_("sntp 4.2.8p9"));
/* referenced via sntpOptions.pzFullUsage */
puts(_("<<<NOT-FOUND>>>"));
diff --git a/contrib/ntp/sntp/sntp-opts.h b/contrib/ntp/sntp/sntp-opts.h
index 9136f28091d3..09aea49d653c 100644
--- a/contrib/ntp/sntp/sntp-opts.h
+++ b/contrib/ntp/sntp/sntp-opts.h
@@ -1,7 +1,7 @@
/*
* EDIT THIS FILE WITH CAUTION (sntp-opts.h)
*
- * It has been AutoGen-ed June 2, 2016 at 07:18:40 AM by AutoGen 5.18.5
+ * It has been AutoGen-ed November 21, 2016 at 07:38:39 AM by AutoGen 5.18.5
* From the definitions sntp-opts.def
* and the template file options
*
@@ -91,9 +91,9 @@ typedef enum {
/** count of all options for sntp */
#define OPTION_CT 23
/** sntp version */
-#define SNTP_VERSION "4.2.8p8"
+#define SNTP_VERSION "4.2.8p9"
/** Full sntp version text */
-#define SNTP_FULL_VERSION "sntp 4.2.8p8"
+#define SNTP_FULL_VERSION "sntp 4.2.8p9"
/**
* Interface defines for all options. Replace "n" with the UPPER_CASED
diff --git a/contrib/ntp/sntp/sntp.1sntpman b/contrib/ntp/sntp/sntp.1sntpman
index 6921dd30d5cc..775b10ef0bd3 100644
--- a/contrib/ntp/sntp/sntp.1sntpman
+++ b/contrib/ntp/sntp/sntp.1sntpman
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
-.TH sntp 1sntpman "02 Jun 2016" "4.2.8p8" "User Commands"
+.TH sntp 1sntpman "21 Nov 2016" "4.2.8p9" "User Commands"
.\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-5CayKq/ag-fDaqJq)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-Mfai12/ag-0faa02)
.\"
-.\" It has been AutoGen-ed June 2, 2016 at 07:19:39 AM by AutoGen 5.18.5
+.\" It has been AutoGen-ed November 21, 2016 at 07:58:25 AM by AutoGen 5.18.5
.\" From the definitions sntp-opts.def
.\" and the template file agman-cmd.tpl
.SH NAME
diff --git a/contrib/ntp/sntp/sntp.1sntpmdoc b/contrib/ntp/sntp/sntp.1sntpmdoc
index 8025d49a5f3f..f4b1f6f180a7 100644
--- a/contrib/ntp/sntp/sntp.1sntpmdoc
+++ b/contrib/ntp/sntp/sntp.1sntpmdoc
@@ -1,9 +1,9 @@
-.Dd June 2 2016
+.Dd November 21 2016
.Dt SNTP 1sntpmdoc User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (sntp-opts.mdoc)
.\"
-.\" It has been AutoGen-ed June 2, 2016 at 07:20:03 AM by AutoGen 5.18.5
+.\" It has been AutoGen-ed November 21, 2016 at 07:58:32 AM by AutoGen 5.18.5
.\" From the definitions sntp-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
@@ -211,7 +211,7 @@ of seconds specified before giving up. The default should be
more than enough for a unicast response. If \fBsntp\fP is
only waiting for a broadcast response a longer timeout is
likely needed.
-.It Fl \-wait , " Fl \-no\-wait"
+.It Fl \-wait , Fl \-no\-wait
Wait for pending replies (if not setting the time).
The \fIno\-wait\fP form will disable the option.
This option is enabled by default.
diff --git a/contrib/ntp/sntp/sntp.html b/contrib/ntp/sntp/sntp.html
index 46bad278df1b..212cc501e1a2 100644
--- a/contrib/ntp/sntp/sntp.html
+++ b/contrib/ntp/sntp/sntp.html
@@ -36,7 +36,7 @@ display the time offset of the system clock relative to the server
clock. Run as root, it can correct the system clock to this offset as
well. It can be run as an interactive command or from a cron job.
- <p>This document applies to version 4.2.8p8 of <code>sntp</code>.
+ <p>This document applies to version 4.2.8p9 of <code>sntp</code>.
<p>The program implements the SNTP protocol as defined by RFC 5905, the NTPv4
IETF specification.
@@ -176,7 +176,7 @@ the usage text by passing it through a pager program.
used to select the program, defaulting to <span class="file">more</span>. Both will exit
with a status code of 0.
-<pre class="example">sntp - standard Simple Network Time Protocol client program - Ver. 4.2.8p8
+<pre class="example">sntp - standard Simple Network Time Protocol client program - Ver. 4.2.8p9
Usage: sntp [ -&lt;flag&gt; [&lt;val&gt;] | --&lt;name&gt;[{=| }&lt;val&gt;] ]... \
[ hostname-or-IP ...]
Flg Arg Option-Name Description
diff --git a/contrib/ntp/sntp/sntp.man.in b/contrib/ntp/sntp/sntp.man.in
index 899c49a5c4fd..6fee92a6db08 100644
--- a/contrib/ntp/sntp/sntp.man.in
+++ b/contrib/ntp/sntp/sntp.man.in
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
-.TH sntp @SNTP_MS@ "02 Jun 2016" "4.2.8p8" "User Commands"
+.TH sntp @SNTP_MS@ "21 Nov 2016" "4.2.8p9" "User Commands"
.\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-5CayKq/ag-fDaqJq)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-Mfai12/ag-0faa02)
.\"
-.\" It has been AutoGen-ed June 2, 2016 at 07:19:39 AM by AutoGen 5.18.5
+.\" It has been AutoGen-ed November 21, 2016 at 07:58:25 AM by AutoGen 5.18.5
.\" From the definitions sntp-opts.def
.\" and the template file agman-cmd.tpl
.SH NAME
diff --git a/contrib/ntp/sntp/sntp.mdoc.in b/contrib/ntp/sntp/sntp.mdoc.in
index 71dd22460fab..19a20ca806e0 100644
--- a/contrib/ntp/sntp/sntp.mdoc.in
+++ b/contrib/ntp/sntp/sntp.mdoc.in
@@ -1,9 +1,9 @@
-.Dd June 2 2016
+.Dd November 21 2016
.Dt SNTP @SNTP_MS@ User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (sntp-opts.mdoc)
.\"
-.\" It has been AutoGen-ed June 2, 2016 at 07:20:03 AM by AutoGen 5.18.5
+.\" It has been AutoGen-ed November 21, 2016 at 07:58:32 AM by AutoGen 5.18.5
.\" From the definitions sntp-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
diff --git a/contrib/ntp/sntp/tests/packetProcessing.c b/contrib/ntp/sntp/tests/packetProcessing.c
index 88e61cc89d91..660b5b6e20f1 100644
--- a/contrib/ntp/sntp/tests/packetProcessing.c
+++ b/contrib/ntp/sntp/tests/packetProcessing.c
@@ -1,10 +1,5 @@
#include "config.h"
-/* need autokey for some of the tests, or the will create buffer overruns. */
-#ifndef AUTOKEY
-# define AUTOKEY 1
-#endif
-
#include "sntptest.h"
#include "networking.h"
#include "ntp_stdlib.h"
@@ -13,7 +8,7 @@
const char * Version = "stub unit test Version string";
-// Hacks into the key database.
+/* Hacks into the key database. */
extern struct key* key_ptr;
extern int key_cnt;
@@ -41,9 +36,25 @@ void test_CorrectUnauthenticatedPacket(void);
void test_CorrectAuthenticatedPacketMD5(void);
void test_CorrectAuthenticatedPacketSHA1(void);
+/* [Bug 2998] There are some issues whith the definition of 'struct pkt'
+ * when AUTOKEY is undefined -- the formal struct is too small to hold
+ * all the extension fields that are going to be tested. We have to make
+ * sure we have the extra bytes, or the test yield undefined results due
+ * to buffer overrun.
+ */
+#ifndef AUTOKEY
+# define EXTRA_BUFSIZE 256
+#else
+# define EXTRA_BUFSIZE 0
+#endif
+
+union tpkt {
+ struct pkt p;
+ u_char b[sizeof(struct pkt) + EXTRA_BUFSIZE];
+};
-static struct pkt testpkt;
-static struct pkt testspkt;
+static union tpkt testpkt;
+static union tpkt testspkt;
static sockaddr_u testsock;
bool restoreKeyDb;
@@ -95,10 +106,10 @@ setUp(void)
/* Initialize the test packet and socket,
* so they contain at least some valid data.
*/
- testpkt.li_vn_mode = PKT_LI_VN_MODE(LEAP_NOWARNING, NTP_VERSION,
+ testpkt.p.li_vn_mode = PKT_LI_VN_MODE(LEAP_NOWARNING, NTP_VERSION,
MODE_SERVER);
- testpkt.stratum = STRATUM_REFCLOCK;
- memcpy(&testpkt.refid, "GPS\0", 4);
+ testpkt.p.stratum = STRATUM_REFCLOCK;
+ memcpy(&testpkt.p.refid, "GPS\0", 4);
/* Set the origin timestamp of the received packet to the
* same value as the transmit timestamp of the sent packet.
@@ -107,8 +118,8 @@ setUp(void)
tmp.l_ui = 1000UL;
tmp.l_uf = 0UL;
- HTONL_FP(&tmp, &testpkt.org);
- HTONL_FP(&tmp, &testspkt.xmt);
+ HTONL_FP(&tmp, &testpkt.p.org);
+ HTONL_FP(&tmp, &testspkt.p.xmt);
}
@@ -129,11 +140,11 @@ void
test_TooShortLength(void)
{
TEST_ASSERT_EQUAL(PACKET_UNUSEABLE,
- process_pkt(&testpkt, &testsock, LEN_PKT_NOMAC - 1,
- MODE_SERVER, &testspkt, "UnitTest"));
+ process_pkt(&testpkt.p, &testsock, LEN_PKT_NOMAC - 1,
+ MODE_SERVER, &testspkt.p, "UnitTest"));
TEST_ASSERT_EQUAL(PACKET_UNUSEABLE,
- process_pkt(&testpkt, &testsock, LEN_PKT_NOMAC - 1,
- MODE_BROADCAST, &testspkt, "UnitTest"));
+ process_pkt(&testpkt.p, &testsock, LEN_PKT_NOMAC - 1,
+ MODE_BROADCAST, &testspkt.p, "UnitTest"));
}
@@ -141,22 +152,29 @@ void
test_LengthNotMultipleOfFour(void)
{
TEST_ASSERT_EQUAL(PACKET_UNUSEABLE,
- process_pkt(&testpkt, &testsock, LEN_PKT_NOMAC + 6,
- MODE_SERVER, &testspkt, "UnitTest"));
+ process_pkt(&testpkt.p, &testsock, LEN_PKT_NOMAC + 6,
+ MODE_SERVER, &testspkt.p, "UnitTest"));
TEST_ASSERT_EQUAL(PACKET_UNUSEABLE,
- process_pkt(&testpkt, &testsock, LEN_PKT_NOMAC + 3,
- MODE_BROADCAST, &testspkt, "UnitTest"));
+ process_pkt(&testpkt.p, &testsock, LEN_PKT_NOMAC + 3,
+ MODE_BROADCAST, &testspkt.p, "UnitTest"));
}
void
test_TooShortExtensionFieldLength(void)
{
+ /* [Bug 2998] We have to get around the formal specification of
+ * the extension field if AUTOKEY is undefined. (At least CLANG
+ * issues a warning in this case. It's just a warning, but
+ * still...
+ */
+ uint32_t * pe = testpkt.p.exten + 7;
+
/* The lower 16-bits are the length of the extension field.
* This lengths must be multiples of 4 bytes, which gives
* a minimum of 4 byte extension field length.
*/
- testpkt.exten[7] = htonl(3); /* 3 bytes is too short. */
+ *pe = htonl(3); /* 3 bytes is too short. */
/* We send in a pkt_len of header size + 4 byte extension
* header + 24 byte MAC, this prevents the length error to
@@ -165,8 +183,8 @@ test_TooShortExtensionFieldLength(void)
int pkt_len = LEN_PKT_NOMAC + 4 + 24;
TEST_ASSERT_EQUAL(PACKET_UNUSEABLE,
- process_pkt(&testpkt, &testsock, pkt_len,
- MODE_SERVER, &testspkt, "UnitTest"));
+ process_pkt(&testpkt.p, &testsock, pkt_len,
+ MODE_SERVER, &testspkt.p, "UnitTest"));
}
@@ -181,8 +199,8 @@ test_UnauthenticatedPacketReject(void)
/* We demand authentication, but no MAC header is present. */
TEST_ASSERT_EQUAL(SERVER_AUTH_FAIL,
- process_pkt(&testpkt, &testsock, pkt_len,
- MODE_SERVER, &testspkt, "UnitTest"));
+ process_pkt(&testpkt.p, &testsock, pkt_len,
+ MODE_SERVER, &testspkt.p, "UnitTest"));
}
@@ -196,8 +214,8 @@ test_CryptoNAKPacketReject(void)
int pkt_len = LEN_PKT_NOMAC + 4; /* + 4 byte MAC = Crypto-NAK */
TEST_ASSERT_EQUAL(SERVER_AUTH_FAIL,
- process_pkt(&testpkt, &testsock, pkt_len,
- MODE_SERVER, &testspkt, "UnitTest"));
+ process_pkt(&testpkt.p, &testsock, pkt_len,
+ MODE_SERVER, &testspkt.p, "UnitTest"));
}
@@ -211,19 +229,19 @@ test_AuthenticatedPacketInvalid(void)
/* Prepare the packet. */
int pkt_len = LEN_PKT_NOMAC;
- testpkt.exten[0] = htonl(50);
- int mac_len = make_mac(&testpkt, pkt_len,
+ testpkt.p.exten[0] = htonl(50);
+ int mac_len = make_mac(&testpkt.p, pkt_len,
MAX_MD5_LEN, key_ptr,
- &testpkt.exten[1]);
+ &testpkt.p.exten[1]);
pkt_len += 4 + mac_len;
/* Now, alter the MAC so it becomes invalid. */
- testpkt.exten[1] += 1;
+ testpkt.p.exten[1] += 1;
TEST_ASSERT_EQUAL(SERVER_AUTH_FAIL,
- process_pkt(&testpkt, &testsock, pkt_len,
- MODE_SERVER, &testspkt, "UnitTest"));
+ process_pkt(&testpkt.p, &testsock, pkt_len,
+ MODE_SERVER, &testspkt.p, "UnitTest"));
}
@@ -239,15 +257,15 @@ test_AuthenticatedPacketUnknownKey(void)
*/
int pkt_len = LEN_PKT_NOMAC;
- testpkt.exten[0] = htonl(50);
- int mac_len = make_mac(&testpkt, pkt_len,
+ testpkt.p.exten[0] = htonl(50);
+ int mac_len = make_mac(&testpkt.p, pkt_len,
MAX_MD5_LEN, key_ptr,
- &testpkt.exten[1]);
+ &testpkt.p.exten[1]);
pkt_len += 4 + mac_len;
TEST_ASSERT_EQUAL(SERVER_AUTH_FAIL,
- process_pkt(&testpkt, &testsock, pkt_len,
- MODE_SERVER, &testspkt, "UnitTest"));
+ process_pkt(&testpkt.p, &testsock, pkt_len,
+ MODE_SERVER, &testspkt.p, "UnitTest"));
}
@@ -256,16 +274,16 @@ test_ServerVersionTooOld(void)
{
TEST_ASSERT_FALSE(ENABLED_OPT(AUTHENTICATION));
- testpkt.li_vn_mode = PKT_LI_VN_MODE(LEAP_NOWARNING,
- NTP_OLDVERSION - 1,
- MODE_CLIENT);
- TEST_ASSERT_TRUE(PKT_VERSION(testpkt.li_vn_mode) < NTP_OLDVERSION);
+ testpkt.p.li_vn_mode = PKT_LI_VN_MODE(LEAP_NOWARNING,
+ NTP_OLDVERSION - 1,
+ MODE_CLIENT);
+ TEST_ASSERT_TRUE(PKT_VERSION(testpkt.p.li_vn_mode) < NTP_OLDVERSION);
int pkt_len = LEN_PKT_NOMAC;
TEST_ASSERT_EQUAL(SERVER_UNUSEABLE,
- process_pkt(&testpkt, &testsock, pkt_len,
- MODE_SERVER, &testspkt, "UnitTest"));
+ process_pkt(&testpkt.p, &testsock, pkt_len,
+ MODE_SERVER, &testspkt.p, "UnitTest"));
}
@@ -274,16 +292,16 @@ test_ServerVersionTooNew(void)
{
TEST_ASSERT_FALSE(ENABLED_OPT(AUTHENTICATION));
- testpkt.li_vn_mode = PKT_LI_VN_MODE(LEAP_NOWARNING,
- NTP_VERSION + 1,
- MODE_CLIENT);
- TEST_ASSERT_TRUE(PKT_VERSION(testpkt.li_vn_mode) > NTP_VERSION);
+ testpkt.p.li_vn_mode = PKT_LI_VN_MODE(LEAP_NOWARNING,
+ NTP_VERSION + 1,
+ MODE_CLIENT);
+ TEST_ASSERT_TRUE(PKT_VERSION(testpkt.p.li_vn_mode) > NTP_VERSION);
int pkt_len = LEN_PKT_NOMAC;
TEST_ASSERT_EQUAL(SERVER_UNUSEABLE,
- process_pkt(&testpkt, &testsock, pkt_len,
- MODE_SERVER, &testspkt, "UnitTest"));
+ process_pkt(&testpkt.p, &testsock, pkt_len,
+ MODE_SERVER, &testspkt.p, "UnitTest"));
}
@@ -292,16 +310,16 @@ test_NonWantedMode(void)
{
TEST_ASSERT_FALSE(ENABLED_OPT(AUTHENTICATION));
- testpkt.li_vn_mode = PKT_LI_VN_MODE(LEAP_NOWARNING,
- NTP_VERSION,
- MODE_CLIENT);
+ testpkt.p.li_vn_mode = PKT_LI_VN_MODE(LEAP_NOWARNING,
+ NTP_VERSION,
+ MODE_CLIENT);
/* The packet has a mode of MODE_CLIENT, but process_pkt expects
* MODE_SERVER
*/
TEST_ASSERT_EQUAL(SERVER_UNUSEABLE,
- process_pkt(&testpkt, &testsock, LEN_PKT_NOMAC,
- MODE_SERVER, &testspkt, "UnitTest"));
+ process_pkt(&testpkt.p, &testsock, LEN_PKT_NOMAC,
+ MODE_SERVER, &testspkt.p, "UnitTest"));
}
@@ -311,12 +329,12 @@ test_KoDRate(void)
{
TEST_ASSERT_FALSE(ENABLED_OPT(AUTHENTICATION));
- testpkt.stratum = STRATUM_PKT_UNSPEC;
- memcpy(&testpkt.refid, "RATE", 4);
+ testpkt.p.stratum = STRATUM_PKT_UNSPEC;
+ memcpy(&testpkt.p.refid, "RATE", 4);
TEST_ASSERT_EQUAL(KOD_RATE,
- process_pkt(&testpkt, &testsock, LEN_PKT_NOMAC,
- MODE_SERVER, &testspkt, "UnitTest"));
+ process_pkt(&testpkt.p, &testsock, LEN_PKT_NOMAC,
+ MODE_SERVER, &testspkt.p, "UnitTest"));
}
@@ -325,12 +343,12 @@ test_KoDDeny(void)
{
TEST_ASSERT_FALSE(ENABLED_OPT(AUTHENTICATION));
- testpkt.stratum = STRATUM_PKT_UNSPEC;
- memcpy(&testpkt.refid, "DENY", 4);
+ testpkt.p.stratum = STRATUM_PKT_UNSPEC;
+ memcpy(&testpkt.p.refid, "DENY", 4);
TEST_ASSERT_EQUAL(KOD_DEMOBILIZE,
- process_pkt(&testpkt, &testsock, LEN_PKT_NOMAC,
- MODE_SERVER, &testspkt, "UnitTest"));
+ process_pkt(&testpkt.p, &testsock, LEN_PKT_NOMAC,
+ MODE_SERVER, &testspkt.p, "UnitTest"));
}
@@ -339,13 +357,13 @@ test_RejectUnsyncedServer(void)
{
TEST_ASSERT_FALSE(ENABLED_OPT(AUTHENTICATION));
- testpkt.li_vn_mode = PKT_LI_VN_MODE(LEAP_NOTINSYNC,
- NTP_VERSION,
- MODE_SERVER);
+ testpkt.p.li_vn_mode = PKT_LI_VN_MODE(LEAP_NOTINSYNC,
+ NTP_VERSION,
+ MODE_SERVER);
TEST_ASSERT_EQUAL(SERVER_UNUSEABLE,
- process_pkt(&testpkt, &testsock, LEN_PKT_NOMAC,
- MODE_SERVER, &testspkt, "UnitTest"));
+ process_pkt(&testpkt.p, &testsock, LEN_PKT_NOMAC,
+ MODE_SERVER, &testspkt.p, "UnitTest"));
}
@@ -357,15 +375,15 @@ test_RejectWrongResponseServerMode(void)
l_fp tmp;
tmp.l_ui = 1000UL;
tmp.l_uf = 0UL;
- HTONL_FP(&tmp, &testpkt.org);
+ HTONL_FP(&tmp, &testpkt.p.org);
tmp.l_ui = 2000UL;
tmp.l_uf = 0UL;
- HTONL_FP(&tmp, &testspkt.xmt);
+ HTONL_FP(&tmp, &testspkt.p.xmt);
TEST_ASSERT_EQUAL(PACKET_UNUSEABLE,
- process_pkt(&testpkt, &testsock, LEN_PKT_NOMAC,
- MODE_SERVER, &testspkt, "UnitTest"));
+ process_pkt(&testpkt.p, &testsock, LEN_PKT_NOMAC,
+ MODE_SERVER, &testspkt.p, "UnitTest"));
}
@@ -374,12 +392,12 @@ test_AcceptNoSentPacketBroadcastMode(void)
{
TEST_ASSERT_FALSE(ENABLED_OPT(AUTHENTICATION));
- testpkt.li_vn_mode = PKT_LI_VN_MODE(LEAP_NOWARNING,
- NTP_VERSION,
- MODE_BROADCAST);
+ testpkt.p.li_vn_mode = PKT_LI_VN_MODE(LEAP_NOWARNING,
+ NTP_VERSION,
+ MODE_BROADCAST);
TEST_ASSERT_EQUAL(LEN_PKT_NOMAC,
- process_pkt(&testpkt, &testsock, LEN_PKT_NOMAC,
+ process_pkt(&testpkt.p, &testsock, LEN_PKT_NOMAC,
MODE_BROADCAST, NULL, "UnitTest"));
}
@@ -390,8 +408,8 @@ test_CorrectUnauthenticatedPacket(void)
TEST_ASSERT_FALSE(ENABLED_OPT(AUTHENTICATION));
TEST_ASSERT_EQUAL(LEN_PKT_NOMAC,
- process_pkt(&testpkt, &testsock, LEN_PKT_NOMAC,
- MODE_SERVER, &testspkt, "UnitTest"));
+ process_pkt(&testpkt.p, &testsock, LEN_PKT_NOMAC,
+ MODE_SERVER, &testspkt.p, "UnitTest"));
}
@@ -404,16 +422,16 @@ test_CorrectAuthenticatedPacketMD5(void)
int pkt_len = LEN_PKT_NOMAC;
/* Prepare the packet. */
- testpkt.exten[0] = htonl(10);
- int mac_len = make_mac(&testpkt, pkt_len,
+ testpkt.p.exten[0] = htonl(10);
+ int mac_len = make_mac(&testpkt.p, pkt_len,
MAX_MD5_LEN, key_ptr,
- &testpkt.exten[1]);
+ &testpkt.p.exten[1]);
pkt_len += 4 + mac_len;
TEST_ASSERT_EQUAL(pkt_len,
- process_pkt(&testpkt, &testsock, pkt_len,
- MODE_SERVER, &testspkt, "UnitTest"));
+ process_pkt(&testpkt.p, &testsock, pkt_len,
+ MODE_SERVER, &testspkt.p, "UnitTest"));
}
@@ -426,14 +444,14 @@ test_CorrectAuthenticatedPacketSHA1(void)
int pkt_len = LEN_PKT_NOMAC;
/* Prepare the packet. */
- testpkt.exten[0] = htonl(20);
- int mac_len = make_mac(&testpkt, pkt_len,
+ testpkt.p.exten[0] = htonl(20);
+ int mac_len = make_mac(&testpkt.p, pkt_len,
MAX_MAC_LEN, key_ptr,
- &testpkt.exten[1]);
+ &testpkt.p.exten[1]);
pkt_len += 4 + mac_len;
TEST_ASSERT_EQUAL(pkt_len,
- process_pkt(&testpkt, &testsock, pkt_len,
- MODE_SERVER, &testspkt, "UnitTest"));
+ process_pkt(&testpkt.p, &testsock, pkt_len,
+ MODE_SERVER, &testspkt.p, "UnitTest"));
}
diff --git a/contrib/ntp/sntp/tests/run-packetProcessing.c b/contrib/ntp/sntp/tests/run-packetProcessing.c
index ad02b7a543b1..38f855273c66 100644
--- a/contrib/ntp/sntp/tests/run-packetProcessing.c
+++ b/contrib/ntp/sntp/tests/run-packetProcessing.c
@@ -66,24 +66,24 @@ int main(int argc, char *argv[])
{
progname = argv[0];
UnityBegin("packetProcessing.c");
- RUN_TEST(test_TooShortLength, 25);
- RUN_TEST(test_LengthNotMultipleOfFour, 26);
- RUN_TEST(test_TooShortExtensionFieldLength, 27);
- RUN_TEST(test_UnauthenticatedPacketReject, 28);
- RUN_TEST(test_CryptoNAKPacketReject, 29);
- RUN_TEST(test_AuthenticatedPacketInvalid, 30);
- RUN_TEST(test_AuthenticatedPacketUnknownKey, 31);
- RUN_TEST(test_ServerVersionTooOld, 32);
- RUN_TEST(test_ServerVersionTooNew, 33);
- RUN_TEST(test_NonWantedMode, 34);
- RUN_TEST(test_KoDRate, 35);
- RUN_TEST(test_KoDDeny, 36);
- RUN_TEST(test_RejectUnsyncedServer, 37);
- RUN_TEST(test_RejectWrongResponseServerMode, 38);
- RUN_TEST(test_AcceptNoSentPacketBroadcastMode, 39);
- RUN_TEST(test_CorrectUnauthenticatedPacket, 40);
- RUN_TEST(test_CorrectAuthenticatedPacketMD5, 41);
- RUN_TEST(test_CorrectAuthenticatedPacketSHA1, 42);
+ RUN_TEST(test_TooShortLength, 20);
+ RUN_TEST(test_LengthNotMultipleOfFour, 21);
+ RUN_TEST(test_TooShortExtensionFieldLength, 22);
+ RUN_TEST(test_UnauthenticatedPacketReject, 23);
+ RUN_TEST(test_CryptoNAKPacketReject, 24);
+ RUN_TEST(test_AuthenticatedPacketInvalid, 25);
+ RUN_TEST(test_AuthenticatedPacketUnknownKey, 26);
+ RUN_TEST(test_ServerVersionTooOld, 27);
+ RUN_TEST(test_ServerVersionTooNew, 28);
+ RUN_TEST(test_NonWantedMode, 29);
+ RUN_TEST(test_KoDRate, 30);
+ RUN_TEST(test_KoDDeny, 31);
+ RUN_TEST(test_RejectUnsyncedServer, 32);
+ RUN_TEST(test_RejectWrongResponseServerMode, 33);
+ RUN_TEST(test_AcceptNoSentPacketBroadcastMode, 34);
+ RUN_TEST(test_CorrectUnauthenticatedPacket, 35);
+ RUN_TEST(test_CorrectAuthenticatedPacketMD5, 36);
+ RUN_TEST(test_CorrectAuthenticatedPacketSHA1, 37);
return (UnityEnd());
}
diff --git a/contrib/ntp/sntp/unity/Makefile.am b/contrib/ntp/sntp/unity/Makefile.am
index 31029ffcb5a6..71092a0d8056 100644
--- a/contrib/ntp/sntp/unity/Makefile.am
+++ b/contrib/ntp/sntp/unity/Makefile.am
@@ -12,6 +12,8 @@ libunity_a_CFLAGS = \
libunity_a_SOURCES = \
../libpkgver/colcomp.c \
unity.c \
+ ulib_setup.c \
+ ulib_teardown.c \
unity.h \
unity_config.h \
unity_internals.h \
diff --git a/contrib/ntp/sntp/unity/Makefile.in b/contrib/ntp/sntp/unity/Makefile.in
index e82e55e8f813..7c923970c611 100644
--- a/contrib/ntp/sntp/unity/Makefile.in
+++ b/contrib/ntp/sntp/unity/Makefile.in
@@ -134,8 +134,9 @@ libunity_a_AR = $(AR) $(ARFLAGS)
libunity_a_LIBADD =
am__objects_1 =
am_libunity_a_OBJECTS = libunity_a-colcomp.$(OBJEXT) \
- libunity_a-unity.$(OBJEXT) libunity_a-unity_fixture.$(OBJEXT) \
- $(am__objects_1)
+ libunity_a-unity.$(OBJEXT) libunity_a-ulib_setup.$(OBJEXT) \
+ libunity_a-ulib_teardown.$(OBJEXT) \
+ libunity_a-unity_fixture.$(OBJEXT) $(am__objects_1)
libunity_a_OBJECTS = $(am_libunity_a_OBJECTS)
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
@@ -453,6 +454,8 @@ libunity_a_CFLAGS = \
libunity_a_SOURCES = \
../libpkgver/colcomp.c \
unity.c \
+ ulib_setup.c \
+ ulib_teardown.c \
unity.h \
unity_config.h \
unity_internals.h \
@@ -518,6 +521,8 @@ distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libunity_a-colcomp.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libunity_a-ulib_setup.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libunity_a-ulib_teardown.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libunity_a-unity.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libunity_a-unity_fixture.Po@am__quote@
@@ -570,6 +575,34 @@ libunity_a-unity.obj: unity.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libunity_a_CFLAGS) $(CFLAGS) -c -o libunity_a-unity.obj `if test -f 'unity.c'; then $(CYGPATH_W) 'unity.c'; else $(CYGPATH_W) '$(srcdir)/unity.c'; fi`
+libunity_a-ulib_setup.o: ulib_setup.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libunity_a_CFLAGS) $(CFLAGS) -MT libunity_a-ulib_setup.o -MD -MP -MF $(DEPDIR)/libunity_a-ulib_setup.Tpo -c -o libunity_a-ulib_setup.o `test -f 'ulib_setup.c' || echo '$(srcdir)/'`ulib_setup.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libunity_a-ulib_setup.Tpo $(DEPDIR)/libunity_a-ulib_setup.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ulib_setup.c' object='libunity_a-ulib_setup.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libunity_a_CFLAGS) $(CFLAGS) -c -o libunity_a-ulib_setup.o `test -f 'ulib_setup.c' || echo '$(srcdir)/'`ulib_setup.c
+
+libunity_a-ulib_setup.obj: ulib_setup.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libunity_a_CFLAGS) $(CFLAGS) -MT libunity_a-ulib_setup.obj -MD -MP -MF $(DEPDIR)/libunity_a-ulib_setup.Tpo -c -o libunity_a-ulib_setup.obj `if test -f 'ulib_setup.c'; then $(CYGPATH_W) 'ulib_setup.c'; else $(CYGPATH_W) '$(srcdir)/ulib_setup.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libunity_a-ulib_setup.Tpo $(DEPDIR)/libunity_a-ulib_setup.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ulib_setup.c' object='libunity_a-ulib_setup.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libunity_a_CFLAGS) $(CFLAGS) -c -o libunity_a-ulib_setup.obj `if test -f 'ulib_setup.c'; then $(CYGPATH_W) 'ulib_setup.c'; else $(CYGPATH_W) '$(srcdir)/ulib_setup.c'; fi`
+
+libunity_a-ulib_teardown.o: ulib_teardown.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libunity_a_CFLAGS) $(CFLAGS) -MT libunity_a-ulib_teardown.o -MD -MP -MF $(DEPDIR)/libunity_a-ulib_teardown.Tpo -c -o libunity_a-ulib_teardown.o `test -f 'ulib_teardown.c' || echo '$(srcdir)/'`ulib_teardown.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libunity_a-ulib_teardown.Tpo $(DEPDIR)/libunity_a-ulib_teardown.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ulib_teardown.c' object='libunity_a-ulib_teardown.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libunity_a_CFLAGS) $(CFLAGS) -c -o libunity_a-ulib_teardown.o `test -f 'ulib_teardown.c' || echo '$(srcdir)/'`ulib_teardown.c
+
+libunity_a-ulib_teardown.obj: ulib_teardown.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libunity_a_CFLAGS) $(CFLAGS) -MT libunity_a-ulib_teardown.obj -MD -MP -MF $(DEPDIR)/libunity_a-ulib_teardown.Tpo -c -o libunity_a-ulib_teardown.obj `if test -f 'ulib_teardown.c'; then $(CYGPATH_W) 'ulib_teardown.c'; else $(CYGPATH_W) '$(srcdir)/ulib_teardown.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libunity_a-ulib_teardown.Tpo $(DEPDIR)/libunity_a-ulib_teardown.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ulib_teardown.c' object='libunity_a-ulib_teardown.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libunity_a_CFLAGS) $(CFLAGS) -c -o libunity_a-ulib_teardown.obj `if test -f 'ulib_teardown.c'; then $(CYGPATH_W) 'ulib_teardown.c'; else $(CYGPATH_W) '$(srcdir)/ulib_teardown.c'; fi`
+
libunity_a-unity_fixture.o: unity_fixture.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libunity_a_CFLAGS) $(CFLAGS) -MT libunity_a-unity_fixture.o -MD -MP -MF $(DEPDIR)/libunity_a-unity_fixture.Tpo -c -o libunity_a-unity_fixture.o `test -f 'unity_fixture.c' || echo '$(srcdir)/'`unity_fixture.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libunity_a-unity_fixture.Tpo $(DEPDIR)/libunity_a-unity_fixture.Po
diff --git a/contrib/ntp/sntp/unity/ulib_setup.c b/contrib/ntp/sntp/unity/ulib_setup.c
new file mode 100644
index 000000000000..41a3b38f2873
--- /dev/null
+++ b/contrib/ntp/sntp/unity/ulib_setup.c
@@ -0,0 +1,14 @@
+/* default / lib implementation of 'setUp()'
+ *
+ * SOLARIS does not support weak symbols -- need a real lib
+ * implemetation here.
+ */
+
+extern void setUp(void);
+
+void setUp(void)
+{
+ /* empty on purpose */
+}
+
+/* -*- that's all folks! -*- */
diff --git a/contrib/ntp/sntp/unity/ulib_teardown.c b/contrib/ntp/sntp/unity/ulib_teardown.c
new file mode 100644
index 000000000000..a36cdf942f8b
--- /dev/null
+++ b/contrib/ntp/sntp/unity/ulib_teardown.c
@@ -0,0 +1,13 @@
+/* default / lib implementation of 'tearDown()'
+ *
+ * SOLARIS does not support weak symbols -- need a real lib
+ * implemetation here.
+ */
+
+extern void tearDown(void);
+
+void tearDown(void)
+{
+ /* empty on purpose */
+}
+
diff --git a/contrib/ntp/sntp/unity/unity_fixture.c b/contrib/ntp/sntp/unity/unity_fixture.c
index 6bdbe5b82143..c45a9a7dd746 100644
--- a/contrib/ntp/sntp/unity/unity_fixture.c
+++ b/contrib/ntp/sntp/unity/unity_fixture.c
@@ -17,10 +17,6 @@ int (*outputChar)(int) = putchar;
int verbose = 0;
-void setUp(void);
-void tearDown(void);
-void setUp(void) { /*does nothing*/ }
-void tearDown(void) { /*does nothing*/ }
static void announceTestRun(unsigned int runNumber)
{
diff --git a/contrib/ntp/sntp/version.c b/contrib/ntp/sntp/version.c
index 38424f3f069f..1515ff2d2b0b 100644
--- a/contrib/ntp/sntp/version.c
+++ b/contrib/ntp/sntp/version.c
@@ -2,4 +2,4 @@
* version file for sntp
*/
#include <config.h>
-const char * Version = "sntp 4.2.8p7@1.3265-o Thu Jun 2 11:19:34 UTC 2016 (29)";
+const char * Version = "sntp 4.2.8p9@1.3265-o Mon Nov 21 12:58:21 UTC 2016 (31)";