Diff reduce with upstream using lib/libnetbsd's updated copy of sha1.h
This commit is contained in:
parent
59754238a2
commit
1cb4521644
@ -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);
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user