summaryrefslogtreecommitdiff
path: root/pkgtools
diff options
context:
space:
mode:
authordholland <dholland@pkgsrc.org>2013-01-03 10:20:31 +0000
committerdholland <dholland@pkgsrc.org>2013-01-03 10:20:31 +0000
commitded57b14d2bb044970d283e3fe34d62801d130a5 (patch)
tree47303dfe63ace2270c7807cfbb521b1f646524ab /pkgtools
parent6b3fa458dbee985f9facc94febe2db4c9fa14389 (diff)
downloadpkgsrc-ded57b14d2bb044970d283e3fe34d62801d130a5.tar.gz
Remove configure test for vprintf, which wasn't even being used, and
configure tests for memset/memcpy, which are standard and haven't needed checking in a long time. This makes the configure script tolerate injection of -Werror. Fix signed/unsigned mismatches in the sha2 and whirlpool code. This package now passes -Wall with gcc45. Bump the package version to 20121220, which is when I made these changes.
Diffstat (limited to 'pkgtools')
-rw-r--r--pkgtools/digest/files/config.h.in35
-rw-r--r--pkgtools/digest/files/configure.ac24
-rw-r--r--pkgtools/digest/files/md5c.c10
-rw-r--r--pkgtools/digest/files/rmd160.c12
-rw-r--r--pkgtools/digest/files/sha2.h4
-rw-r--r--pkgtools/digest/files/sha2hl.c14
-rw-r--r--pkgtools/digest/files/whirlpool.c4
7 files changed, 17 insertions, 86 deletions
diff --git a/pkgtools/digest/files/config.h.in b/pkgtools/digest/files/config.h.in
index 68ae6c2bbf1..9c7bb581fbb 100644
--- a/pkgtools/digest/files/config.h.in
+++ b/pkgtools/digest/files/config.h.in
@@ -3,19 +3,10 @@
/* Define if building universal (internal helper macro) */
#undef AC_APPLE_UNIVERSAL_BUILD
-/* Define to 1 if you have the `bcopy' function. */
-#undef HAVE_BCOPY
-
-/* Define to 1 if you have the `bzero' function. */
-#undef HAVE_BZERO
-
/* Define to 1 if you have the declaration of `strerror_r', and to 0 if you
don't. */
#undef HAVE_DECL_STRERROR_R
-/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */
-#undef HAVE_DOPRNT
-
/* Define to 1 if you have the <errno.h> header file. */
#undef HAVE_ERRNO_H
@@ -28,15 +19,9 @@
/* Define to 1 if you have the <locale.h> header file. */
#undef HAVE_LOCALE_H
-/* Define to 1 if you have the `memcpy' function. */
-#undef HAVE_MEMCPY
-
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
-/* Define to 1 if you have the `memset' function. */
-#undef HAVE_MEMSET
-
/* Define to 1 if you have the `setlocale' function. */
#undef HAVE_SETLOCALE
@@ -73,9 +58,6 @@
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
-/* Define to 1 if you have the `vprintf' function. */
-#undef HAVE_VPRINTF
-
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
@@ -200,23 +182,6 @@
#include <sys/param.h>
#endif
-#if defined(HAVE_MEMSET)
#define MEMSET_BZERO(p,l) memset((p), 0, (l))
-#else
-# if defined(HAVE_BZERO)
-#define MEMSET_BZERO(p,l) bzero((p), (l))
-# else
-#error You need either memset or bzero
-# endif
-#endif
-
-#if defined(HAVE_MEMCPY)
#define MEMCPY_BCOPY(d,s,l) memcpy((d), (s), (l))
-#else
-# if defined(HAVE_BCOPY)
-#define MEMCPY_BCOPY(d,s,l) bcopy((s), (d), (l))
-# else
-#error You need either memcpy or bcopy
-# endif
-#endif
diff --git a/pkgtools/digest/files/configure.ac b/pkgtools/digest/files/configure.ac
index 6faed7e289b..1f513677758 100644
--- a/pkgtools/digest/files/configure.ac
+++ b/pkgtools/digest/files/configure.ac
@@ -1,7 +1,7 @@
-dnl $Id: configure.ac,v 1.17 2011/11/04 23:58:14 cheusov Exp $
+dnl $Id: configure.ac,v 1.18 2013/01/03 10:20:31 dholland Exp $
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.57)
-AC_INIT([nbsd-digest],[20111104],[agc@netbsd.org])
+AC_INIT([nbsd-digest],[20121220],[agc@netbsd.org])
AC_CONFIG_SRCDIR([digest.c])
AC_CONFIG_HEADER(config.h)
AC_ARG_PROGRAM
@@ -37,8 +37,7 @@ AC_C_BIGENDIAN
# Checks for library functions.
AC_FUNC_STRERROR_R
-AC_FUNC_VPRINTF
-AC_CHECK_FUNCS([bcopy bzero memset memcpy setlocale])
+AC_CHECK_FUNCS([setlocale])
#
AH_BOTTOM([
#ifdef HAVE_SYS_CDEFS_H
@@ -93,25 +92,8 @@ AH_BOTTOM([
#include <sys/param.h>
#endif
-#if defined(HAVE_MEMSET)
#define MEMSET_BZERO(p,l) memset((p), 0, (l))
-#else
-# if defined(HAVE_BZERO)
-#define MEMSET_BZERO(p,l) bzero((p), (l))
-# else
-#error You need either memset or bzero
-# endif
-#endif
-
-#if defined(HAVE_MEMCPY)
#define MEMCPY_BCOPY(d,s,l) memcpy((d), (s), (l))
-#else
-# if defined(HAVE_BCOPY)
-#define MEMCPY_BCOPY(d,s,l) bcopy((s), (d), (l))
-# else
-#error You need either memcpy or bcopy
-# endif
-#endif
])
AC_CONFIG_FILES([Makefile])
diff --git a/pkgtools/digest/files/md5c.c b/pkgtools/digest/files/md5c.c
index 6798847c67f..d6b0953f96b 100644
--- a/pkgtools/digest/files/md5c.c
+++ b/pkgtools/digest/files/md5c.c
@@ -1,4 +1,4 @@
-/* $NetBSD: md5c.c,v 1.5 2007/09/21 18:44:36 joerg Exp $ */
+/* $NetBSD: md5c.c,v 1.6 2013/01/03 10:20:31 dholland Exp $ */
/*
* This file is derived from the RSA Data Security, Inc. MD5 Message-Digest
@@ -45,15 +45,7 @@
#include <md5.h>
#endif /* _KERNEL || _STANDALONE */
-#if defined(HAVE_MEMSET)
#define ZEROIZE(d, l) memset((d), 0, (l))
-#else
-# if defined(HAVE_BZERO)
-#define ZEROIZE(d, l) bzero((d), (l))
-# else
-#error You need either memset or bzero
-# endif
-#endif
typedef unsigned char *POINTER;
typedef uint16_t UINT2;
diff --git a/pkgtools/digest/files/rmd160.c b/pkgtools/digest/files/rmd160.c
index d3cdd24c548..463274b55c1 100644
--- a/pkgtools/digest/files/rmd160.c
+++ b/pkgtools/digest/files/rmd160.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rmd160.c,v 1.7 2007/09/21 18:44:37 joerg Exp $ */
+/* $NetBSD: rmd160.c,v 1.8 2013/01/03 10:20:31 dholland Exp $ */
/********************************************************************\
*
@@ -23,7 +23,7 @@
#endif
#ifndef lint
-__RCSID("$NetBSD: rmd160.c,v 1.7 2007/09/21 18:44:37 joerg Exp $");
+__RCSID("$NetBSD: rmd160.c,v 1.8 2013/01/03 10:20:31 dholland Exp $");
#endif /* not lint */
/* header files */
@@ -40,15 +40,7 @@ __RCSID("$NetBSD: rmd160.c,v 1.7 2007/09/21 18:44:37 joerg Exp $");
#define _DIAGASSERT(cond) assert(cond)
#endif
-#if defined(HAVE_MEMSET)
#define ZEROIZE(d, l) memset((d), 0, (l))
-#else
-# if defined(HAVE_BZERO)
-#define ZEROIZE(d, l) bzero((d), (l))
-# else
-#error You need either memset or bzero
-# endif
-#endif
#if 0
#if !defined(_KERNEL) && defined(__weak_alias)
diff --git a/pkgtools/digest/files/sha2.h b/pkgtools/digest/files/sha2.h
index 77d700e3733..2a042d78a2f 100644
--- a/pkgtools/digest/files/sha2.h
+++ b/pkgtools/digest/files/sha2.h
@@ -86,8 +86,8 @@ typedef SHA512_CTX SHA384_CTX;
void SHA256_Init(SHA256_CTX *);
void SHA256_Update(SHA256_CTX*, const uint8_t*, size_t);
void SHA256_Final(uint8_t[SHA256_DIGEST_LENGTH], SHA256_CTX*);
-char* SHA256_End(SHA256_CTX*, uint8_t[SHA256_DIGEST_STRING_LENGTH]);
-char* SHA256_Data(const uint8_t*, size_t, uint8_t *);
+char* SHA256_End(SHA256_CTX*, char[SHA256_DIGEST_STRING_LENGTH]);
+char* SHA256_Data(const uint8_t*, size_t, char[SHA256_DIGEST_STRING_LENGTH]);
char *SHA256_File(char *, char *);
void SHA384_Init(SHA384_CTX*);
diff --git a/pkgtools/digest/files/sha2hl.c b/pkgtools/digest/files/sha2hl.c
index 4d83a016a17..9f5ab3b2b14 100644
--- a/pkgtools/digest/files/sha2hl.c
+++ b/pkgtools/digest/files/sha2hl.c
@@ -1,4 +1,4 @@
-/* $NetBSD: sha2hl.c,v 1.7 2007/09/21 18:44:38 joerg Exp $ */
+/* $NetBSD: sha2hl.c,v 1.8 2013/01/03 10:20:31 dholland Exp $ */
/*
* sha2hl.c
@@ -45,7 +45,7 @@
#endif
#ifndef lint
-__RCSID("$NetBSD: sha2hl.c,v 1.7 2007/09/21 18:44:38 joerg Exp $");
+__RCSID("$NetBSD: sha2hl.c,v 1.8 2013/01/03 10:20:31 dholland Exp $");
#endif /* not lint */
@@ -105,10 +105,10 @@ SHA256_File(char *filename, char *buf)
char *
-SHA256_End(SHA256_CTX *ctx, uint8_t *buffer)
+SHA256_End(SHA256_CTX *ctx, char *buffer)
{
uint8_t digest[SHA256_DIGEST_LENGTH], *d = digest;
- uint8_t *ret;
+ char *ret;
int i;
/* Sanity check: */
@@ -131,7 +131,7 @@ SHA256_End(SHA256_CTX *ctx, uint8_t *buffer)
}
char *
-SHA256_Data(const uint8_t * data, size_t len, uint8_t *digest)
+SHA256_Data(const uint8_t * data, size_t len, char *digest)
{
SHA256_CTX ctx;
@@ -169,7 +169,7 @@ char *
SHA384_End(SHA384_CTX * ctx, char buffer[])
{
uint8_t digest[SHA384_DIGEST_LENGTH], *d = digest;
- uint8_t *ret;
+ char *ret;
int i;
/* Sanity check: */
@@ -230,7 +230,7 @@ char *
SHA512_End(SHA512_CTX * ctx, char buffer[])
{
uint8_t digest[SHA512_DIGEST_LENGTH], *d = digest;
- uint8_t *ret;
+ char *ret;
int i;
/* Sanity check: */
diff --git a/pkgtools/digest/files/whirlpool.c b/pkgtools/digest/files/whirlpool.c
index 57216c6039d..e2dfa662a91 100644
--- a/pkgtools/digest/files/whirlpool.c
+++ b/pkgtools/digest/files/whirlpool.c
@@ -1552,14 +1552,14 @@ whirlpool_update(whirlpool_context_t *structpointer, const unsigned char *source
* This method uses the invariant: bufferBits < WHIRLPOOL_DIGEST_BITS
*/
static void
-whirlpool_finalize(unsigned char *result, whirlpool_context_t *structpointer)
+whirlpool_finalize(char *result, whirlpool_context_t *structpointer)
{
int i;
u8 *buffer = structpointer->buffer;
u8 *bitLength = structpointer->bitLength;
int bufferBits = structpointer->bufferBits;
int bufferPos = structpointer->bufferPos;
- u8 *digest = result;
+ char *digest = result;
/*
* append a '1'-bit: