pkgsrc-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: pkgsrc/security/nacl
Module Name: pkgsrc
Committed By: schmonz
Date: Wed Jan 5 13:51:19 UTC 2022
Modified Files:
pkgsrc/security/nacl: Makefile distinfo
Added Files:
pkgsrc/security/nacl/patches: patch-cpucycles_do
patch-cpucycles_fakenanoseconds.c patch-cpucycles_fakenanoseconds.h
patch-cpucycles_mips.c patch-curvecp_curvecpclient.c
patch-curvecp_curvecpmessage.c patch-curvecp_curvecpserver.c
patch-curvecp_portparse.c patch-curvecp_socket__bind.c
Log Message:
Borrow build and runtime fixes from Debian. Fixes aarch64 build on
macOS, and perhaps others. Bump PKGREVISION.
To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 pkgsrc/security/nacl/Makefile
cvs rdiff -u -r1.6 -r1.7 pkgsrc/security/nacl/distinfo
cvs rdiff -u -r0 -r1.1 pkgsrc/security/nacl/patches/patch-cpucycles_do \
pkgsrc/security/nacl/patches/patch-cpucycles_fakenanoseconds.c \
pkgsrc/security/nacl/patches/patch-cpucycles_fakenanoseconds.h \
pkgsrc/security/nacl/patches/patch-cpucycles_mips.c \
pkgsrc/security/nacl/patches/patch-curvecp_curvecpclient.c \
pkgsrc/security/nacl/patches/patch-curvecp_curvecpmessage.c \
pkgsrc/security/nacl/patches/patch-curvecp_curvecpserver.c \
pkgsrc/security/nacl/patches/patch-curvecp_portparse.c \
pkgsrc/security/nacl/patches/patch-curvecp_socket__bind.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: pkgsrc/security/nacl/Makefile
diff -u pkgsrc/security/nacl/Makefile:1.5 pkgsrc/security/nacl/Makefile:1.6
--- pkgsrc/security/nacl/Makefile:1.5 Tue Jan 4 20:53:20 2022
+++ pkgsrc/security/nacl/Makefile Wed Jan 5 13:51:19 2022
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.5 2022/01/04 20:53:20 schmonz Exp $
+# $NetBSD: Makefile,v 1.6 2022/01/05 13:51:19 schmonz Exp $
DISTNAME= nacl-20110221
-PKGREVISION= 2
+PKGREVISION= 3
CATEGORIES= security
MASTER_SITES= https://hyperelliptic.org/nacl/
EXTRACT_SUFX= .tar.bz2
Index: pkgsrc/security/nacl/distinfo
diff -u pkgsrc/security/nacl/distinfo:1.6 pkgsrc/security/nacl/distinfo:1.7
--- pkgsrc/security/nacl/distinfo:1.6 Tue Jan 4 20:53:20 2022
+++ pkgsrc/security/nacl/distinfo Wed Jan 5 13:51:19 2022
@@ -1,8 +1,17 @@
-$NetBSD: distinfo,v 1.6 2022/01/04 20:53:20 schmonz Exp $
+$NetBSD: distinfo,v 1.7 2022/01/05 13:51:19 schmonz Exp $
BLAKE2s (nacl-20110221.tar.bz2) = d8fccb5036297da7fe4f4d357cd326f10094ba709b9422ccd1571b13e3981f4d
SHA512 (nacl-20110221.tar.bz2) = 4c031ceffe6a28dc74b46ac003d485531f78de467c802df73c8b22ca53644dabb7d2e3080b7bdd6583f0d07ad76b6d95bc0ffdce319ca2f80ee041e6fe618656
Size (nacl-20110221.tar.bz2) = 163415 bytes
+SHA1 (patch-cpucycles_do) = bc7bbb1a325d93a1ff73c5a87724ee39e74e4990
+SHA1 (patch-cpucycles_fakenanoseconds.c) = c45b8b83118c18f46a029bbe5202f6490a97fcdb
+SHA1 (patch-cpucycles_fakenanoseconds.h) = 0bd6b38cf0c601e26620a22e3d8ff7ef75d7bf27
+SHA1 (patch-cpucycles_mips.c) = a3e4a053927ecd366857a34010e179c664d9cc34
+SHA1 (patch-curvecp_curvecpclient.c) = c92670580856e8f5d8770af21765fc6b3ec5f3b3
+SHA1 (patch-curvecp_curvecpmessage.c) = 9fa2b9f9545156144c2c1027de64479110eabf92
+SHA1 (patch-curvecp_curvecpserver.c) = f38ef751e25f8ec0c309a42cb10dfd74c5e4c7df
+SHA1 (patch-curvecp_portparse.c) = 50474e955243969acc655af42709692a50dfcfd0
+SHA1 (patch-curvecp_socket__bind.c) = 28cb78a6439de767e6a5dcf59a3bb382debbb9b2
SHA1 (patch-curvecp_socket__udp.c) = 77e98768d015cb16af1ffa8b57464a12620d8110
SHA1 (patch-do) = 590961a4b2daf5693a477b06d35c8ea92f8e3173
SHA1 (patch-okcompilers_c) = bdbc229671428738e0115551ef1c123f3224d3cf
Added files:
Index: pkgsrc/security/nacl/patches/patch-cpucycles_do
diff -u /dev/null pkgsrc/security/nacl/patches/patch-cpucycles_do:1.1
--- /dev/null Wed Jan 5 13:51:19 2022
+++ pkgsrc/security/nacl/patches/patch-cpucycles_do Wed Jan 5 13:51:19 2022
@@ -0,0 +1,15 @@
+$NetBSD: patch-cpucycles_do,v 1.1 2022/01/05 13:51:19 schmonz Exp $
+
+Part of Debian 0008-add-cpucycles-fakenanoseconds.patch:
+Provide a fakenanoseconds implementation for portability.
+
+--- cpucycles/do.orig 2011-02-21 01:49:34.000000000 +0000
++++ cpucycles/do
+@@ -70,6 +70,7 @@ okabi | (
+ echo monotoniccpuinfo
+ echo monotonic
+ echo gettimeofday
++ echo fakenanoseconds
+ ) | (
+ while read n
+ do
Index: pkgsrc/security/nacl/patches/patch-cpucycles_fakenanoseconds.c
diff -u /dev/null pkgsrc/security/nacl/patches/patch-cpucycles_fakenanoseconds.c:1.1
--- /dev/null Wed Jan 5 13:51:19 2022
+++ pkgsrc/security/nacl/patches/patch-cpucycles_fakenanoseconds.c Wed Jan 5 13:51:19 2022
@@ -0,0 +1,31 @@
+$NetBSD: patch-cpucycles_fakenanoseconds.c,v 1.1 2022/01/05 13:51:19 schmonz Exp $
+
+Part of Debian 0008-add-cpucycles-fakenanoseconds.patch:
+Provide a fakenanoseconds implementation for portability.
+
+--- cpucycles/fakenanoseconds.c.orig 2022-01-05 13:32:14.000000000 +0000
++++ cpucycles/fakenanoseconds.c
+@@ -0,0 +1,23 @@
++#include <time.h>
++
++/* XXX Measured numbers are not CPU cycles but nanoseconds !!! */
++
++static long long faketime = 0;
++
++long long cpucycles_fakenanoseconds(void) {
++
++ struct timespec t;
++ long long tm;
++
++ if (clock_gettime(CLOCK_MONOTONIC,&t) != 0) return -1;
++
++ tm = t.tv_sec * 1000000000LL + t.tv_nsec;
++ if (tm > faketime) faketime = tm;
++ ++faketime;
++
++ return faketime;
++}
++
++long long cpucycles_fakenanoseconds_persecond(void) {
++ return 1000000000LL;
++}
Index: pkgsrc/security/nacl/patches/patch-cpucycles_fakenanoseconds.h
diff -u /dev/null pkgsrc/security/nacl/patches/patch-cpucycles_fakenanoseconds.h:1.1
--- /dev/null Wed Jan 5 13:51:19 2022
+++ pkgsrc/security/nacl/patches/patch-cpucycles_fakenanoseconds.h Wed Jan 5 13:51:19 2022
@@ -0,0 +1,29 @@
+$NetBSD: patch-cpucycles_fakenanoseconds.h,v 1.1 2022/01/05 13:51:19 schmonz Exp $
+
+Part of Debian 0008-add-cpucycles-fakenanoseconds.patch:
+Provide a fakenanoseconds implementation for portability.
+
+--- cpucycles/fakenanoseconds.h.orig 2022-01-05 13:32:14.000000000 +0000
++++ cpucycles/fakenanoseconds.h
+@@ -0,0 +1,21 @@
++#ifndef CPUCYCLES_fakenanoseconds_h
++#define CPUCYCLES_fakenanoseconds_h
++
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++extern long long cpucycles_fakenanoseconds(void);
++extern long long cpucycles_fakenanoseconds_persecond(void);
++
++#ifdef __cplusplus
++}
++#endif
++
++#ifndef cpucycles_implementation
++#define cpucycles_implementation "fakenanoseconds"
++#define cpucycles cpucycles_fakenanoseconds
++#define cpucycles_persecond cpucycles_fakenanoseconds_persecond
++#endif
++
++#endif
Index: pkgsrc/security/nacl/patches/patch-cpucycles_mips.c
diff -u /dev/null pkgsrc/security/nacl/patches/patch-cpucycles_mips.c:1.1
--- /dev/null Wed Jan 5 13:51:19 2022
+++ pkgsrc/security/nacl/patches/patch-cpucycles_mips.c Wed Jan 5 13:51:19 2022
@@ -0,0 +1,16 @@
+$NetBSD: patch-cpucycles_mips.c,v 1.1 2022/01/05 13:51:19 schmonz Exp $
+
+Debian patch 0005-fix-cpucycles-mips.patch:
+MIPS portability.
+
+--- cpucycles/mips.c.orig 2011-02-21 01:49:34.000000000 +0000
++++ cpucycles/mips.c
+@@ -18,7 +18,7 @@ static void readticks(unsigned int *resu
+ {
+ struct timeval t;
+ unsigned int cc;
+- asm volatile(".byte 59; .byte 16; .byte 2; .byte 124; move %0,$2" : "=r"(cc) : : "$2");
++ asm volatile(".long 2080510011; move %0,$2" : "=r"(cc) : : "$2");
+ gettimeofday(&t,(struct timezone *) 0);
+ result[0] = cc;
+ result[1] = t.tv_usec;
Index: pkgsrc/security/nacl/patches/patch-curvecp_curvecpclient.c
diff -u /dev/null pkgsrc/security/nacl/patches/patch-curvecp_curvecpclient.c:1.1
--- /dev/null Wed Jan 5 13:51:19 2022
+++ pkgsrc/security/nacl/patches/patch-curvecp_curvecpclient.c Wed Jan 5 13:51:19 2022
@@ -0,0 +1,15 @@
+$NetBSD: patch-curvecp_curvecpclient.c,v 1.1 2022/01/05 13:51:19 schmonz Exp $
+
+Part of Debian 0004-fix-segfault.patch:
+Fix segfault.
+
+--- curvecp/curvecpclient.c.orig 2011-02-21 01:49:34.000000000 +0000
++++ curvecp/curvecpclient.c
+@@ -96,6 +96,7 @@ int multiipparse(unsigned char *y,const
+ long long j;
+ long long k;
+ long long d;
++ if (!x) return 0;
+ for (j = 0;j < 4 * NUMIP;++j) y[j] = 0;
+ ynum = 0;
+ while (ynum < 1000) {
Index: pkgsrc/security/nacl/patches/patch-curvecp_curvecpmessage.c
diff -u /dev/null pkgsrc/security/nacl/patches/patch-curvecp_curvecpmessage.c:1.1
--- /dev/null Wed Jan 5 13:51:19 2022
+++ pkgsrc/security/nacl/patches/patch-curvecp_curvecpmessage.c Wed Jan 5 13:51:19 2022
@@ -0,0 +1,68 @@
+$NetBSD: patch-curvecp_curvecpmessage.c,v 1.1 2022/01/05 13:51:19 schmonz Exp $
+
+Debian patch 0007-fix-collecting-zombies.patch:
+Fix collecting zombies.
+
+--- curvecp/curvecpmessage.c.orig 2011-02-21 01:49:34.000000000 +0000
++++ curvecp/curvecpmessage.c
+@@ -135,6 +135,9 @@ long long rtt_phase = 0;
+
+ long long lastpanic = 0;
+
++int childdied = 0;
++int pollret;
++
+ void earliestblocktime_compute(void) /* XXX: use priority queue */
+ {
+ long long i;
+@@ -304,7 +307,10 @@ int main(int argc,char **argv)
+ else
+ timeout = (nextaction - recent) / 1000000 + 1;
+
+- if (poll(p,q - p,timeout) < 0) {
++ /* XXX */
++ if (childdied) timeout = 10;
++ pollret = poll(p,q - p,timeout);
++ if (pollret < 0) {
+ watch8 = 0;
+ watchtochild = 0;
+ watchfromchild = 0;
+@@ -314,6 +320,11 @@ int main(int argc,char **argv)
+ if (watchfromchild) if (!watchfromchild->revents) watchfromchild = 0;
+ }
+
++ /* XXX */
++ if (childdied && !pollret) {
++ if (childdied++ > 999) goto finish;
++ }
++
+ /* XXX: keepalives */
+
+ do { /* try receiving data from child: */
+@@ -642,12 +653,23 @@ int main(int argc,char **argv)
+ tochild[1] = -1;
+ } while(0);
+
++ /* XXX */
++ if (!childdied){
++ if (waitpid(child,&childstatus, WNOHANG) > 0) {
++ close(tochild[1]);
++ tochild[1] = -1;
++ childdied = 1;
++ }
++ }
+ }
+
++ if (!childdied) {
++ do {
++ r = waitpid(child,&childstatus,0);
++ } while (r == -1 && errno == EINTR);
++ }
+
+- do {
+- r = waitpid(child,&childstatus,0);
+- } while (r == -1 && errno == EINTR);
++finish:
+
+ if (!WIFEXITED(childstatus)) { errno = 0; die_fatal("process killed by signal",0,0); }
+ return WEXITSTATUS(childstatus);
Index: pkgsrc/security/nacl/patches/patch-curvecp_curvecpserver.c
diff -u /dev/null pkgsrc/security/nacl/patches/patch-curvecp_curvecpserver.c:1.1
--- /dev/null Wed Jan 5 13:51:19 2022
+++ pkgsrc/security/nacl/patches/patch-curvecp_curvecpserver.c Wed Jan 5 13:51:19 2022
@@ -0,0 +1,27 @@
+$NetBSD: patch-curvecp_curvecpserver.c,v 1.1 2022/01/05 13:51:19 schmonz Exp $
+
+Part of Debian 0004-fix-segfault.patch:
+Fix segfault.
+
+Also part of Debian 0009-return-correct-client-extension.patch:
+Return correct client extension.
+
+--- curvecp/curvecpserver.c.orig 2011-02-21 01:49:34.000000000 +0000
++++ curvecp/curvecpserver.c
+@@ -90,6 +90,7 @@ int ipparse(unsigned char *y,const char
+ long long k;
+ long long d;
+
++ if (!x) return 0;
+ for (k = 0;k < 4;++k) y[k] = 0;
+ for (k = 0;k < 4;++k) {
+ d = 0;
+@@ -473,7 +474,7 @@ int main(int argc,char **argv)
+ byte_copy(text + 32,r,activeclients[i].message + 1);
+ crypto_box_afternm(text,text,r + 32,nonce,activeclients[i].clientshortservershort);
+ byte_copy(packet,8,"RL3aNMXM");
+- byte_copy(packet + 8,16,clientextension);
++ byte_copy(packet + 8,16,activeclients[i].clientextension);
+ byte_copy(packet + 24,16,serverextension);
+ byte_copy(packet + 40,8,nonce + 16);
+ byte_copy(packet + 48,r + 16,text + 16);
Index: pkgsrc/security/nacl/patches/patch-curvecp_portparse.c
diff -u /dev/null pkgsrc/security/nacl/patches/patch-curvecp_portparse.c:1.1
--- /dev/null Wed Jan 5 13:51:19 2022
+++ pkgsrc/security/nacl/patches/patch-curvecp_portparse.c Wed Jan 5 13:51:19 2022
@@ -0,0 +1,15 @@
+$NetBSD: patch-curvecp_portparse.c,v 1.1 2022/01/05 13:51:19 schmonz Exp $
+
+Part of Debian 0004-fix-segfault.patch:
+Fix segfault.
+
+--- curvecp/portparse.c.orig 2011-02-21 01:49:34.000000000 +0000
++++ curvecp/portparse.c
+@@ -4,6 +4,7 @@ int portparse(unsigned char *y,const cha
+ {
+ long long d = 0;
+ long long j;
++ if (!x) return 0;
+ for (j = 0;j < 5 && x[j] >= '0' && x[j] <= '9';++j)
+ d = d * 10 + (x[j] - '0');
+ if (j == 0) return 0;
Index: pkgsrc/security/nacl/patches/patch-curvecp_socket__bind.c
diff -u /dev/null pkgsrc/security/nacl/patches/patch-curvecp_socket__bind.c:1.1
--- /dev/null Wed Jan 5 13:51:19 2022
+++ pkgsrc/security/nacl/patches/patch-curvecp_socket__bind.c Wed Jan 5 13:51:19 2022
@@ -0,0 +1,15 @@
+$NetBSD: patch-curvecp_socket__bind.c,v 1.1 2022/01/05 13:51:19 schmonz Exp $
+
+Debian patch 0003-fix-socket_bind.patch:
+Fix socket_bind.
+
+--- curvecp/socket_bind.c.orig 2011-02-21 01:49:34.000000000 +0000
++++ curvecp/socket_bind.c
+@@ -9,6 +9,7 @@ int socket_bind(int fd,const unsigned ch
+ {
+ struct sockaddr_in sa;
+ byte_zero(&sa,sizeof sa);
++ sa.sin_family = PF_INET;
+ byte_copy(&sa.sin_addr,4,ip);
+ byte_copy(&sa.sin_port,2,port);
+ return bind(fd,(struct sockaddr *) &sa,sizeof sa);
Home |
Main Index |
Thread Index |
Old Index