pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/pkgtools/libnbcompat/files Avoid overlap with libcrypt...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/ee39ed09865b
branches:  trunk
changeset: 594890:ee39ed09865b
user:      joerg <joerg%pkgsrc.org@localhost>
date:      Tue Nov 08 18:20:03 2011 +0000

description:
Avoid overlap with libcrypto, the OSF linker can't deal with that.
Fixes PR 42142.

diffstat:

 pkgtools/libnbcompat/files/nbcompat/sha2.h |  70 ++++++++---------------------
 pkgtools/libnbcompat/files/sha2.c          |   8 +-
 pkgtools/libnbcompat/files/sha2hl.c        |   4 +-
 3 files changed, 25 insertions(+), 57 deletions(-)

diffs (141 lines):

diff -r 821087fea183 -r ee39ed09865b pkgtools/libnbcompat/files/nbcompat/sha2.h
--- a/pkgtools/libnbcompat/files/nbcompat/sha2.h        Tue Nov 08 18:02:27 2011 +0000
+++ b/pkgtools/libnbcompat/files/nbcompat/sha2.h        Tue Nov 08 18:20:03 2011 +0000
@@ -70,8 +70,12 @@
 
 
 /*** 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_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_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_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 -r 821087fea183 -r ee39ed09865b pkgtools/libnbcompat/files/sha2.c
--- a/pkgtools/libnbcompat/files/sha2.c Tue Nov 08 18:02:27 2011 +0000
+++ b/pkgtools/libnbcompat/files/sha2.c Tue Nov 08 18:20:03 2011 +0000
@@ -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 @@
  * 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 -r 821087fea183 -r ee39ed09865b pkgtools/libnbcompat/files/sha2hl.c
--- a/pkgtools/libnbcompat/files/sha2hl.c       Tue Nov 08 18:02:27 2011 +0000
+++ b/pkgtools/libnbcompat/files/sha2hl.c       Tue Nov 08 18:20:03 2011 +0000
@@ -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 @@
 
 
 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;



Home | Main Index | Thread Index | Old Index