FreeBSD Bugzilla – Attachment 199768 Details for
Bug 233729
devel/jech-dht: Update to 0.25
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Upgrade to 0.25
jech-dht-update.diff (text/plain), 8.14 KB, created by
Mikhail Teterin
on 2018-12-02 23:11:20 UTC
(
hide
)
Description:
Upgrade to 0.25
Filename:
MIME Type:
Creator:
Mikhail Teterin
Created:
2018-12-02 23:11:20 UTC
Size:
8.14 KB
patch
obsolete
>Index: Makefile >=================================================================== >--- Makefile (revision 486395) >+++ Makefile (working copy) >@@ -2,7 +2,7 @@ > # $FreeBSD$ > > PORTNAME= dht >-PORTVERSION= 0.22 >+PORTVERSION= 0.25 > CATEGORIES= devel > MASTER_SITES= http://www.pps.univ-paris-diderot.fr/~jch/software/files/ > >Index: distinfo >=================================================================== >--- distinfo (revision 486395) >+++ distinfo (working copy) >@@ -1,2 +1,3 @@ >-SHA256 (dht-0.22.tar.gz) = a3452322648660da43cabd34cff8505d8f655e988f31c467535ad1992c29ac3d >-SIZE (dht-0.22.tar.gz) = 27380 >+TIMESTAMP = 1543790466 >+SHA256 (dht-0.25.tar.gz) = 1e0fd849a780699212f13052a4c9812d0af6f524c9cbf70a65e92eb3580372f6 >+SIZE (dht-0.25.tar.gz) = 29198 >Index: files/patch-dht-example >=================================================================== >--- files/patch-dht-example (revision 486395) >+++ files/patch-dht-example (working copy) >@@ -3,8 +3,8 @@ > > -mi > >---- dht-example.c 2014-05-03 14:37:50.000000000 -0400 >-+++ dht-example.c 2014-05-04 21:34:58.000000000 -0400 >+--- dht-example.c 2018-02-09 16:44:37.000000000 -0500 >++++ dht-example.c 2018-12-02 17:47:54.158580000 -0500 > @@ -12,4 +12,5 @@ > #include <fcntl.h> > #include <sys/time.h> >@@ -11,8 +11,8 @@ > +#include <netinet/in.h> > #include <arpa/inet.h> > #include <sys/types.h> >-@@ -17,4 +18,7 @@ >- #include <netdb.h> >+@@ -18,4 +19,7 @@ >+ #include <signal.h> > #include <sys/signal.h> > +#include <signal.h> > +#include <unistd.h> >@@ -19,9 +19,9 @@ > +#include <md5.h> > > #include "dht.h" >-@@ -91,4 +95,11 @@ >- static unsigned char buf[4096]; >+@@ -115,4 +119,11 @@ > >+ > +typedef void (hashing_method)(void *, int, > + const void *, int, > + const void *, int, >@@ -31,19 +31,17 @@ > + > int > main(int argc, char **argv) >-@@ -112,9 +123,8 @@ >- memset(&sin6, 0, sizeof(sin6)); >+@@ -137,6 +148,8 @@ > sin6.sin6_family = AF_INET6; >-- >-- >+ > + hasher = crypt_hash; >- >++ > while(1) { > - opt = getopt(argc, argv, "q46b:i:"); > + opt = getopt(argc, argv, "q46b:i:m"); > if(opt < 0) > break; >-@@ -143,4 +153,6 @@ >+@@ -165,4 +178,6 @@ > id_file = optarg; > break; > + case 'm': >@@ -50,8 +48,8 @@ > + hasher = md5_hash; > default: > goto usage; >-@@ -405,6 +417,7 @@ >- >+@@ -443,6 +458,7 @@ >+ > usage: > - printf("Usage: dht-example [-q] [-4] [-6] [-i filename] [-b address]...\n" > - " port [address port]...\n"); >@@ -60,13 +58,13 @@ > + "(Use -m to use MD5 digest instead of crypt()-based one)\n"); > exit(1); > } >-@@ -420,25 +433,28 @@ >+@@ -465,25 +481,30 @@ > /* We need to provide a reasonably strong cryptographic hashing function. > Here's how we'd do it if we had RSA's MD5 code. */ > -#if 0 >--void >++ >+ void > -dht_hash(void *hash_return, int hash_size, >-+static void > +md5_hash(void *hash_return, int hash_size, > const void *v1, int len1, > const void *v2, int len2, >@@ -89,18 +87,18 @@ > + } else { > + unsigned char digest[16]; > + MD5Final(digest, &ctx); >-+ memcpy(hash_return, digest, hash_size); >++ memcpy(hash_return, digest, hash_size); > + } > } > -#else >- /* But for this example, we might as well use something weaker. */ >--void >++ >+ /* But for this toy example, we might as well use something weaker. */ >+ void > -dht_hash(void *hash_return, int hash_size, >-+static void > +crypt_hash(void *hash_return, int hash_size, > const void *v1, int len1, > const void *v2, int len2, >-@@ -460,5 +476,14 @@ >+@@ -505,5 +526,14 @@ > strncpy(hash_return, crypt(key, "jc"), hash_size); > } > -#endif >Index: files/patch-warns >=================================================================== >--- files/patch-warns (revision 486395) >+++ files/patch-warns (working copy) >@@ -1,6 +1,6 @@ >---- dht.c 2011-07-25 17:59:36.000000000 -0400 >-+++ dht.c 2012-07-28 16:21:07.000000000 -0400 >-@@ -356,5 +356,5 @@ >+--- dht.c 2018-02-09 16:44:37.000000000 -0500 >++++ dht.c 2018-12-02 18:00:11.873381000 -0500 >+@@ -365,5 +365,5 @@ > switch(sa->sa_family) { > case AF_INET: { > - struct sockaddr_in *sin = (struct sockaddr_in*)sa; >@@ -7,7 +7,7 @@ > + const struct sockaddr_in *sin = (const struct sockaddr_in*)sa; > const unsigned char *address = (const unsigned char*)&sin->sin_addr; > return sin->sin_port == 0 || >-@@ -364,5 +364,5 @@ >+@@ -373,5 +373,5 @@ > } > case AF_INET6: { > - struct sockaddr_in6 *sin6 = (struct sockaddr_in6*)sa; >@@ -14,7 +14,7 @@ > + const struct sockaddr_in6 *sin6 = (const struct sockaddr_in6*)sa; > const unsigned char *address = (const unsigned char*)&sin6->sin6_addr; > return sin6->sin6_port == 0 || >-@@ -1281,13 +1281,13 @@ >+@@ -1427,13 +1427,13 @@ > int i, len; > struct storage *st; > - unsigned char *ip; >@@ -33,7 +33,7 @@ > + ip = (const unsigned char*)&sin6->sin6_addr; > len = 16; > } else { >-@@ -1406,15 +1406,15 @@ >+@@ -1552,15 +1552,15 @@ > make_token(const struct sockaddr *sa, int old, unsigned char *token_return) > { > - void *ip; >@@ -52,7 +52,7 @@ > + const struct sockaddr_in6 *sin6 = (const struct sockaddr_in6*)sa; > ip = &sin6->sin6_addr; > iplen = 16; >-@@ -1892,5 +1892,5 @@ >+@@ -2038,5 +2038,5 @@ > } > > - if(((char*)buf)[buflen] != '\0') { >@@ -59,7 +59,7 @@ > + if(((const char*)buf)[buflen] != '\0') { > debugf("Unterminated message.\n"); > errno = EINVAL; >-@@ -2743,5 +2743,5 @@ >+@@ -2905,5 +2905,5 @@ > > #define CHECK(ptr, len) \ > - if(((unsigned char*)ptr) + (len) > (buf) + (buflen)) goto overflow; >@@ -66,7 +66,7 @@ > + if(((const unsigned char*)ptr) + (len) > (buf) + (buflen)) goto overflow; > > if(tid_return) { >-@@ -2750,5 +2750,5 @@ >+@@ -2912,5 +2912,5 @@ > long l; > char *q; > - l = strtol((char*)p + 3, &q, 10); >@@ -73,35 +73,42 @@ > + l = strtol((const char*)p + 3, &q, 10); > if(q && *q == ':' && l > 0 && l < *tid_len) { > CHECK(q + 1, l); >-@@ -2782,5 +2782,5 @@ >+@@ -2944,5 +2944,5 @@ > long l; > char *q; >-- l = strtol((char*)p + 5, &q, 10); >-+ l = strtol((const char*)p + 5, &q, 10); >+- l = strtol((char*)p + 7, &q, 10); >++ l = strtol((const char*)p + 7, &q, 10); > if(q && *q == 'e' && l > 0 && l < 0x10000) > *port_return = l; >-@@ -2804,5 +2804,5 @@ >+@@ -2957,5 +2957,5 @@ > long l; > char *q; >+- l = strtol((char*)p + 16, &q, 10); >++ l = strtol((const char*)p + 16, &q, 10); >+ if(q && *q == 'e' && l > 0 && l < 0x10000) >+ *implied_port_return = l; >+@@ -2979,5 +2979,5 @@ >+ long l; >+ char *q; > - l = strtol((char*)p + 7, &q, 10); > + l = strtol((const char*)p + 7, &q, 10); > if(q && *q == ':' && l > 0 && l < *token_len) { > CHECK(q + 1, l); >-@@ -2820,5 +2820,5 @@ >+@@ -2995,5 +2995,5 @@ > long l; > char *q; > - l = strtol((char*)p + 7, &q, 10); > + l = strtol((const char*)p + 7, &q, 10); >- if(q && *q == ':' && l > 0 && l < *nodes_len) { >+ if(q && *q == ':' && l > 0 && l <= *nodes_len) { > CHECK(q + 1, l); >-@@ -2836,5 +2836,5 @@ >+@@ -3011,5 +3011,5 @@ > long l; > char *q; > - l = strtol((char*)p + 8, &q, 10); > + l = strtol((const char*)p + 8, &q, 10); >- if(q && *q == ':' && l > 0 && l < *nodes6_len) { >+ if(q && *q == ':' && l > 0 && l <= *nodes6_len) { > CHECK(q + 1, l); >-@@ -2855,8 +2855,8 @@ >+@@ -3030,5 +3030,5 @@ > long l; > char *q; > - l = strtol((char*)buf + i, &q, 10); >@@ -108,7 +115,3 @@ > + l = strtol((const char*)buf + i, &q, 10); > if(q && *q == ':' && l > 0) { > CHECK(q + 1, l); >-- i = q + 1 + l - (char*)buf; >-+ i = q + 1 + l - (const char*)buf; >- if(l == 6) { >- if(j + l > *values_len)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
koobs
:
maintainer-approval?
(
freebsd-2024
)
Actions:
View
|
Diff
Attachments on
bug 233729
: 199768