[ntpsec commit] Fix compiler warnings.
Hal Murray
murray at ntpsec.org
Sun Oct 4 07:58:49 UTC 2015
Module: ntpsec
Branch: master
Commit: 7d474bb52838f16b98da1d7b22f63f027f9c55b9
Changeset: http://git.ntpsec.org/ntpsec/commit/?id=7d474bb52838f16b98da1d7b22f63f027f9c55b9
Author: Hal Murray <hmurray at megapathdsl.net>
Date: Sun Oct 4 00:58:13 2015 -0700
Fix compiler warnings.
---
include/ntp_md5.h | 4 ++--
libntp/intercept.c | 2 +-
ntpd/ntp_proto.c | 2 +-
sntp/crypto.c | 4 ++++
4 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/include/ntp_md5.h b/include/ntp_md5.h
index a7ebb69..0508127 100644
--- a/include/ntp_md5.h
+++ b/include/ntp_md5.h
@@ -27,8 +27,8 @@
# define EVP_md5() NULL
# define EVP_MD_CTX_init(c)
# define EVP_MD_CTX_set_flags(c, f)
-# define EVP_DigestInit(c, dt) (MD5Init(c), 1)
-# define EVP_DigestInit_ex(c, dt, i) (MD5Init(c), 1)
+# define EVP_DigestInit(c, dt) MD5Init(c)
+# define EVP_DigestInit_ex(c, dt, i) MD5Init(c)
# define EVP_DigestUpdate(c, p, s) MD5Update(c, (const void *)(p), \
s)
# define EVP_DigestFinal(c, d, pdl) \
diff --git a/libntp/intercept.c b/libntp/intercept.c
index 08439d4..ee3ac4f 100644
--- a/libntp/intercept.c
+++ b/libntp/intercept.c
@@ -229,7 +229,7 @@ void intercept_get_systime(const char *legend, l_fp *now)
get_ostime(&ts);
if (mode == capture)
- printf("event systime %s %zd %zd\n", legend, ts.tv_sec, ts.tv_nsec);
+ printf("event systime %s %ld %ld\n", legend, ts.tv_sec, ts.tv_nsec);
normalize_time(ts, ntp_random(), now);
}
diff --git a/ntpd/ntp_proto.c b/ntpd/ntp_proto.c
index ad78100..8268ad3 100644
--- a/ntpd/ntp_proto.c
+++ b/ntpd/ntp_proto.c
@@ -3399,7 +3399,7 @@ peer_xmit(
#else /* !ENABLE_AUTOKEY follows */
#ifdef DEBUG
if (debug)
- printf("transmit: at %ld %s->%s mode %d keyid %08x len %d\n",
+ printf("transmit: at %ld %s->%s mode %d keyid %08x len %zd\n",
current_time, peer->dstadr ?
ntoa(&peer->dstadr->sin) : "-",
ntoa(&peer->srcadr), peer->hmode, xkeyid, sendlen);
diff --git a/sntp/crypto.c b/sntp/crypto.c
index f2ca39d..715924b 100644
--- a/sntp/crypto.c
+++ b/sntp/crypto.c
@@ -15,7 +15,9 @@ make_mac(
)
{
u_int len = mac_size;
+#ifdef HAVE_OPENSSL
int key_type;
+#endif
EVP_MD_CTX ctx;
if (cmp_key->key_len > 64)
@@ -24,7 +26,9 @@ make_mac(
return 0;
INIT_SSL();
+#ifdef HAVE_OPENSSL
key_type = keytype_from_text(cmp_key->type, NULL);
+#endif
EVP_DigestInit(&ctx, EVP_get_digestbynid(key_type));
EVP_DigestUpdate(&ctx, (uint8_t *)cmp_key->key_seq, (u_int)cmp_key->key_len);
EVP_DigestUpdate(&ctx, (uint8_t *)pkt_data, (u_int)pkt_size);
More information about the vc
mailing list