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

This commit is contained in:
Enji Cooper 2017-01-14 07:58:40 +00:00
parent 59754238a2
commit 1cb4521644
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/projects/netbsd-tests-upstream-01-2017/; revision=312136
2 changed files with 1 additions and 21 deletions

View File

@ -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);

View File

@ -32,6 +32,7 @@ ${PACKAGE}DATA_FILES+= data/sha1test2-out
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