+---
+* [Bug 3144] NTP does not build without openSSL <perlinger@ntp.org>
+
---
(4.2.8p9) 2016/11/21 Released by Harlan Stenn <stenn@ntp.org>
-(4.2.8p9) 2016/MM/DD Released by Harlan Stenn <stenn@ntp.org>
* [Sec 3119] Trap crash <perlinger@ntp.org>
* [Sec 3118] Mode 6 information disclosure and DDoS vector <perlinger@ntp.org>
#ifdef OPENSSL
# include "openssl/evp.h"
+# include "libssl_compat.h"
#else /* !OPENSSL follows */
/*
* Provide OpenSSL-alike MD5 API if we're not using OpenSSL
# endif
typedef MD5_CTX EVP_MD_CTX;
+
+# define EVP_MD_CTX_free(c) free(c)
+# define EVP_MD_CTX_new() calloc(1, sizeof(MD5_CTX))
# define EVP_get_digestbynid(t) NULL
# define EVP_md5() NULL
# define EVP_MD_CTX_init(c)
#include "ntp.h"
#include "ntp_md5.h" /* provides OpenSSL digest API */
#include "isc/string.h"
-#include "libssl_compat.h"
/*
* MD5authencrypt - generate message digest
*
* ---------------------------------------------------------------------
*/
#include "config.h"
-
-#include <string.h>
-#include <openssl/bn.h>
-#include <openssl/evp.h>
-
#include "ntp_types.h"
/* ----------------------------------------------------------------- */
-#if OPENSSL_VERSION_NUMBER < 0x10100000L
+#ifdef OPENSSL
+# include <string.h>
+# include <openssl/bn.h>
+# include <openssl/evp.h>
+#endif
+/* ----------------------------------------------------------------- */
+
+/* ----------------------------------------------------------------- */
+#if defined(OPENSSL) && OPENSSL_VERSION_NUMBER < 0x10100000L
/* ----------------------------------------------------------------- */
#include "libssl_compat.h"
}
/* ----------------------------------------------------------------- */
-#else /* OPENSSL_VERSION_NUMBER >= v1.1.0 */
+#else /* OPENSSL && OPENSSL_VERSION_NUMBER >= v1.1.0 */
/* ----------------------------------------------------------------- */
NONEMPTY_TRANSLATION_UNIT
# include "ntp_syscall.h"
#endif
-#include "libssl_compat.h"
-
/*
* Structure to hold request procedure information
*/
char * oplim;
char * iptr;
char * iplim;
- char * past_eq;
+ char * past_eq = NULL;
optr = output;
oplim = output + sizeof(output);
/*
* function to dump the contents of the interface structure
* for debugging use only.
+ * We face a dilemma here -- sockets are FDs under POSIX and
+ * actually HANDLES under Windows. So we use '%lld' as format
+ * and cast the value to 'long long'; this should not hurt
+ * with UNIX-like systems and does not truncate values on Win64.
*/
void
interface_dump(const endpt *itf)
{
printf("Dumping interface: %p\n", itf);
- printf("fd = %d\n", itf->fd);
- printf("bfd = %d\n", itf->bfd);
+ printf("fd = %lld\n", (long long)itf->fd);
+ printf("bfd = %lld\n", (long long)itf->bfd);
printf("sin = %s,\n", stoa(&itf->sin));
sockaddr_dump(&itf->sin);
printf("bcast = %s,\n", stoa(&itf->bcast));
static void
print_interface(const endpt *iface, const char *pfx, const char *sfx)
{
- printf("%sinterface #%d: fd=%d, bfd=%d, name=%s, flags=0x%x, ifindex=%u, sin=%s",
+ printf("%sinterface #%d: fd=%lld, bfd=%lld, name=%s, flags=0x%x, ifindex=%u, sin=%s",
pfx,
iface->ifnum,
- iface->fd,
- iface->bfd,
+ (long long)iface->fd,
+ (long long)iface->bfd,
iface->name,
iface->flags,
iface->ifindex,
goto fail;
}
- ;
- if ( ! (rio->ioreg_ctx = iopad = iohpCreate(rio))) {
+ if (NULL == (rio->ioreg_ctx = iopad = iohpCreate(rio))) {
msyslog(LOG_ERR, "%s: Failed to create shared lock",
msgh);
goto fail;
iopad->riofd = rio->fd;
iopad->rsrc.rio = rio;
- if (!(rio->device_ctx = DevCtxAttach(serial_devctx(h)))) {
+ if (NULL == (rio->device_ctx = DevCtxAttach(serial_devctx(h)))) {
msyslog(LOG_ERR, "%s: Failed to allocate device context",
msgh);
goto fail;
}
- if ( ! (lpo = IoCtxAlloc(iopad, rio->device_ctx))) {
+ if (NULL == (lpo = IoCtxAlloc(iopad, rio->device_ctx))) {
msyslog(LOG_ERR, "%: Failed to allocate IO context",
msgh);
goto fail;
static const char * const msg =
"OnSocketSend: send to socket failed";
- IoHndPad_T * iopad = NULL;
endpt * ep = NULL;
int rc;
INSIST(hndIOCPLPort && hMainRpcDone);
if (iopad)
- iocpl_notify(iopad, OnInterfaceDetach, -1);
+ iocpl_notify(iopad, OnInterfaceDetach, (UINT_PTR)-1);
}
/* --------------------------------------------------------------------