aboutsummaryrefslogtreecommitdiffstats
path: root/net-p2p
diff options
context:
space:
mode:
authorflz <flz@FreeBSD.org>2009-07-15 21:43:54 +0800
committerflz <flz@FreeBSD.org>2009-07-15 21:43:54 +0800
commit95f3b494f005f6743cb9a86042c850797d1d2b2d (patch)
tree5b8f7dce985c2dff8f61554be0e1fd863eb5649b /net-p2p
parent29ece3ba14081047f6a6eaf946278301fdeef57c (diff)
downloadfreebsd-ports-gnome-95f3b494f005f6743cb9a86042c850797d1d2b2d.tar.gz
freebsd-ports-gnome-95f3b494f005f6743cb9a86042c850797d1d2b2d.tar.zst
freebsd-ports-gnome-95f3b494f005f6743cb9a86042c850797d1d2b2d.zip
Fix SHA1 on 64bit architectures.
PR: ports/136197 Submitted by: Chris Cowart <ccowart@rescomp.berkeley.edu>
Diffstat (limited to 'net-p2p')
-rw-r--r--net-p2p/bnbt/Makefile1
-rw-r--r--net-p2p/bnbt/files/patch-sha1.cpp32
-rw-r--r--net-p2p/bnbt/files/patch-sha1.h31
3 files changed, 64 insertions, 0 deletions
diff --git a/net-p2p/bnbt/Makefile b/net-p2p/bnbt/Makefile
index 08fdf7576999..a6c0557f6aac 100644
--- a/net-p2p/bnbt/Makefile
+++ b/net-p2p/bnbt/Makefile
@@ -7,6 +7,7 @@
PORTNAME= bnbt
PORTVERSION= 8.5
+PORTREVISION= 1
CATEGORIES= net-p2p
MASTER_SITES= http://opensource.depthstrike.com/${PORTNAME}/
DISTNAME= ${SNAPSHOT}-${PORTNAME}${PORTVERSION:C/\.//}-src
diff --git a/net-p2p/bnbt/files/patch-sha1.cpp b/net-p2p/bnbt/files/patch-sha1.cpp
new file mode 100644
index 000000000000..ab0df251a7a7
--- /dev/null
+++ b/net-p2p/bnbt/files/patch-sha1.cpp
@@ -0,0 +1,32 @@
+--- sha1.cpp 2009-06-30 14:02:51.000000000 -0700
++++ sha1.cpp.new 2009-06-30 14:02:47.000000000 -0700
+@@ -44,9 +44,9 @@
+ m_count[1] = 0;
+ }
+
+-void CSHA1::Transform(unsigned long state[5], const unsigned char buffer[64])
++void CSHA1::Transform(unsigned int state[5], const unsigned char buffer[64])
+ {
+- unsigned long a = 0, b = 0, c = 0, d = 0, e = 0;
++ unsigned int a = 0, b = 0, c = 0, d = 0, e = 0;
+
+ SHA1_WORKSPACE_BLOCK* block;
+ static unsigned char workspace[64];
+@@ -96,7 +96,7 @@
+ // Use this function to hash in binary data and strings
+ void CSHA1::Update(const unsigned char* data, unsigned int len)
+ {
+- unsigned long i = 0, j = 0;
++ unsigned int i = 0, j = 0;
+
+ j = (m_count[0] >> 3) & 63;
+
+@@ -123,7 +123,7 @@
+
+ void CSHA1::Final()
+ {
+- unsigned long i = 0, j = 0;
++ unsigned int i = 0, j = 0;
+ unsigned char finalcount[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
+
+ for (i = 0; i < 8; i++)
diff --git a/net-p2p/bnbt/files/patch-sha1.h b/net-p2p/bnbt/files/patch-sha1.h
new file mode 100644
index 000000000000..cfe3bbab2959
--- /dev/null
+++ b/net-p2p/bnbt/files/patch-sha1.h
@@ -0,0 +1,31 @@
+--- sha1.h 2009-06-30 14:02:51.000000000 -0700
++++ sha1.h.new 2009-06-30 14:02:47.000000000 -0700
+@@ -59,7 +59,7 @@
+
+ typedef union {
+ unsigned char c[64];
+- unsigned long l[16];
++ unsigned int l[16];
+ } SHA1_WORKSPACE_BLOCK;
+
+ // Two different formats for ReportHash(...)
+@@ -69,8 +69,8 @@
+ CSHA1();
+ virtual ~CSHA1();
+
+- unsigned long m_state[5];
+- unsigned long m_count[2];
++ unsigned int m_state[5];
++ unsigned int m_count[2];
+ unsigned char m_buffer[64];
+ unsigned char m_digest[20];
+
+@@ -86,7 +86,7 @@
+
+ private:
+ // Private SHA-1 transformation
+- void Transform(unsigned long state[5], const unsigned char buffer[64]);
++ void Transform(unsigned int state[5], const unsigned char buffer[64]);
+ };
+
+ #endif // ___SHA1_H___