summaryrefslogtreecommitdiff
path: root/pkgtools
diff options
context:
space:
mode:
authorjoerg <joerg>2011-11-08 18:20:03 +0000
committerjoerg <joerg>2011-11-08 18:20:03 +0000
commit0799fd7ff90367750eddf43010490a90133d3584 (patch)
tree5d2ca78803fa63add06b43257487ab097d8a41d1 /pkgtools
parent28c25b6696a678289727aae0c5d47a79cf76e9f0 (diff)
downloadpkgsrc-0799fd7ff90367750eddf43010490a90133d3584.tar.gz
Avoid overlap with libcrypto, the OSF linker can't deal with that.
Fixes PR 42142.
Diffstat (limited to 'pkgtools')
-rw-r--r--pkgtools/libnbcompat/files/nbcompat/sha2.h70
-rw-r--r--pkgtools/libnbcompat/files/sha2.c8
-rw-r--r--pkgtools/libnbcompat/files/sha2hl.c4
3 files changed, 25 insertions, 57 deletions
diff --git a/pkgtools/libnbcompat/files/nbcompat/sha2.h b/pkgtools/libnbcompat/files/nbcompat/sha2.h
index ef10a46e22d..ecbd44825d9 100644
--- a/pkgtools/libnbcompat/files/nbcompat/sha2.h
+++ b/pkgtools/libnbcompat/files/nbcompat/sha2.h
@@ -70,8 +70,12 @@ typedef SHA512_CTX SHA384_CTX;
/*** SHA-256/384/512 Function Prototypes ******************************/
-#ifndef NOPROTO
-#ifdef SHA2_USE_INTTYPES_H
+#define SHA256_Init nbcompat_SHA256_Init
+#define SHA256_Update nbcompat_SHA256_Update
+#define SHA256_Final nbcompat_SHA256_Final
+#define SHA256_End nbcompat_SHA256_End
+#define SHA256_Data nbcompat_SHA256_Data
+#define SHA256_File nbcompat_SHA256_File
void SHA256_Init(SHA256_CTX *);
void SHA256_Update(SHA256_CTX*, const uint8_t*, size_t);
@@ -80,28 +84,12 @@ char* SHA256_End(SHA256_CTX*, char[SHA256_DIGEST_STRING_LENGTH]);
char* SHA256_Data(const uint8_t*, size_t, uint8_t *);
char *SHA256_File(char *, char *);
-void SHA384_Init(SHA384_CTX*);
-void SHA384_Update(SHA384_CTX*, const uint8_t*, size_t);
-void SHA384_Final(uint8_t[SHA384_DIGEST_LENGTH], SHA384_CTX*);
-char* SHA384_End(SHA384_CTX*, char[SHA384_DIGEST_STRING_LENGTH]);
-char* SHA384_Data(const uint8_t*, size_t, char[SHA384_DIGEST_STRING_LENGTH]);
-char *SHA384_File(char *, char *);
-
-void SHA512_Init(SHA512_CTX*);
-void SHA512_Update(SHA512_CTX*, const uint8_t*, size_t);
-void SHA512_Final(uint8_t[SHA512_DIGEST_LENGTH], SHA512_CTX*);
-char* SHA512_End(SHA512_CTX*, char[SHA512_DIGEST_STRING_LENGTH]);
-char* SHA512_Data(const uint8_t*, size_t, char[SHA512_DIGEST_STRING_LENGTH]);
-char *SHA512_File(char *, char *);
-
-#else /* SHA2_USE_INTTYPES_H */
-
-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*, unsigned char *);
-char* SHA256_Data(const uint8_t*, size_t, unsigned char *);
-char *SHA256_File(char *, char *);
+#define SHA384_Init nbcompat_SHA384_Init
+#define SHA384_Update nbcompat_SHA384_Update
+#define SHA384_Final nbcompat_SHA384_Final
+#define SHA384_End nbcompat_SHA384_End
+#define SHA384_Data nbcompat_SHA384_Data
+#define SHA384_File nbcompat_SHA384_File
void SHA384_Init(SHA384_CTX*);
void SHA384_Update(SHA384_CTX*, const uint8_t*, size_t);
@@ -110,6 +98,13 @@ char* SHA384_End(SHA384_CTX*, char[SHA384_DIGEST_STRING_LENGTH]);
char* SHA384_Data(const uint8_t*, size_t, char[SHA384_DIGEST_STRING_LENGTH]);
char *SHA384_File(char *, char *);
+#define SHA512_Init nbcompat_SHA512_Init
+#define SHA512_Update nbcompat_SHA512_Update
+#define SHA512_Final nbcompat_SHA512_Final
+#define SHA512_End nbcompat_SHA512_End
+#define SHA512_Data nbcompat_SHA512_Data
+#define SHA512_File nbcompat_SHA512_File
+
void SHA512_Init(SHA512_CTX*);
void SHA512_Update(SHA512_CTX*, const uint8_t*, size_t);
void SHA512_Final(uint8_t[SHA512_DIGEST_LENGTH], SHA512_CTX*);
@@ -117,33 +112,6 @@ char* SHA512_End(SHA512_CTX*, char[SHA512_DIGEST_STRING_LENGTH]);
char* SHA512_Data(const uint8_t*, size_t, char[SHA512_DIGEST_STRING_LENGTH]);
char *SHA512_File(char *, char *);
-#endif /* SHA2_USE_INTTYPES_H */
-
-#else /* NOPROTO */
-
-void SHA256_Init();
-void SHA256_Update();
-void SHA256_Final();
-char* SHA256_End();
-char* SHA256_Data();
-char *SHA256_File();
-
-void SHA384_Init();
-void SHA384_Update();
-void SHA384_Final();
-char* SHA384_End();
-char* SHA384_Data();
-char *SHA384_File();
-
-void SHA512_Init();
-void SHA512_Update();
-void SHA512_Final();
-char* SHA512_End();
-char* SHA512_Data();
-char *SHA512_File();
-
-#endif /* NOPROTO */
-
#ifdef __cplusplus
}
#endif /* __cplusplus */
diff --git a/pkgtools/libnbcompat/files/sha2.c b/pkgtools/libnbcompat/files/sha2.c
index 62b77547980..f48407f0d95 100644
--- a/pkgtools/libnbcompat/files/sha2.c
+++ b/pkgtools/libnbcompat/files/sha2.c
@@ -1,4 +1,4 @@
-/* $NetBSD: sha2.c,v 1.7 2007/07/18 14:09:55 joerg Exp $ */
+/* $NetBSD: sha2.c,v 1.8 2011/11/08 18:20:03 joerg Exp $ */
/* $KAME: sha2.c,v 1.9 2003/07/20 00:28:38 itojun Exp $ */
/*
@@ -171,9 +171,9 @@ typedef uint64_t sha2_word64; /* Exactly 8 bytes */
* only.
*/
static void SHA512_Last(SHA512_CTX*);
-void SHA256_Transform(SHA256_CTX*, const sha2_word32*);
-void SHA384_Transform(SHA384_CTX*, const sha2_word64*);
-void SHA512_Transform(SHA512_CTX*, const sha2_word64*);
+static void SHA256_Transform(SHA256_CTX*, const sha2_word32*);
+static void SHA384_Transform(SHA384_CTX*, const sha2_word64*);
+static void SHA512_Transform(SHA512_CTX*, const sha2_word64*);
/*** SHA-XYZ INITIAL HASH VALUES AND CONSTANTS ************************/
diff --git a/pkgtools/libnbcompat/files/sha2hl.c b/pkgtools/libnbcompat/files/sha2hl.c
index ce6c053422b..1eefba8fdf8 100644
--- a/pkgtools/libnbcompat/files/sha2hl.c
+++ b/pkgtools/libnbcompat/files/sha2hl.c
@@ -1,4 +1,4 @@
-/* $NetBSD: sha2hl.c,v 1.7 2007/07/31 13:17:34 joerg Exp $ */
+/* $NetBSD: sha2hl.c,v 1.8 2011/11/08 18:20:03 joerg Exp $ */
/*
* sha2hl.c
@@ -94,7 +94,7 @@ SHA256_File(char *filename, char *buf)
char *
-SHA256_End(SHA256_CTX *ctx, unsigned char *buffer)
+SHA256_End(SHA256_CTX *ctx, char buffer[])
{
unsigned char digest[SHA256_DIGEST_LENGTH], *d = digest;
unsigned char *ret;