summaryrefslogtreecommitdiff
path: root/src/hello/hello-ng.c
diff options
context:
space:
mode:
authorMartin Schanzenbach <mschanzenbach@posteo.de>2021-02-23 14:29:47 +0100
committerMartin Schanzenbach <mschanzenbach@posteo.de>2021-02-23 14:29:47 +0100
commitd528f6cfbe5e99a7e50e28d76b90654ecb955d9a (patch)
tree915e7b7853759235e167eb984ba26acdee5d3f34 /src/hello/hello-ng.c
parentd08924400d0750c7d37b2959cd262937d3d57840 (diff)
HELLO: Fix netdb.h nonsense with h_addr
Diffstat (limited to 'src/hello/hello-ng.c')
-rw-r--r--src/hello/hello-ng.c9
1 files changed, 5 insertions, 4 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,