summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-08-18 11:08:39 +0200
committerChristian Grothoff <christian@grothoff.org>2020-08-18 11:08:39 +0200
commit5570a5d03703c9e864544febe9fbaa6ccfef83ee (patch)
tree23b770538a53fb1c9dd09c1a36ee25bf435c6652
parent53cc51e0df6bcf1417ef058e0d5843c7f89933d5 (diff)
parent2bce42e5b3630f3835f401e5eeed23a56b7bd875 (diff)
Merge branch 'master' of git+ssh://gnunet.org/gnunet
-rwxr-xr-xbootstrap8
-rw-r--r--configure.ac6
-rw-r--r--po/POTFILES.in13
-rw-r--r--src/include/gnunet_crypto_lib.h12
-rw-r--r--src/nse/gnunet-service-nse.c9
-rw-r--r--src/nse/perf_kdf.c3
-rw-r--r--src/revocation/revocation_api.c6
-rw-r--r--src/util/crypto_pow.c3
-rw-r--r--src/util/gnunet-scrypt.c9
-rw-r--r--src/util/test_os_start_process.c19
10 files changed, 48 insertions, 40 deletions
diff --git a/bootstrap b/bootstrap
index df0e58dda..8fc4c4426 100755
--- a/bootstrap
+++ b/bootstrap
@@ -97,15 +97,15 @@ submodules()
if ! git --version >/dev/null; then
echo "git not installed, skipping submodule update"
else
- git submodule update --init || true
- git submodule update --recursive || true
- git submodule sync || true
+ git submodule update --init || exit 1
+ git submodule update --recursive || exit 1
+ git submodule sync || exit 1
fi
}
init_buildcommon_include()
{
- cp contrib/build-common/Makefile.inc contrib/Makefile.inc || true
+ cp contrib/build-common/Makefile.inc contrib/Makefile.inc || exit 1
}
main()
diff --git a/configure.ac b/configure.ac
index bb205220c..72309c78d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -142,9 +142,11 @@ AS_CASE(["$host_os"],
UNIXONLY="#"
],
[*openbsd*],[
- LIBS=`echo $LIBS | sed -e "s/-ldl//"`
+ # We need to explicitly link libc
+ LDFLAGS="$LDFLAGS -Wl,-lc"
+ # We also need to enable PIC
+ CFLAGS="-fPIC $CFLAGS"
build_target="openbsd"
- use_openbsd_libtool=true
LIBPREFIX=
DLLDIR=lib
UNIXONLY="#"
diff --git a/po/POTFILES.in b/po/POTFILES.in
index c5503c343..7d19122ca 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -333,19 +333,8 @@ src/set/ibf.c
src/set/ibf_sim.c
src/set/plugin_block_set_test.c
src/set/set_api.c
-src/seti/gnunet-service-set.c
-src/seti/gnunet-service-set_intersection.c
-src/seti/gnunet-service-set_union.c
-src/seti/gnunet-service-set_union_strata_estimator.c
-src/seti/gnunet-set-ibf-profiler.c
-src/seti/gnunet-set-profiler.c
-src/seti/ibf.c
-src/seti/ibf_sim.c
-src/seti/plugin_block_set_test.c
-src/seti/set_api.c
-src/setu/gnunet-service-set_union.c
-src/setu/gnunet-service-set_union_strata_estimator.c
src/setu/gnunet-service-setu.c
+src/setu/gnunet-service-setu_strata_estimator.c
src/setu/gnunet-setu-ibf-profiler.c
src/setu/gnunet-setu-profiler.c
src/setu/ibf.c
diff --git a/src/include/gnunet_crypto_lib.h b/src/include/gnunet_crypto_lib.h
index f8eef5406..8c3f4f058 100644
--- a/src/include/gnunet_crypto_lib.h
+++ b/src/include/gnunet_crypto_lib.h
@@ -50,6 +50,7 @@ extern "C" {
#endif
#endif
+#include <sodium.h>
/**
* The identity of the host (wraps the signing key of the peer).
@@ -668,6 +669,15 @@ GNUNET_CRYPTO_hash (const void *block,
/**
+ * Value for a salt for #GNUNET_CRYPTO_pow_hash().
+ */
+struct GNUNET_CRYPTO_PowSalt
+{
+ char salt[crypto_pwhash_argon2id_SALTBYTES];
+};
+
+
+/**
* Calculate the 'proof-of-work' hash (an expensive hash).
*
* @param salt salt for the hash. Must be crypto_pwhash_argon2id_SALTBYTES long.
@@ -676,7 +686,7 @@ GNUNET_CRYPTO_hash (const void *block,
* @param result where to write the resulting hash
*/
void
-GNUNET_CRYPTO_pow_hash (const char *salt,
+GNUNET_CRYPTO_pow_hash (const struct GNUNET_CRYPTO_PowSalt *salt,
const void *buf,
size_t buf_len,
struct GNUNET_HashCode *result);
diff --git a/src/nse/gnunet-service-nse.c b/src/nse/gnunet-service-nse.c
index ebf39585e..dfd71e57a 100644
--- a/src/nse/gnunet-service-nse.c
+++ b/src/nse/gnunet-service-nse.c
@@ -113,6 +113,11 @@ static struct GNUNET_BIO_WriteHandle *histogram;
#endif
+/**
+ * Salt for PoW calcualations.
+ */
+static struct GNUNET_CRYPTO_PowSalt salt = { "gnunet-nse-proof" };
+
/**
* Per-peer information.
@@ -806,7 +811,7 @@ check_proof_of_work (const struct GNUNET_CRYPTO_EddsaPublicKey *pkey,
GNUNET_memcpy (&buf[sizeof(val)],
pkey,
sizeof(struct GNUNET_CRYPTO_EddsaPublicKey));
- GNUNET_CRYPTO_pow_hash ("gnunet-nse-proof",
+ GNUNET_CRYPTO_pow_hash (&salt,
buf,
sizeof(buf),
&result);
@@ -861,7 +866,7 @@ find_proof (void *cls)
while ((counter != UINT64_MAX) && (i < ROUND_SIZE))
{
GNUNET_memcpy (buf, &counter, sizeof(uint64_t));
- GNUNET_CRYPTO_pow_hash ("gnunet-nse-proof",
+ GNUNET_CRYPTO_pow_hash (&salt,
buf,
sizeof(buf),
&result);
diff --git a/src/nse/perf_kdf.c b/src/nse/perf_kdf.c
index 89b70903a..10207675f 100644
--- a/src/nse/perf_kdf.c
+++ b/src/nse/perf_kdf.c
@@ -34,10 +34,11 @@ perfHash ()
{
struct GNUNET_HashCode hc;
char buf[64];
+ struct GNUNET_CRYPTO_PowSalt salt = { "gnunet-nse-proof" };
memset (buf, 1, sizeof(buf));
for (unsigned int i = 0; i < 1024; i++)
- GNUNET_CRYPTO_pow_hash ("gnunet-nse-proof",
+ GNUNET_CRYPTO_pow_hash (&salt,
buf,
sizeof(buf),
&hc);
diff --git a/src/revocation/revocation_api.c b/src/revocation/revocation_api.c
index e0b195aa9..75cfd8761 100644
--- a/src/revocation/revocation_api.c
+++ b/src/revocation/revocation_api.c
@@ -103,6 +103,8 @@ struct GNUNET_REVOCATION_PowCalculationHandle
};
+static struct GNUNET_CRYPTO_PowSalt salt = { "GnsRevocationPow" };
+
/**
* Generic error handler, called with the appropriate
* error code and the same closure specified at the creation of
@@ -483,7 +485,7 @@ GNUNET_REVOCATION_check_pow (const struct GNUNET_REVOCATION_PowP *pow,
{
pow_val = GNUNET_ntohll (pow->pow[i]);
GNUNET_memcpy (buf, &pow->pow[i], sizeof(uint64_t));
- GNUNET_CRYPTO_pow_hash ("GnsRevocationPow",
+ GNUNET_CRYPTO_pow_hash (&salt,
buf,
sizeof(buf),
&result);
@@ -644,7 +646,7 @@ GNUNET_REVOCATION_pow_round (struct GNUNET_REVOCATION_PowCalculationHandle *pc)
GNUNET_memcpy (&buf[sizeof(uint64_t) * 2],
&pc->pow->key,
sizeof(struct GNUNET_CRYPTO_EcdsaPublicKey));
- GNUNET_CRYPTO_pow_hash ("GnsRevocationPow",
+ GNUNET_CRYPTO_pow_hash (&salt,
buf,
sizeof(buf),
&result);
diff --git a/src/util/crypto_pow.c b/src/util/crypto_pow.c
index cfa0676d0..051a0c209 100644
--- a/src/util/crypto_pow.c
+++ b/src/util/crypto_pow.c
@@ -38,12 +38,11 @@
* @param result where to write the resulting hash
*/
void
-GNUNET_CRYPTO_pow_hash (const char *salt,
+GNUNET_CRYPTO_pow_hash (const struct GNUNET_CRYPTO_PowSalt *salt,
const void *buf,
size_t buf_len,
struct GNUNET_HashCode *result)
{
- GNUNET_assert (strlen (salt) == crypto_pwhash_argon2id_SALTBYTES);
/* Threads hardcoded at 1 in libsodium */
GNUNET_break (0 ==
crypto_pwhash_argon2id ((unsigned char *) result,
diff --git a/src/util/gnunet-scrypt.c b/src/util/gnunet-scrypt.c
index aa64144a8..136c6debb 100644
--- a/src/util/gnunet-scrypt.c
+++ b/src/util/gnunet-scrypt.c
@@ -26,6 +26,13 @@
#include "gnunet_util_lib.h"
#include <gcrypt.h>
+
+/**
+ * Salt for PoW calcualations.
+ */
+static struct GNUNET_CRYPTO_PowSalt salt = { "gnunet-nse-proof" };
+
+
/**
* Amount of work required (W-bit collisions) for NSE proofs, in collision-bits.
*/
@@ -117,7 +124,7 @@ find_proof (void *cls)
while ((counter != UINT64_MAX) && (i < ROUND_SIZE))
{
GNUNET_memcpy (buf, &counter, sizeof(uint64_t));
- GNUNET_CRYPTO_pow_hash ("gnunet-nse-proof",
+ GNUNET_CRYPTO_pow_hash (&salt,
buf,
sizeof(buf),
&result);
diff --git a/src/util/test_os_start_process.c b/src/util/test_os_start_process.c
index 6d4a131bb..ff5021d03 100644
--- a/src/util/test_os_start_process.c
+++ b/src/util/test_os_start_process.c
@@ -124,11 +124,8 @@ run_task (void *cls)
GNUNET_asprintf (&fn, "cat");
- hello_pipe_stdin = GNUNET_DISK_pipe (GNUNET_YES, GNUNET_YES, GNUNET_YES,
- GNUNET_NO);
- hello_pipe_stdout = GNUNET_DISK_pipe (GNUNET_YES, GNUNET_YES, GNUNET_NO,
- GNUNET_YES);
-
+ hello_pipe_stdin = GNUNET_DISK_pipe (GNUNET_DISK_PF_BLOCKING_RW);
+ hello_pipe_stdout = GNUNET_DISK_pipe (GNUNET_DISK_PF_BLOCKING_RW);
if ((hello_pipe_stdout == NULL) || (hello_pipe_stdin == NULL))
{
GNUNET_break (0);
@@ -202,10 +199,8 @@ check_kill ()
{
char *fn;
- hello_pipe_stdin = GNUNET_DISK_pipe (GNUNET_YES, GNUNET_YES, GNUNET_YES,
- GNUNET_NO);
- hello_pipe_stdout = GNUNET_DISK_pipe (GNUNET_YES, GNUNET_YES, GNUNET_NO,
- GNUNET_YES);
+ hello_pipe_stdin = GNUNET_DISK_pipe (GNUNET_DISK_PF_BLOCKING_RW);
+ hello_pipe_stdout = GNUNET_DISK_pipe (GNUNET_DISK_PF_BLOCKING_RW);
if ((hello_pipe_stdout == NULL) || (hello_pipe_stdin == NULL))
{
return 1;
@@ -247,10 +242,8 @@ check_instant_kill ()
{
char *fn;
- hello_pipe_stdin = GNUNET_DISK_pipe (GNUNET_YES, GNUNET_YES, GNUNET_YES,
- GNUNET_NO);
- hello_pipe_stdout = GNUNET_DISK_pipe (GNUNET_YES, GNUNET_YES, GNUNET_NO,
- GNUNET_YES);
+ hello_pipe_stdin = GNUNET_DISK_pipe (GNUNET_DISK_PF_BLOCKING_RW);
+ hello_pipe_stdout = GNUNET_DISK_pipe (GNUNET_DISK_PF_BLOCKING_RW);
if ((hello_pipe_stdout == NULL) || (hello_pipe_stdin == NULL))
{
return 1;