+* [Bug 1697] filegen implementation should be improved.
+* Refactor calendar functions in terms of new common code.
(4.2.7p77) 2010/11/03 Released by Harlan Stenn <stenn@ntp.org>
* [Bug 1692] packageinfo.sh needs to be "sourced" using ./ .
* [Bug 1695] ntpdate takes longer than necessary.
esac
AC_C_CHAR_UNSIGNED dnl CROSS_COMPILE?
-AC_CHECK_SIZEOF(signed char)
-AC_CHECK_SIZEOF(int)
-AC_CHECK_SIZEOF(long)
+AC_CHECK_SIZEOF([signed char])
+AC_CHECK_SIZEOF([short])
+AC_CHECK_SIZEOF([int])
+AC_CHECK_SIZEOF([long])
AC_CHECK_TYPES([s_char])
case "$ac_cv_c_char_unsigned$ac_cv_sizeof_signed_char$ac_cv_type_s_char" in
# define HAVE_GETCLOCK
# define SIZEOF_SIGNED_CHAR 1
+# define SIZEOF_SHORT 2
# define SIZEOF_INT 4 /* for ntp_types.h */
# define HAVE_SETVBUF
# End Source File\r
# Begin Source File\r
\r
+SOURCE=..\..\..\libntp\ntp_calendar.c\r
+# End Source File\r
+# Begin Source File\r
+\r
SOURCE=..\..\..\libntp\ntp_lineedit.c\r
# End Source File\r
# Begin Source File\r
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
+ <File
+ RelativePath="..\..\..\libntp\ntp_calendar.c">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BasicRuntimeChecks="3"
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""/>
+ </FileConfiguration>
+ </File>
<File
RelativePath="..\..\..\libntp\ntp_lineedit.c">
<FileConfiguration
/>
</FileConfiguration>
</File>
+ <File
+ RelativePath="..\..\..\libntp\ntp_calendar.c"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
<File
RelativePath="..\..\..\libntp\ntp_lineedit.c"
>
RelativePath="..\..\..\..\lib\isc\netscope.c"
>
</File>
+ <File
+ RelativePath="..\..\..\..\libntp\ntp_calendar.c"
+ >
+ </File>
<File
RelativePath="..\..\..\..\libntp\ntp_lineedit.c"
>
>
</File>
<File
- RelativePath="..\..\..\..\lib\isc\win32\include\isc\time.h"
+ RelativePath="..\..\include\sys\time.h"
>
</File>
<File
- RelativePath="..\..\include\sys\time.h"
+ RelativePath="..\..\..\..\lib\isc\win32\include\isc\time.h"
>
</File>
<File
AC_C_CHAR_UNSIGNED dnl CROSS_COMPILE?
AC_CHECK_SIZEOF([signed char])
+AC_CHECK_SIZEOF([short])
AC_CHECK_SIZEOF([int])
AC_CHECK_SIZEOF([long])
EXPECT_TRUE(memcmp(EXPECTED_DIGEST, actual, MD5_LENGTH) == 0);
}
+#ifdef OPENSSL
TEST_F(cryptoTest, MakeSHA1Mac) {
const char* PKT_DATA = "abcdefgh0123";
const int PKT_LEN = strlen(PKT_DATA);
EXPECT_TRUE(memcmp(EXPECTED_DIGEST, actual, SHA1_LENGTH) == 0);
}
+#endif /* OPENSSL */
TEST_F(cryptoTest, VerifyCorrectMD5) {
const char* PKT_DATA =
EXPECT_TRUE(auth_md5((char*)PKT_DATA, PKT_LEN, MD5_LENGTH, &md5));
}
+#ifdef OPENSSL
TEST_F(cryptoTest, VerifySHA1) {
const char* PKT_DATA =
"sometestdata" // Data
EXPECT_TRUE(auth_md5((char*)PKT_DATA, PKT_LEN, SHA1_LENGTH, &sha1));
}
+#endif /* OPENSSL */
TEST_F(cryptoTest, VerifyFailure) {
/* We use a copy of the MD5 verification code, but modify
#include "libntptest.h"
extern "C" {
+#ifdef OPENSSL
+# include "openssl/err.h"
+# include "openssl/rand.h"
+# include "openssl/evp.h"
+#endif
#include "ntp.h"
#include "ntp_stdlib.h"
};
#include "libntptest.h"
extern "C" {
+#ifdef OPENSSL
+# include "openssl/err.h"
+# include "openssl/rand.h"
+# include "openssl/evp.h"
+#endif
#include "ntp.h"
#include "ntp_stdlib.h"
};
static const int UNUSED_REFCLOCK_ID = 250;
};
+#ifdef REFCLOCK /* clockname() is useless otherwise */
TEST_F(refnumtoaTest, LocalClock) {
/* We test with a refclock address of type LOCALCLOCK.
* with id 8
EXPECT_STREQ(expected.str().c_str(), refnumtoa(&address));
}
+#endif /* REFCLOCK */
+#ifdef REFCLOCK /* refnumtoa() is useless otherwise */
TEST_F(refnumtoaTest, UnknownId) {
/* We test with a currently unused refclock ID */
u_int32 addr = REFCLOCK_ADDR;
EXPECT_STREQ(expected.str().c_str(), refnumtoa(&address));
}
+#endif /* REFCLOCK */
#include "libntptest.h"
extern "C" {
+#ifdef OPENSSL
+# include "openssl/err.h"
+# include "openssl/rand.h"
+# include "openssl/evp.h"
+#endif
#include "ntp.h"
};
EXPECT_EQ(expected, digestLength);
}
+#ifdef OPENSSL
TEST_F(ssl_initTest, SHA1KeyTypeWithDigestLength) {
size_t digestLength;
size_t expected = TEST_SHA1_DIGEST_LENGTH;
EXPECT_EQ(NID_sha, keytype_from_text("SHA", &digestLength));
EXPECT_EQ(expected, digestLength);
}
+#endif /* OPENSSL */
// keytype_name()
TEST_F(ssl_initTest, MD5KeyName) {
EXPECT_STREQ("MD5", keytype_name(KEY_TYPE_MD5));
}
+#ifdef OPENSSL
TEST_F(ssl_initTest, SHA1KeyName) {
EXPECT_STREQ("SHA", keytype_name(NID_sha));
}
+#endif /* OPENSSL */