[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnunet] branch master updated: HELLO: Fix netdb.h nonsense with h_addr
From: |
gnunet |
Subject: |
[gnunet] branch master updated: HELLO: Fix netdb.h nonsense with h_addr |
Date: |
Tue, 23 Feb 2021 14:31:07 +0100 |
This is an automated email from the git hooks/post-receive script.
martin-schanzenbach pushed a commit to branch master
in repository gnunet.
The following commit(s) were added to refs/heads/master by this push:
new d528f6cfb HELLO: Fix netdb.h nonsense with h_addr
d528f6cfb is described below
commit d528f6cfbe5e99a7e50e28d76b90654ecb955d9a
Author: Martin Schanzenbach <mschanzenbach@posteo.de>
AuthorDate: Tue Feb 23 14:29:47 2021 +0100
HELLO: Fix netdb.h nonsense with h_addr
---
src/hello/hello-ng.c | 9 +++++----
src/hello/test_hello-ng.c | 2 +-
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/src/hello/hello-ng.c b/src/hello/hello-ng.c
index 85b304e18..96856a692 100644
--- a/src/hello/hello-ng.c
+++ b/src/hello/hello-ng.c
@@ -30,6 +30,7 @@
#include "gnunet_util_lib.h"
#include "gnunet_ats_service.h"
+GNUNET_NETWORK_STRUCT_BEGIN
/**
* Binary block we sign when we sign an address.
*/
@@ -48,9 +49,9 @@ struct SignedAddress
/**
* Hash of the address.
*/
- struct GNUNET_HashCode h_addr;
+ struct GNUNET_HashCode addr_hash GNUNET_PACKED;
};
-
+GNUNET_NETWORK_STRUCT_END
/**
* Build address record by signing raw information with private key.
@@ -78,7 +79,7 @@ GNUNET_HELLO_sign_address (
sa.purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_TRANSPORT_ADDRESS);
sa.purpose.size = htonl (sizeof(sa));
sa.mono_time = GNUNET_TIME_absolute_hton (mono_time);
- GNUNET_CRYPTO_hash (address, strlen (address), &sa.h_addr);
+ GNUNET_CRYPTO_hash (address, strlen (address), &sa.addr_hash);
GNUNET_CRYPTO_eddsa_sign (private_key, &sa, &sig);
sig_str = NULL;
(void) GNUNET_STRINGS_base64_encode (&sig, sizeof(sig), &sig_str);
@@ -161,7 +162,7 @@ GNUNET_HELLO_extract_address (const void *raw,
sa.purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_TRANSPORT_ADDRESS);
sa.purpose.size = htonl (sizeof(sa));
sa.mono_time = GNUNET_TIME_absolute_hton (raw_mono_time);
- GNUNET_CRYPTO_hash (raw_addr, strlen (raw_addr), &sa.h_addr);
+ GNUNET_CRYPTO_hash (raw_addr, strlen (raw_addr), &sa.addr_hash);
if (GNUNET_YES !=
GNUNET_CRYPTO_eddsa_verify (GNUNET_SIGNATURE_PURPOSE_TRANSPORT_ADDRESS,
&sa,
diff --git a/src/hello/test_hello-ng.c b/src/hello/test_hello-ng.c
index 82b1ab6c6..e6b1d42a0 100644
--- a/src/hello/test_hello-ng.c
+++ b/src/hello/test_hello-ng.c
@@ -26,7 +26,7 @@ main (int argc,
(void**)&res,
&res_len);
GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE,
- "%s", res);
+ "%s\n", res);
GNUNET_assert (NULL !=
GNUNET_HELLO_extract_address ((void**)res,
res_len,
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnunet] branch master updated: HELLO: Fix netdb.h nonsense with h_addr,
gnunet <=