Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 600454 | Differences between
and this patch

Collapse All | Expand All

(-)a/include/ntp_md5.h (+4 lines)
Lines 8-13 Link Here
8
8
9
#ifdef OPENSSL
9
#ifdef OPENSSL
10
# include "openssl/evp.h"
10
# include "openssl/evp.h"
11
# include "libssl_compat.h"
11
#else	/* !OPENSSL follows */
12
#else	/* !OPENSSL follows */
12
/*
13
/*
13
 * Provide OpenSSL-alike MD5 API if we're not using OpenSSL
14
 * Provide OpenSSL-alike MD5 API if we're not using OpenSSL
Lines 23-28 Link Here
23
# endif
24
# endif
24
25
25
  typedef MD5_CTX			EVP_MD_CTX;
26
  typedef MD5_CTX			EVP_MD_CTX;
27
28
# define EVP_MD_CTX_free(c)		free(c)
29
# define EVP_MD_CTX_new()		calloc(1, sizeof(MD5_CTX))
26
# define EVP_get_digestbynid(t)		NULL
30
# define EVP_get_digestbynid(t)		NULL
27
# define EVP_md5()			NULL
31
# define EVP_md5()			NULL
28
# define EVP_MD_CTX_init(c)
32
# define EVP_MD_CTX_init(c)
(-)a/libntp/a_md5encrypt.c (-1 lines)
Lines 11-17 Link Here
11
#include "ntp.h"
11
#include "ntp.h"
12
#include "ntp_md5.h"	/* provides OpenSSL digest API */
12
#include "ntp_md5.h"	/* provides OpenSSL digest API */
13
#include "isc/string.h"
13
#include "isc/string.h"
14
#include "libssl_compat.h"
15
/*
14
/*
16
 * MD5authencrypt - generate message digest
15
 * MD5authencrypt - generate message digest
17
 *
16
 *
(-)a/libntp/libssl_compat.c (-7 / +10 lines)
Lines 15-29 Link Here
15
 * ---------------------------------------------------------------------
15
 * ---------------------------------------------------------------------
16
 */
16
 */
17
#include "config.h"
17
#include "config.h"
18
19
#include <string.h>
20
#include <openssl/bn.h>
21
#include <openssl/evp.h>
22
23
#include "ntp_types.h"
18
#include "ntp_types.h"
24
19
25
/* ----------------------------------------------------------------- */
20
/* ----------------------------------------------------------------- */
26
#if OPENSSL_VERSION_NUMBER < 0x10100000L
21
#ifdef OPENSSL
22
# include <string.h>
23
# include <openssl/bn.h>
24
# include <openssl/evp.h>
25
#endif
26
/* ----------------------------------------------------------------- */
27
28
/* ----------------------------------------------------------------- */
29
#if defined(OPENSSL) && (OPENSSL_VERSION_NUMBER < 0x10100000L || defined LIBRESSL_VERSION_NUMBER)
27
/* ----------------------------------------------------------------- */
30
/* ----------------------------------------------------------------- */
28
31
29
#include "libssl_compat.h"
32
#include "libssl_compat.h"
Lines 325-331 Link Here
325
}
328
}
326
329
327
/* ----------------------------------------------------------------- */
330
/* ----------------------------------------------------------------- */
328
#else /* OPENSSL_VERSION_NUMBER >= v1.1.0 */
331
#else /* OPENSSL && OPENSSL_VERSION_NUMBER >= v1.1.0 */
329
/* ----------------------------------------------------------------- */
332
/* ----------------------------------------------------------------- */
330
333
331
NONEMPTY_TRANSLATION_UNIT
334
NONEMPTY_TRANSLATION_UNIT
(-)a/ntpd/ntp_control.c (-4 / +5 lines)
Lines 33-40 Link Here
33
# include "ntp_syscall.h"
33
# include "ntp_syscall.h"
34
#endif
34
#endif
35
35
36
#include "libssl_compat.h"
37
38
/*
36
/*
39
 * Structure to hold request procedure information
37
 * Structure to hold request procedure information
40
 */
38
 */
Lines 1653-1660 Link Here
1653
}
1651
}
1654
1652
1655
/*
1653
/*
1656
 * ctl_putcal - write a decoded calendar data into the response
1654
 * ctl_putcal - write a decoded calendar data into the response.
1655
 * only used with AUTOKEY currently, so compiled conditional
1657
 */
1656
 */
1657
#ifdef AUTOKEY
1658
static void
1658
static void
1659
ctl_putcal(
1659
ctl_putcal(
1660
	const char *tag,
1660
	const char *tag,
Lines 1678-1683 Link Here
1678
1678
1679
	return;
1679
	return;
1680
}
1680
}
1681
#endif
1681
1682
1682
/*
1683
/*
1683
 * ctl_putfs - write a decoded filestamp into the response
1684
 * ctl_putfs - write a decoded filestamp into the response
Lines 1838-1844 Link Here
1838
	char *	oplim;
1839
	char *	oplim;
1839
	char *	iptr;
1840
	char *	iptr;
1840
	char *	iplim;
1841
	char *	iplim;
1841
	char *	past_eq;
1842
	char *	past_eq = NULL;
1842
1843
1843
	optr = output;
1844
	optr = output;
1844
	oplim = output + sizeof(output);
1845
	oplim = output + sizeof(output);
(-)a/ntpd/ntp_io.c (-5 / +9 lines)
Lines 516-528 Link Here
516
/*
516
/*
517
 * function to dump the contents of the interface structure
517
 * function to dump the contents of the interface structure
518
 * for debugging use only.
518
 * for debugging use only.
519
 * We face a dilemma here -- sockets are FDs under POSIX and
520
 * actually HANDLES under Windows. So we use '%lld' as format
521
 * and cast the value to 'long long'; this should not hurt
522
 * with UNIX-like systems and does not truncate values on Win64.
519
 */
523
 */
520
void
524
void
521
interface_dump(const endpt *itf)
525
interface_dump(const endpt *itf)
522
{
526
{
523
	printf("Dumping interface: %p\n", itf);
527
	printf("Dumping interface: %p\n", itf);
524
	printf("fd = %d\n", itf->fd);
528
	printf("fd = %lld\n", (long long)itf->fd);
525
	printf("bfd = %d\n", itf->bfd);
529
	printf("bfd = %lld\n", (long long)itf->bfd);
526
	printf("sin = %s,\n", stoa(&itf->sin));
530
	printf("sin = %s,\n", stoa(&itf->sin));
527
	sockaddr_dump(&itf->sin);
531
	sockaddr_dump(&itf->sin);
528
	printf("bcast = %s,\n", stoa(&itf->bcast));
532
	printf("bcast = %s,\n", stoa(&itf->bcast));
Lines 570-580 Link Here
570
static void
574
static void
571
print_interface(const endpt *iface, const char *pfx, const char *sfx)
575
print_interface(const endpt *iface, const char *pfx, const char *sfx)
572
{
576
{
573
	printf("%sinterface #%d: fd=%d, bfd=%d, name=%s, flags=0x%x, ifindex=%u, sin=%s",
577
	printf("%sinterface #%d: fd=%lld, bfd=%lld, name=%s, flags=0x%x, ifindex=%u, sin=%s",
574
	       pfx,
578
	       pfx,
575
	       iface->ifnum,
579
	       iface->ifnum,
576
	       iface->fd,
580
	       (long long)iface->fd,
577
	       iface->bfd,
581
	       (long long)iface->bfd,
578
	       iface->name,
582
	       iface->name,
579
	       iface->flags,
583
	       iface->flags,
580
	       iface->ifindex,
584
	       iface->ifindex,
(-)a/ntpd/ntp_proto.c (-1 / +1 lines)
Lines 4054-4060 Link Here
4054
		    ntoa(&peer->srcadr), peer->hmode, xkeyid, sendlen,
4054
		    ntoa(&peer->srcadr), peer->hmode, xkeyid, sendlen,
4055
		    peer->keynumber));
4055
		    peer->keynumber));
4056
#else	/* !AUTOKEY follows */
4056
#else	/* !AUTOKEY follows */
4057
	DPRINTF(1, ("peer_xmit: at %ld %s->%s mode %d keyid %08x len %d\n",
4057
	DPRINTF(1, ("peer_xmit: at %ld %s->%s mode %d keyid %08x len %zu\n",
4058
		    current_time, peer->dstadr ?
4058
		    current_time, peer->dstadr ?
4059
		    ntoa(&peer->dstadr->sin) : "-",
4059
		    ntoa(&peer->dstadr->sin) : "-",
4060
		    ntoa(&peer->srcadr), peer->hmode, xkeyid, sendlen));
4060
		    ntoa(&peer->srcadr), peer->hmode, xkeyid, sendlen));
(-)a/ports/winnt/ntpd/ntp_iocompletionport.c (-6 / +4 lines)
Lines 1391-1398 Link Here
1391
		goto fail;
1391
		goto fail;
1392
	}
1392
	}
1393
1393
1394
	;
1394
	if (NULL == (rio->ioreg_ctx = iopad = iohpCreate(rio))) {
1395
	if ( ! (rio->ioreg_ctx = iopad = iohpCreate(rio))) {
1396
		msyslog(LOG_ERR, "%s: Failed to create shared lock",
1395
		msyslog(LOG_ERR, "%s: Failed to create shared lock",
1397
			msgh);
1396
			msgh);
1398
		goto fail;
1397
		goto fail;
Lines 1401-1413 Link Here
1401
	iopad->riofd      = rio->fd;
1400
	iopad->riofd      = rio->fd;
1402
	iopad->rsrc.rio   = rio;
1401
	iopad->rsrc.rio   = rio;
1403
1402
1404
	if (!(rio->device_ctx = DevCtxAttach(serial_devctx(h)))) {
1403
	if (NULL == (rio->device_ctx = DevCtxAttach(serial_devctx(h)))) {
1405
		msyslog(LOG_ERR, "%s: Failed to allocate device context",
1404
		msyslog(LOG_ERR, "%s: Failed to allocate device context",
1406
			msgh);
1405
			msgh);
1407
		goto fail;
1406
		goto fail;
1408
	}
1407
	}
1409
1408
1410
	if ( ! (lpo = IoCtxAlloc(iopad, rio->device_ctx))) {
1409
	if (NULL == (lpo = IoCtxAlloc(iopad, rio->device_ctx))) {
1411
		msyslog(LOG_ERR, "%: Failed to allocate IO context",
1410
		msyslog(LOG_ERR, "%: Failed to allocate IO context",
1412
			msgh);
1411
			msgh);
1413
		goto fail;
1412
		goto fail;
Lines 1594-1600 Link Here
1594
	static const char * const msg =
1593
	static const char * const msg =
1595
		"OnSocketSend: send to socket failed";
1594
		"OnSocketSend: send to socket failed";
1596
1595
1597
	IoHndPad_T *	iopad	= NULL;
1598
	endpt *		ep	= NULL;
1596
	endpt *		ep	= NULL;
1599
	int		rc;
1597
	int		rc;
1600
1598
Lines 1662-1668 Link Here
1662
1660
1663
	INSIST(hndIOCPLPort && hMainRpcDone);
1661
	INSIST(hndIOCPLPort && hMainRpcDone);
1664
	if (iopad)
1662
	if (iopad)
1665
		iocpl_notify(iopad, OnInterfaceDetach, -1);
1663
		iocpl_notify(iopad, OnInterfaceDetach, (UINT_PTR)-1);
1666
}
1664
}
1667
1665
1668
/* --------------------------------------------------------------------
1666
/* --------------------------------------------------------------------
(-)a/sntp/crypto.c (-1 / +1 lines)
Lines 2-8 Link Here
2
#include "crypto.h"
2
#include "crypto.h"
3
#include <ctype.h>
3
#include <ctype.h>
4
#include "isc/string.h"
4
#include "isc/string.h"
5
#include "libssl_compat.h"
5
#include "ntp_md5.h"
6
6
7
struct key *key_ptr;
7
struct key *key_ptr;
8
size_t key_cnt = 0;
8
size_t key_cnt = 0;
(-)a/include/libssl_compat.h (-1 / +1 lines)
Lines 25-31 Link Here
25
#include "openssl/rsa.h"
25
#include "openssl/rsa.h"
26
26
27
/* ----------------------------------------------------------------- */
27
/* ----------------------------------------------------------------- */
28
#if OPENSSL_VERSION_NUMBER < 0x10100000L
28
#if (OPENSSL_VERSION_NUMBER < 0x10100000L || defined LIBRESSL_VERSION_NUMBER)
29
/* ----------------------------------------------------------------- */
29
/* ----------------------------------------------------------------- */
30
30
31
# include <openssl/objects.h>
31
# include <openssl/objects.h>

Return to bug 600454