Sat Oct 7 21:14:59 2017 UTC ()
define recallocarray locally.


(christos)
diff -r1.6 -r1.7 src/crypto/external/bsd/openssh/dist/includes.h
diff -r0 -r1.1 src/crypto/external/bsd/openssh/dist/recallocarray.c
diff -r1.22 -r1.23 src/crypto/external/bsd/openssh/lib/Makefile

cvs diff -r1.6 -r1.7 src/crypto/external/bsd/openssh/dist/includes.h (expand / switch to unified diff)

--- src/crypto/external/bsd/openssh/dist/includes.h 2017/04/18 18:41:46 1.6
+++ src/crypto/external/bsd/openssh/dist/includes.h 2017/10/07 21:14:59 1.7
@@ -1,9 +1,11 @@ @@ -1,9 +1,11 @@
1/* $NetBSD: includes.h,v 1.6 2017/04/18 18:41:46 christos Exp $ */ 1/* $NetBSD: includes.h,v 1.7 2017/10/07 21:14:59 christos Exp $ */
2#include <sys/cdefs.h> 2#include <sys/cdefs.h>
3#ifndef __OpenBSD__ 3#ifndef __OpenBSD__
4#define __bounded__(a, b, c) 4#define __bounded__(a, b, c)
5#define explicit_bzero(a, b) explicit_memset((a), 0, (b)) 5#define explicit_bzero(a, b) explicit_memset((a), 0, (b))
6#define timingsafe_bcmp(a, b, c) (!consttime_memequal((a), (b), (c))) 6#define timingsafe_bcmp(a, b, c) (!consttime_memequal((a), (b), (c)))
 7#include <sys/types.h>
 8void *recallocarray(void *, size_t, size_t, size_t);
7#endif 9#endif
8 10
9#include "namespace.h" 11#include "namespace.h"

File Added: src/crypto/external/bsd/openssh/dist/recallocarray.c
/*	$NetBSD: recallocarray.c,v 1.1 2017/10/07 21:14:59 christos Exp $	*/
/*	$OpenBSD: reallocarray.c,v 1.1 2014/05/08 21:43:49 deraadt Exp $	*/

/*-
 * Copyright (c) 2015 The NetBSD Foundation, Inc.
 * All rights reserved.
 *
 * This code is derived from software contributed to The NetBSD Foundation
 * by Christos Zoulas.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

#include "includes.h"
#include <sys/cdefs.h>
__RCSID("$NetBSD: recallocarray.c,v 1.1 2017/10/07 21:14:59 christos Exp $");

#include <errno.h>
#include <string.h>
#include <stdlib.h>

void *
recallocarray(void *optr, size_t omemb, size_t nmemb, size_t size)
{
	char *nptr = reallocarray(optr, nmemb, size);

	if (nptr == NULL || omemb >= nmemb)
		return nptr;

	memset(nptr + omemb * size, 0, (nmemb - omemb) * size);
	return nptr;
}

cvs diff -r1.22 -r1.23 src/crypto/external/bsd/openssh/lib/Makefile (expand / switch to unified diff)

--- src/crypto/external/bsd/openssh/lib/Makefile 2017/10/07 19:39:19 1.22
+++ src/crypto/external/bsd/openssh/lib/Makefile 2017/10/07 21:14:59 1.23
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: Makefile,v 1.22 2017/10/07 19:39:19 christos Exp $ 1# $NetBSD: Makefile,v 1.23 2017/10/07 21:14:59 christos Exp $
2 2
3.include <bsd.own.mk> 3.include <bsd.own.mk>
4 4
5.include "../Makefile.inc" 5.include "../Makefile.inc"
6 6
7LIB= ssh 7LIB= ssh
8SRCS=\ 8SRCS=\
9addrmatch.c \ 9addrmatch.c \
10atomicio.c \ 10atomicio.c \
11authfd.c \ 11authfd.c \
12authfile.c \ 12authfile.c \
13bcrypt_pbkdf.c \ 13bcrypt_pbkdf.c \
14bitmap.c \ 14bitmap.c \
@@ -47,26 +47,27 @@ key.c \ @@ -47,26 +47,27 @@ key.c \
47krl.c \ 47krl.c \
48log.c \ 48log.c \
49mac.c \ 49mac.c \
50match.c \ 50match.c \
51misc.c \ 51misc.c \
52monitor_fdpass.c \ 52monitor_fdpass.c \
53msg.c \ 53msg.c \
54nchan.c \ 54nchan.c \
55opacket.c \ 55opacket.c \
56packet.c \ 56packet.c \
57poly1305.c \ 57poly1305.c \
58progressmeter.c \ 58progressmeter.c \
59readpass.c \ 59readpass.c \
 60recallocarray.c \
60sc25519.c \ 61sc25519.c \
61smult_curve25519_ref.c \ 62smult_curve25519_ref.c \
62sshbuf-getput-basic.c \ 63sshbuf-getput-basic.c \
63sshbuf-misc.c \ 64sshbuf-misc.c \
64sshbuf-getput-crypto.c \ 65sshbuf-getput-crypto.c \
65sshbuf.c \ 66sshbuf.c \
66ssherr.c \ 67ssherr.c \
67sshkey.c \ 68sshkey.c \
68ssh-ed25519.c \ 69ssh-ed25519.c \
69ssh-pkcs11.c \ 70ssh-pkcs11.c \
70ttymodes.c \ 71ttymodes.c \
71uidswap.c \ 72uidswap.c \
72umac.c \ 73umac.c \