Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 14 Jan 2017 07:58:41 +0000 (UTC)
From:      Ngie Cooper <ngie@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r312136 - in projects/netbsd-tests-upstream-01-2017: contrib/netbsd-tests/lib/libc/hash lib/libc/tests/hash
Message-ID:  <201701140758.v0E7wfLW037967@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ngie
Date: Sat Jan 14 07:58:40 2017
New Revision: 312136
URL: https://svnweb.freebsd.org/changeset/base/312136

Log:
  Diff reduce with upstream using lib/libnetbsd's updated copy of sha1.h

Modified:
  projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/hash/h_hash.c
  projects/netbsd-tests-upstream-01-2017/lib/libc/tests/hash/Makefile

Modified: projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/hash/h_hash.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/hash/h_hash.c	Sat Jan 14 07:57:34 2017	(r312135)
+++ projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/hash/h_hash.c	Sat Jan 14 07:58:40 2017	(r312136)
@@ -35,13 +35,7 @@
 #include <unistd.h>
 #include <string.h>
 #include <md5.h>
-#ifdef __NetBSD__
 #include <sha1.h>
-#endif
-
-#ifdef __FreeBSD__
-#include <sha.h>
-#endif
 
 int mflag, rflag, sflag, tflag;
 
@@ -107,32 +101,17 @@ regress(void)
 			MD5Final(out, &ctx);
 			outlen = 16;
 		} else {
-#ifdef __FreeBSD__
-			SHA_CTX ctx;
-
-			SHA1_Init(&ctx);
-			SHA1_Update(&ctx, buf, len);
-#else
 			SHA1_CTX ctx;
 
 			SHA1Init(&ctx);
 			SHA1Update(&ctx, buf, len);
-#endif
 			while (!last &&
 			    fgets((char *)buf, sizeof(buf), stdin) != NULL) {
 				len = strlen((char *)buf);
 				CHOMP(buf, len, last);				
-#ifdef __FreeBSD__
-				SHA1_Update(&ctx, buf, len);
-#else
 				SHA1Update(&ctx, buf, len);
-#endif
 			}
-#ifdef __FreeBSD__
-			SHA1_Final(out, &ctx);
-#else
 			SHA1Final(out, &ctx);
-#endif
 			outlen = 20;
 		}
 		hexdump(out, outlen);

Modified: projects/netbsd-tests-upstream-01-2017/lib/libc/tests/hash/Makefile
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/lib/libc/tests/hash/Makefile	Sat Jan 14 07:57:34 2017	(r312135)
+++ projects/netbsd-tests-upstream-01-2017/lib/libc/tests/hash/Makefile	Sat Jan 14 07:58:40 2017	(r312136)
@@ -32,6 +32,7 @@ ${PACKAGE}DATA_FILES+=	data/sha1test2-ou
 LIBADD+=		md
 LIBADD.sha2_test+=	crypto
 
+CFLAGS.h_hash+=		-I${SRCTOP}/lib/libnetbsd
 CFLAGS.sha2_test+=	-I${SRCTOP}/crypto/openssh/openbsd-compat
 CFLAGS.sha2_test+=	-I${SRCTOP}/crypto/openssh
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201701140758.v0E7wfLW037967>