summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulius Bünger <buenger@mytum.de>2019-04-26 05:56:54 +0200
committerJulius Bünger <buenger@mytum.de>2019-04-26 05:56:54 +0200
commitf5f5a9f680df2cebe6435ec87650cb3cb6e3ef6e (patch)
tree94055d2c049a65b5ab6c61fd3c5867fe49f6f429
parenta097690795f4f814de7cdbc97ef95fb899eeacd3 (diff)
memcmp() -> GNUNET_memcmp(), first take
-rw-r--r--src/ats-tests/ats-testing.c15
-rw-r--r--src/ats-tests/perf_ats.c3
-rw-r--r--src/ats/ats_api_performance.c7
-rw-r--r--src/ats/ats_api_scheduling.c10
-rw-r--r--src/ats/gnunet-ats-solver-eval.c2
-rw-r--r--src/ats/gnunet-service-ats-new.c5
-rw-r--r--src/ats/gnunet-service-ats_addresses.c4
-rw-r--r--src/ats/gnunet-service-ats_normalization.c5
-rw-r--r--src/ats/plugin_ats2_simple.c5
-rw-r--r--src/ats/plugin_ats_mlp.c4
-rw-r--r--src/ats/plugin_ats_ril.c2
-rw-r--r--src/ats/test_ats_lib.c5
-rw-r--r--src/cadet/gnunet-service-cadet_channel.c15
-rw-r--r--src/cadet/gnunet-service-cadet_connection.c5
-rw-r--r--src/cadet/gnunet-service-cadet_core.c10
-rw-r--r--src/cadet/gnunet-service-cadet_hello.c5
-rw-r--r--src/cadet/gnunet-service-cadet_paths.c5
-rw-r--r--src/cadet/gnunet-service-cadet_tunnels.c45
-rw-r--r--src/consensus/gnunet-service-consensus.c7
-rw-r--r--src/credential/gnunet-service-credential.c10
-rw-r--r--src/datastore/plugin_datastore_mysql.c5
-rw-r--r--src/dht/gnunet-service-dht_neighbours.c10
-rw-r--r--src/dht/gnunet-service-dht_routing.c5
-rw-r--r--src/exit/gnunet-daemon-exit.c10
-rw-r--r--src/gns/plugin_block_gns.c2
-rw-r--r--src/hello/hello.c5
-rw-r--r--src/hello/test_hello.c5
-rw-r--r--src/hostlist/gnunet-daemon-hostlist.c10
-rw-r--r--src/identity/gnunet-service-identity.c2
-rw-r--r--src/namestore/gnunet-service-namestore.c28
-rw-r--r--src/namestore/gnunet-zoneimport.c5
-rw-r--r--src/namestore/namestore_api.c5
-rw-r--r--src/namestore/namestore_api_monitor.c9
-rw-r--r--src/namestore/perf_namestore_api_zone_iteration.c5
-rw-r--r--src/namestore/plugin_namestore_heap.c10
-rw-r--r--src/namestore/test_namestore_api_lookup_nick.c2
-rw-r--r--src/namestore/test_namestore_api_lookup_private.c5
-rw-r--r--src/namestore/test_namestore_api_monitoring.c5
-rw-r--r--src/namestore/test_namestore_api_monitoring_existing.c5
-rw-r--r--src/namestore/test_namestore_api_zone_iteration.c10
-rw-r--r--src/namestore/test_namestore_api_zone_iteration_nick.c4
-rw-r--r--src/namestore/test_namestore_api_zone_iteration_specific_zone.c7
-rw-r--r--src/namestore/test_namestore_api_zone_iteration_stop.c4
-rw-r--r--src/namestore/test_namestore_api_zone_to_name.c5
-rw-r--r--src/namestore/test_plugin_namestore.c5
-rw-r--r--src/nat-auto/gnunet-service-nat-auto_legacy.c3
-rw-r--r--src/nat/gnunet-service-nat.c45
-rw-r--r--src/nse/gnunet-service-nse.c14
-rw-r--r--src/peerinfo/gnunet-service-peerinfo.c7
-rw-r--r--src/peerinfo/peerinfo_api.c10
-rw-r--r--src/peerinfo/test_peerinfo_api_notify_friend_only.c4
-rw-r--r--src/pq/test_pq.c5
-rw-r--r--src/pt/gnunet-daemon-pt.c5
-rw-r--r--src/reclaim/oidc_helper.c3
-rw-r--r--src/reclaim/plugin_rest_openid_connect.c12
-rw-r--r--src/regex/regex_block_lib.c5
-rw-r--r--src/revocation/gnunet-revocation.c5
-rw-r--r--src/revocation/gnunet-service-revocation.c10
-rw-r--r--src/scalarproduct/gnunet-service-scalarproduct-ecc_alice.c5
-rw-r--r--src/scalarproduct/gnunet-service-scalarproduct_alice.c5
-rw-r--r--src/secretsharing/gnunet-secretsharing-profiler.c4
-rw-r--r--src/secretsharing/gnunet-service-secretsharing.c13
-rw-r--r--src/set/gnunet-service-set_intersection.c10
-rw-r--r--src/sq/test_sq.c5
-rw-r--r--src/topology/gnunet-daemon-topology.c25
-rw-r--r--src/vpn/gnunet-service-vpn.c10
66 files changed, 218 insertions, 324 deletions
diff --git a/src/ats-tests/ats-testing.c b/src/ats-tests/ats-testing.c
index 2d714d2be..d8b9e5ef5 100644
--- a/src/ats-tests/ats-testing.c
+++ b/src/ats-tests/ats-testing.c
@@ -151,9 +151,8 @@ find_partner (struct BenchmarkPeer *me,
for (c_m = 0; c_m < me->num_partners; c_m++)
{
/* Find a partner with other as destination */
- if (0 == memcmp (peer,
- &me->partners[c_m].dest->id,
- sizeof (struct GNUNET_PeerIdentity)))
+ if (0 == GNUNET_memcmp (peer,
+ &me->partners[c_m].dest->id))
{
return &me->partners[c_m];
}
@@ -170,17 +169,15 @@ find_peer (const struct GNUNET_PeerIdentity * peer)
for (c_p = 0; c_p < top->num_masters; c_p++)
{
- if (0 == memcmp (&top->mps[c_p].id,
- peer,
- sizeof(struct GNUNET_PeerIdentity)))
+ if (0 == GNUNET_memcmp (&top->mps[c_p].id,
+ peer))
return &top->mps[c_p];
}
for (c_p = 0; c_p < top->num_slaves; c_p++)
{
- if (0 == memcmp (&top->sps[c_p].id,
- peer,
- sizeof(struct GNUNET_PeerIdentity)))
+ if (0 == GNUNET_memcmp (&top->sps[c_p].id,
+ peer))
return &top->sps[c_p];
}
return NULL ;
diff --git a/src/ats-tests/perf_ats.c b/src/ats-tests/perf_ats.c
index 91c58e9a9..b8ab35f99 100644
--- a/src/ats-tests/perf_ats.c
+++ b/src/ats-tests/perf_ats.c
@@ -328,8 +328,7 @@ find_partner (struct BenchmarkPeer *me,
for (c_m = 0; c_m < me->num_partners; c_m++)
{
/* Find a partner with other as destination */
- if (0 == memcmp (peer, &me->partners[c_m].dest->id,
- sizeof(struct GNUNET_PeerIdentity)))
+ if (0 == GNUNET_memcmp (peer, &me->partners[c_m].dest->id))
{
return &me->partners[c_m];
}
diff --git a/src/ats/ats_api_performance.c b/src/ats/ats_api_performance.c
index 12dec776e..0954c02d5 100644
--- a/src/ats/ats_api_performance.c
+++ b/src/ats/ats_api_performance.c
@@ -383,9 +383,8 @@ handle_reservation_result (void *cls,
amount = ntohl (rr->amount);
rc = ph->reservation_head;
- if (0 != memcmp (&rr->peer,
- &rc->peer,
- sizeof(struct GNUNET_PeerIdentity)))
+ if (0 != GNUNET_memcmp (&rr->peer,
+ &rc->peer))
{
GNUNET_break(0);
reconnect (ph);
@@ -498,7 +497,7 @@ handle_address_list (void *cls,
return; /* was canceled */
memset (&allzeros, '\0', sizeof (allzeros));
- if ( (0 == memcmp (&allzeros, &pi->peer, sizeof(allzeros))) &&
+ if ( (0 == GNUNET_is_zero (&pi->peer)) &&
(0 == plugin_name_length) &&
(0 == plugin_address_length) )
{
diff --git a/src/ats/ats_api_scheduling.c b/src/ats/ats_api_scheduling.c
index 3c8ad9b9a..532426e91 100644
--- a/src/ats/ats_api_scheduling.c
+++ b/src/ats/ats_api_scheduling.c
@@ -230,9 +230,8 @@ find_session (struct GNUNET_ATS_SchedulingHandle *sh,
as we communicate asynchronously with the ATS service. */
return NULL;
}
- if (0 != memcmp (peer,
- &ar->address->peer,
- sizeof (struct GNUNET_PeerIdentity)))
+ if (0 != GNUNET_memcmp (peer,
+ &ar->address->peer))
{
GNUNET_break (0);
return NULL;
@@ -298,9 +297,8 @@ find_session_id (struct GNUNET_ATS_SchedulingHandle *sh,
(GNUNET_NO == sh->session_array[i]->in_destroy) &&
( (session == sh->session_array[i]->session) ||
(NULL == sh->session_array[i]->session) ) &&
- (0 == memcmp (&address->peer,
- &sh->session_array[i]->address->peer,
- sizeof (struct GNUNET_PeerIdentity))) &&
+ (0 == GNUNET_memcmp (&address->peer,
+ &sh->session_array[i]->address->peer)) &&
(0 == GNUNET_HELLO_address_cmp (address,
sh->session_array[i]->address)) )
return i;
diff --git a/src/ats/gnunet-ats-solver-eval.c b/src/ats/gnunet-ats-solver-eval.c
index 62e09533f..833cb9ded 100644
--- a/src/ats/gnunet-ats-solver-eval.c
+++ b/src/ats/gnunet-ats-solver-eval.c
@@ -122,7 +122,7 @@ find_peer_by_pid (const struct GNUNET_PeerIdentity *pid)
{
struct TestPeer *cur;
for (cur = peer_head; NULL != cur; cur = cur->next)
- if (0 == memcmp (&cur->peer_id, pid, sizeof (struct GNUNET_PeerIdentity)))
+ if (0 == GNUNET_memcmp (&cur->peer_id, pid))
return cur;
return NULL;
}
diff --git a/src/ats/gnunet-service-ats-new.c b/src/ats/gnunet-service-ats-new.c
index f2bc1de7f..b451c8c67 100644
--- a/src/ats/gnunet-service-ats-new.c
+++ b/src/ats/gnunet-service-ats-new.c
@@ -362,9 +362,8 @@ handle_suggest_cancel (void *cls,
cp = cp->next)
if ( (cp->pref.pk == (enum GNUNET_MQ_PreferenceKind) ntohl (msg->pk)) &&
(cp->pref.bw.value__ == msg->bw.value__) &&
- (0 == memcmp (&cp->pref.peer,
- &msg->peer,
- sizeof (struct GNUNET_PeerIdentity))) )
+ (0 == GNUNET_memcmp (&cp->pref.peer,
+ &msg->peer)) )
break;
if (NULL == cp)
{
diff --git a/src/ats/gnunet-service-ats_addresses.c b/src/ats/gnunet-service-ats_addresses.c
index dd5cee96f..efe968024 100644
--- a/src/ats/gnunet-service-ats_addresses.c
+++ b/src/ats/gnunet-service-ats_addresses.c
@@ -682,9 +682,7 @@ GAS_handle_request_address_list (struct GNUNET_SERVICE_Client *client,
memset (&allzeros,
'\0',
sizeof (struct GNUNET_PeerIdentity));
- if (0 == memcmp (&alrm->peer,
- &allzeros,
- sizeof (struct GNUNET_PeerIdentity)))
+ if (0 == GNUNET_is_zero (&alrm->peer))
{
/* Return addresses for all peers */
GAS_addresses_get_peer_info (NULL,
diff --git a/src/ats/gnunet-service-ats_normalization.c b/src/ats/gnunet-service-ats_normalization.c
index f68e6ec11..4b58bf9b7 100644
--- a/src/ats/gnunet-service-ats_normalization.c
+++ b/src/ats/gnunet-service-ats_normalization.c
@@ -250,9 +250,8 @@ GAS_normalization_update_property (struct ATS_Address *address)
GNUNET_CONTAINER_multipeermap_iterate (GSA_addresses,
&find_min_max_it,
&range);
- if (0 != memcmp (&range,
- &property_range,
- sizeof (struct PropertyRange)))
+ if (0 != GNUNET_memcmp (&range,
+ &property_range))
{
/* limits changed, (re)normalize all addresses */
property_range = range;
diff --git a/src/ats/plugin_ats2_simple.c b/src/ats/plugin_ats2_simple.c
index 449b50fb7..35a256f32 100644
--- a/src/ats/plugin_ats2_simple.c
+++ b/src/ats/plugin_ats2_simple.c
@@ -492,9 +492,8 @@ watch_cb (void *cls,
struct GNUNET_TIME_Absolute expiration;
struct Hello *hello;
- if (0 != memcmp (&p->pid,
- &record->peer,
- sizeof (struct GNUNET_PeerIdentity)))
+ if (0 != GNUNET_memcmp (&p->pid,
+ &record->peer))
{
GNUNET_break (0);
return;
diff --git a/src/ats/plugin_ats_mlp.c b/src/ats/plugin_ats_mlp.c
index 8e7880793..0f3a727a7 100644
--- a/src/ats/plugin_ats_mlp.c
+++ b/src/ats/plugin_ats_mlp.c
@@ -1401,7 +1401,7 @@ mlp_propagate_results (void *cls,
mlpi->b_in = mlp_bw_in;
address->assigned_bw_out = mlp_bw_out;
mlpi->b_out = mlp_bw_out;
- if ((NULL == mlp->exclude_peer) || (0 != memcmp (&address->peer, mlp->exclude_peer, sizeof (address->peer))))
+ if ((NULL == mlp->exclude_peer) || (0 != GNUNET_memcmp (&address->peer, mlp->exclude_peer)))
mlp->env->bandwidth_changed_cb (mlp->env->cls, address);
return GNUNET_OK;
}
@@ -1417,7 +1417,7 @@ mlp_propagate_results (void *cls,
mlpi->b_in = mlp_bw_in;
address->assigned_bw_out = mlp_bw_out;
mlpi->b_out = mlp_bw_out;
- if ((NULL == mlp->exclude_peer) || (0 != memcmp (&address->peer, mlp->exclude_peer, sizeof (address->peer))))
+ if ((NULL == mlp->exclude_peer) || (0 != GNUNET_memcmp (&address->peer, mlp->exclude_peer)))
mlp->env->bandwidth_changed_cb (mlp->env->cls, address);
return GNUNET_OK;
}
diff --git a/src/ats/plugin_ats_ril.c b/src/ats/plugin_ats_ril.c
index 6e55f3a1c..9f78450c2 100644
--- a/src/ats/plugin_ats_ril.c
+++ b/src/ats/plugin_ats_ril.c
@@ -2016,7 +2016,7 @@ ril_get_agent (struct GAS_RIL_Handle *solver, const struct GNUNET_PeerIdentity *
for (cur = solver->agents_head; NULL != cur; cur = cur->next)
{
- if (0 == memcmp (peer, &cur->peer, sizeof(struct GNUNET_PeerIdentity)))
+ if (0 == GNUNET_memcmp (peer, &cur->peer))
{
return cur;
}
diff --git a/src/ats/test_ats_lib.c b/src/ats/test_ats_lib.c
index 21eca18e9..33597e678 100644
--- a/src/ats/test_ats_lib.c
+++ b/src/ats/test_ats_lib.c
@@ -540,9 +540,8 @@ reservation_cb (void *cls,
cmd->details.reserve_bandwidth.rc = NULL;
make_peer (cmd->details.reserve_bandwidth.pid,
&pid);
- GNUNET_assert (0 == memcmp (peer,
- &pid,
- sizeof (struct GNUNET_PeerIdentity)));
+ GNUNET_assert (0 == GNUNET_memcmp (peer,
+ &pid));
switch (cmd->details.reserve_bandwidth.expected_result)
{
case GNUNET_OK:
diff --git a/src/cadet/gnunet-service-cadet_channel.c b/src/cadet/gnunet-service-cadet_channel.c
index 1e898c1eb..bd95428be 100644
--- a/src/cadet/gnunet-service-cadet_channel.c
+++ b/src/cadet/gnunet-service-cadet_channel.c
@@ -679,9 +679,8 @@ GCCH_channel_local_new (struct CadetClient *owner,
GCCH_hash_port (&ch->h_port,
port,
GCP_get_id (destination));
- if (0 == memcmp (&my_full_id,
- GCP_get_id (destination),
- sizeof (struct GNUNET_PeerIdentity)))
+ if (0 == GNUNET_memcmp (&my_full_id,
+ GCP_get_id (destination)))
{
struct OpenPort *op;
@@ -1185,9 +1184,8 @@ GCCH_handle_channel_open_ack (struct CadetChannel *ch,
GNUNET_break_op (0);
return;
}
- if (0 != memcmp (&ch->port,
- port,
- sizeof (struct GNUNET_HashCode)))
+ if (0 != GNUNET_memcmp (&ch->port,
+ port))
{
/* Other peer failed to provide the right port,
refuse connection. */
@@ -1612,9 +1610,8 @@ handle_matching_ack (struct CadetChannel *ch,
(NULL != cti) )
{
GCC_ack_observed (cti);
- if (0 == memcmp (cti,
- &crm->connection_taken,
- sizeof (struct GNUNET_CADET_ConnectionTunnelIdentifier)))
+ if (0 == GNUNET_memcmp (cti,
+ &crm->connection_taken))
{
GCC_latency_observed (cti,
GNUNET_TIME_absolute_get_duration (crm->first_transmission_time));
diff --git a/src/cadet/gnunet-service-cadet_connection.c b/src/cadet/gnunet-service-cadet_connection.c
index 4f1e5be8e..1f7e86d60 100644
--- a/src/cadet/gnunet-service-cadet_connection.c
+++ b/src/cadet/gnunet-service-cadet_connection.c
@@ -919,9 +919,8 @@ GCC_create_inbound (struct CadetPeer *destination,
{
int cmp;
- cmp = memcmp (cid,
- &cc->cid,
- sizeof (*cid));
+ cmp = GNUNET_memcmp (cid,
+ &cc->cid);
if (0 == cmp)
{
/* Two peers picked the SAME random connection identifier at the
diff --git a/src/cadet/gnunet-service-cadet_core.c b/src/cadet/gnunet-service-cadet_core.c
index 275785b57..879230d29 100644
--- a/src/cadet/gnunet-service-cadet_core.c
+++ b/src/cadet/gnunet-service-cadet_core.c
@@ -843,9 +843,8 @@ handle_connection_create (void *cls,
}
/* Initiator is at offset 0, find us */
for (off=1;off<path_length;off++)
- if (0 == memcmp (&my_full_id,
- &pids[off],
- sizeof (struct GNUNET_PeerIdentity)))
+ if (0 == GNUNET_memcmp (&my_full_id,
+ &pids[off]))
break;
if (off == path_length)
{
@@ -1310,9 +1309,8 @@ core_init_cb (void *cls,
return;
}
GNUNET_break (0 ==
- memcmp (my_identity,
- &my_full_id,
- sizeof (struct GNUNET_PeerIdentity)));
+ GNUNET_memcmp (my_identity,
+ &my_full_id));
}
diff --git a/src/cadet/gnunet-service-cadet_hello.c b/src/cadet/gnunet-service-cadet_hello.c
index 2c06006f4..fe2477c34 100644
--- a/src/cadet/gnunet-service-cadet_hello.c
+++ b/src/cadet/gnunet-service-cadet_hello.c
@@ -72,9 +72,8 @@ got_hello (void *cls,
if ( (NULL == id) ||
(NULL == hello) )
return;
- if (0 == memcmp (id,
- &my_full_id,
- sizeof (struct GNUNET_PeerIdentity)))
+ if (0 == GNUNET_memcmp (id,
+ &my_full_id))
{
GNUNET_free_non_null (mine);
mine = (struct GNUNET_HELLO_Message *) GNUNET_copy_message (&hello->header);
diff --git a/src/cadet/gnunet-service-cadet_paths.c b/src/cadet/gnunet-service-cadet_paths.c
index a061c5685..bdc92668e 100644
--- a/src/cadet/gnunet-service-cadet_paths.c
+++ b/src/cadet/gnunet-service-cadet_paths.c
@@ -496,9 +496,8 @@ GCPP_try_path_from_dht (const struct GNUNET_PeerIdentity *get_path,
? &get_path[get_path_length - off - 1]
: &put_path[get_path_length + put_path_length - off - 1];
/* Check that I am not in the path */
- if (0 == memcmp (&my_full_id,
- pid,
- sizeof (struct GNUNET_PeerIdentity)))
+ if (0 == GNUNET_memcmp (&my_full_id,
+ pid))
{
skip = off + 1;
continue;
diff --git a/src/cadet/gnunet-service-cadet_tunnels.c b/src/cadet/gnunet-service-cadet_tunnels.c
index 57a6d1adf..a2a493ebd 100644
--- a/src/cadet/gnunet-service-cadet_tunnels.c
+++ b/src/cadet/gnunet-service-cadet_tunnels.c
@@ -1013,9 +1013,8 @@ try_old_ax_keys (struct CadetTunnelAxolotl *ax,
0,
&key->HK,
hmac);
- if (0 == memcmp (hmac,
- &src->hmac,
- sizeof (*hmac)))
+ if (0 == GNUNET_memcmp (hmac,
+ &src->hmac))
{
valid_HK = &key->HK;
break;
@@ -1047,9 +1046,8 @@ try_old_ax_keys (struct CadetTunnelAxolotl *ax,
(N != key->Kn) )
key = key->next;
if ( (NULL == key) ||
- (0 != memcmp (&key->HK,
- valid_HK,
- sizeof (*valid_HK))) )
+ (0 != GNUNET_memcmp (&key->HK,
+ valid_HK)) )
return -1;
/* Decrypt payload */
@@ -1181,9 +1179,8 @@ t_ax_decrypt_and_validate (struct CadetTunnelAxolotl *ax,
sizeof (struct GNUNET_CADET_AxHeader) + esize,
0, &ax->HKr,
&msg_hmac);
- if (0 != memcmp (&msg_hmac,
- &src->hmac,
- sizeof (msg_hmac)))
+ if (0 != GNUNET_memcmp (&msg_hmac,
+ &src->hmac))
{
static const char ctx[] = "axolotl ratchet";
struct GNUNET_CRYPTO_SymmetricSessionKey keys[3]; /* RKp, NHKp, CKp */
@@ -1197,9 +1194,8 @@ t_ax_decrypt_and_validate (struct CadetTunnelAxolotl *ax,
0,
&ax->NHKr,
&msg_hmac);
- if (0 != memcmp (&msg_hmac,
- &src->hmac,
- sizeof (msg_hmac)))
+ if (0 != GNUNET_memcmp (&msg_hmac,
+ &src->hmac))
{
/* Try the skipped keys, if that fails, we're out of luck. */
return try_old_ax_keys (ax,
@@ -1528,9 +1524,8 @@ update_ax_by_kx (struct CadetTunnelAxolotl *ax,
GNUNET_break_op (0);
return GNUNET_SYSERR;
}
- if (0 == memcmp (&ax->DHRr,
- ratchet_key,
- sizeof (*ratchet_key)))
+ if (0 == GNUNET_memcmp (&ax->DHRr,
+ ratchet_key))
{
GNUNET_STATISTICS_update (stats,
"# Ratchet key already known",
@@ -1872,9 +1867,8 @@ check_ee (const struct GNUNET_CRYPTO_EcdhePrivateKey *e1,
GNUNET_CRYPTO_ecc_ecdh (e2,
&p1,
&hc2));
- GNUNET_break (0 == memcmp (&hc1,
- &hc2,
- sizeof (hc1)));
+ GNUNET_break (0 == GNUNET_memcmp (&hc1,
+ &hc2));
}
@@ -1899,9 +1893,8 @@ check_ed (const struct GNUNET_CRYPTO_EcdhePrivateKey *e1,
GNUNET_CRYPTO_eddsa_ecdh (e2,
&p1,
&hc2));
- GNUNET_break (0 == memcmp (&hc1,
- &hc2,
- sizeof (hc1)));
+ GNUNET_break (0 == GNUNET_memcmp (&hc1,
+ &hc2));
}
@@ -1974,9 +1967,8 @@ GCT_handle_kx_auth (struct CadetTConnection *ct,
GNUNET_CRYPTO_hash (&ax_tmp.RK,
sizeof (ax_tmp.RK),
&kx_auth);
- if (0 != memcmp (&kx_auth,
- &msg->auth,
- sizeof (kx_auth)))
+ if (0 != GNUNET_memcmp (&kx_auth,
+ &msg->auth))
{
/* This KX_AUTH is not using the latest KX/KX_AUTH data
we transmitted to the sender, refuse it, try KX again. */
@@ -1992,9 +1984,8 @@ GCT_handle_kx_auth (struct CadetTConnection *ct,
GNUNET_CRYPTO_ecdhe_key_get_public (&ax_tmp.kx_0,
&ephemeral_key);
- if (0 != memcmp (&ephemeral_key,
- &msg->r_ephemeral_key_XXX,
- sizeof (ephemeral_key)))
+ if (0 != GNUNET_memcmp (&ephemeral_key,
+ &msg->r_ephemeral_key_XXX))
{
LOG (GNUNET_ERROR_TYPE_WARNING,
"My ephemeral is %s!\n",
diff --git a/src/consensus/gnunet-service-consensus.c b/src/consensus/gnunet-service-consensus.c
index 04e71afd9..912d3de6a 100644
--- a/src/consensus/gnunet-service-consensus.c
+++ b/src/consensus/gnunet-service-consensus.c
@@ -2406,7 +2406,7 @@ get_peer_idx (const struct GNUNET_PeerIdentity *peer, const struct ConsensusSess
{
int i;
for (i = 0; i < session->num_peers; i++)
- if (0 == memcmp (peer, &session->peers[i], sizeof (struct GNUNET_PeerIdentity)))
+ if (0 == GNUNET_memcmp (peer, &session->peers[i]))
return i;
return -1;
}
@@ -2476,9 +2476,8 @@ initialize_session_peer_list (struct ConsensusSession *session,
local_peer_in_list = GNUNET_NO;
for (unsigned int i = 0; i < session->num_peers; i++)
{
- if (0 == memcmp (&msg_peers[i],
- &my_peer,
- sizeof (struct GNUNET_PeerIdentity)))
+ if (0 == GNUNET_memcmp (&msg_peers[i],
+ &my_peer))
{
local_peer_in_list = GNUNET_YES;
break;
diff --git a/src/credential/gnunet-service-credential.c b/src/credential/gnunet-service-credential.c
index b0475d0f2..75711265d 100644
--- a/src/credential/gnunet-service-credential.c
+++ b/src/credential/gnunet-service-credential.c
@@ -640,9 +640,8 @@ backward_resolution (void *cls,
for (cred_pointer = vrh->cred_chain_head; cred_pointer != NULL;
cred_pointer = cred_pointer->next) {
if (0
- != memcmp (&set->subject_key,
- &cred_pointer->credential->issuer_key,
- sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey)))
+ != GNUNET_memcmp (&set->subject_key,
+ &cred_pointer->credential->issuer_key))
continue;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Checking if %s matches %s\n",
@@ -755,9 +754,8 @@ delegation_chain_resolution_start (void *cls)
for (cr_entry = vrh->cred_chain_head; cr_entry != NULL;
cr_entry = cr_entry->next) {
if (0
- != memcmp (&cr_entry->credential->issuer_key,
- &vrh->issuer_key,
- sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey)))
+ != GNUNET_memcmp (&cr_entry->credential->issuer_key,
+ &vrh->issuer_key))
continue;
if (0
!= strcmp (cr_entry->credential->issuer_attribute,
diff --git a/src/datastore/plugin_datastore_mysql.c b/src/datastore/plugin_datastore_mysql.c
index 02900429d..68371d389 100644
--- a/src/datastore/plugin_datastore_mysql.c
+++ b/src/datastore/plugin_datastore_mysql.c
@@ -862,9 +862,8 @@ mysql_plugin_get_keys (void *cls,
{
ret = GNUNET_MY_extract_result (plugin->get_all_keys,
results_select);
- if (0 != memcmp (&last,
- &key,
- sizeof (key)))
+ if (0 != GNUNET_memcmp (&last,
+ &key))
{
if (0 != cnt)
proc (proc_cls,
diff --git a/src/dht/gnunet-service-dht_neighbours.c b/src/dht/gnunet-service-dht_neighbours.c
index 3c5b52539..4f040558a 100644
--- a/src/dht/gnunet-service-dht_neighbours.c
+++ b/src/dht/gnunet-service-dht_neighbours.c
@@ -727,9 +727,8 @@ handle_core_connect (void *cls,
(void) cls;
/* Check for connect to self message */
- if (0 == memcmp (&my_identity,
- peer,
- sizeof (struct GNUNET_PeerIdentity)))
+ if (0 == GNUNET_memcmp (&my_identity,
+ peer))
return NULL;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Connected to %s\n",
@@ -959,9 +958,8 @@ GDS_am_closest_peer (const struct GNUNET_HashCode *key,
int bucket_num;
struct PeerInfo *pos;
- if (0 == memcmp (&my_identity_hash,
- key,
- sizeof (struct GNUNET_HashCode)))
+ if (0 == GNUNET_memcmp (&my_identity_hash,
+ key))
return GNUNET_YES;
bucket_num = find_bucket (key);
GNUNET_assert (bucket_num >= 0);
diff --git a/src/dht/gnunet-service-dht_routing.c b/src/dht/gnunet-service-dht_routing.c
index ab4e859b5..1cee45a22 100644
--- a/src/dht/gnunet-service-dht_routing.c
+++ b/src/dht/gnunet-service-dht_routing.c
@@ -368,9 +368,8 @@ try_combine_recent (void *cls,
struct RecentRequest *in = cls;
struct RecentRequest *rr = value;
- if ( (0 != memcmp (&in->peer,
- &rr->peer,
- sizeof (struct GNUNET_PeerIdentity))) ||
+ if ( (0 != GNUNET_memcmp (&in->peer,
+ &rr->peer)) ||
(in->type != rr->type) ||
(in->xquery_size != rr->xquery_size) ||
(0 != memcmp (in->xquery,
diff --git a/src/exit/gnunet-daemon-exit.c b/src/exit/gnunet-daemon-exit.c
index 3dedae830..5bcf53f57 100644
--- a/src/exit/gnunet-daemon-exit.c
+++ b/src/exit/gnunet-daemon-exit.c
@@ -1227,12 +1227,10 @@ setup_fresh_address (int af,
= (addr.s6_addr[i] | rnd.s6_addr[i]) & mask.s6_addr[i];
}
}
- while ( (0 == memcmp (&local_address->address.ipv6,
- &addr,
- sizeof (struct in6_addr))) ||
- (0 == memcmp (&local_address->address.ipv6,
- &mask,
- sizeof (struct in6_addr))) );
+ while ( (0 == GNUNET_memcmp (&local_address->address.ipv6,
+ &addr)) ||
+ (0 == GNUNET_memcmp (&local_address->address.ipv6,
+ &mask)) );
}
break;
default:
diff --git a/src/gns/plugin_block_gns.c b/src/gns/plugin_block_gns.c
index 1f27cb04e..86d45b9fe 100644
--- a/src/gns/plugin_block_gns.c
+++ b/src/gns/plugin_block_gns.c
@@ -153,7 +153,7 @@ block_plugin_gns_evaluate (void *cls,
GNUNET_CRYPTO_hash (&block->derived_key,
sizeof (block->derived_key),
&h);
- if (0 != memcmp (&h, query, sizeof (struct GNUNET_HashCode)))
+ if (0 != GNUNET_memcmp (&h, query))
{
GNUNET_break_op (0);
return GNUNET_BLOCK_EVALUATION_RESULT_INVALID;
diff --git a/src/hello/hello.c b/src/hello/hello.c
index 218d73127..f803f4370 100644
--- a/src/hello/hello.c
+++ b/src/hello/hello.c
@@ -838,9 +838,8 @@ GNUNET_HELLO_equals (const struct GNUNET_HELLO_Message *h1,
if (h1->header.type != h2->header.type)
return GNUNET_TIME_UNIT_ZERO_ABS;
if (0 !=
- memcmp (&h1->publicKey,
- &h2->publicKey,
- sizeof (struct GNUNET_CRYPTO_EddsaPublicKey)))
+ GNUNET_memcmp (&h1->publicKey,
+ &h2->publicKey))
return GNUNET_TIME_UNIT_ZERO_ABS;
ec.expiration_limit = now;
ec.result = GNUNET_TIME_UNIT_FOREVER_ABS;
diff --git a/src/hello/test_hello.c b/src/hello/test_hello.c
index 4d8988c50..1f9c398fa 100644
--- a/src/hello/test_hello.c
+++ b/src/hello/test_hello.c
@@ -179,9 +179,8 @@ main (int argc,
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Testing get_key from HELLO...\n");
GNUNET_assert (GNUNET_OK == GNUNET_HELLO_get_id (msg2, &pid));
- GNUNET_assert (0 == memcmp (&publicKey,
- &pid.public_key,
- sizeof (struct GNUNET_CRYPTO_EddsaPublicKey)));
+ GNUNET_assert (0 == GNUNET_memcmp (&publicKey,
+ &pid.public_key));
GNUNET_free (msg1);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
diff --git a/src/hostlist/gnunet-daemon-hostlist.c b/src/hostlist/gnunet-daemon-hostlist.c
index 478776128..760d5f543 100644
--- a/src/hostlist/gnunet-daemon-hostlist.c
+++ b/src/hostlist/gnunet-daemon-hostlist.c
@@ -201,9 +201,8 @@ connect_handler (void *cls,
const struct GNUNET_PeerIdentity *peer,
struct GNUNET_MQ_Handle *mq)
{
- if (0 == memcmp (&me,
- peer,
- sizeof (struct GNUNET_PeerIdentity)))
+ if (0 == GNUNET_memcmp (&me,
+ peer))
return NULL;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"A new peer connected, notifying client and server\n");
@@ -235,9 +234,8 @@ disconnect_handler (void *cls,
const struct GNUNET_PeerIdentity *peer,
void *internal_cls)
{
- if (0 == memcmp (&me,
- peer,
- sizeof (struct GNUNET_PeerIdentity)))
+ if (0 == GNUNET_memcmp (&me,
+ peer))
return;
/* call hostlist client disconnect handler */
if (NULL != client_dh)
diff --git a/src/identity/gnunet-service-identity.c b/src/identity/gnunet-service-identity.c
index 3e53d1ceb..0a2fbbcb8 100644
--- a/src/identity/gnunet-service-identity.c
+++ b/src/identity/gnunet-service-identity.c
@@ -429,7 +429,7 @@ static int
key_cmp (const struct GNUNET_CRYPTO_EcdsaPrivateKey *pk1,
const struct GNUNET_CRYPTO_EcdsaPrivateKey *pk2)
{
- return memcmp (pk1, pk2, sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey));
+ return GNUNET_memcmp (pk1, pk2);
}
/**
diff --git a/src/namestore/gnunet-service-namestore.c b/src/namestore/gnunet-service-namestore.c
index 45be0fe75..d2a09087e 100644
--- a/src/namestore/gnunet-service-namestore.c
+++ b/src/namestore/gnunet-service-namestore.c
@@ -553,9 +553,8 @@ cache_nick (const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone,
(oldest->last_used.abs_value_us >
pos->last_used.abs_value_us) )
oldest = pos;
- if (0 == memcmp (zone,
- &pos->zone,
- sizeof (*zone)))
+ if (0 == GNUNET_memcmp (zone,
+ &pos->zone))
{
oldest = pos;
break;
@@ -592,9 +591,8 @@ get_nick_record (const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone)
{
struct NickCache *pos = &nick_cache[i];
if ( (NULL != pos->rd) &&
- (0 == memcmp (zone,
- &pos->zone,
- sizeof (*zone))) )
+ (0 == GNUNET_memcmp (zone,
+ &pos->zone)) )
{
nick = GNUNET_malloc (sizeof (*nick) +
pos->rd->data_size);
@@ -1082,12 +1080,10 @@ continue_store_activity (struct StoreActivity *sa)
NULL != zm;
zm = sa->zm_pos)
{
- if ( (0 != memcmp (&rp_msg->private_key,
- &zm->zone,
- sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey))) &&
- (0 != memcmp (&zm->zone,
- &zero,
- sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey))) )
+ if ( (0 != GNUNET_memcmp (&rp_msg->private_key,
+ &zm->zone)) &&
+ (0 != GNUNET_memcmp (&zm->zone,
+ &zero)) )
{
sa->zm_pos = zm->next; /* not interesting to this monitor */
continue;
@@ -1921,9 +1917,7 @@ run_zone_iteration_round (struct ZoneIteration *zi,
start = GNUNET_TIME_absolute_get ();
GNUNET_break (GNUNET_SYSERR !=
GSN_database->iterate_records (GSN_database->cls,
- (0 == memcmp (&zi->zone,
- &zero,
- sizeof (zero)))
+ (0 == GNUNET_is_zero (&zi->zone))
? NULL
: &zi->zone,
zi->seq,
@@ -2220,9 +2214,7 @@ monitor_iteration_next (void *cls)
else
zm->iteration_cnt = zm->limit; /* use it all */
ret = GSN_database->iterate_records (GSN_database->cls,
- (0 == memcmp (&zm->zone,
- &zero,
- sizeof (zero)))
+ (0 == GNUNET_is_zero (&zm->zone))
? NULL
: &zm->zone,
zm->seq,
diff --git a/src/namestore/gnunet-zoneimport.c b/src/namestore/gnunet-zoneimport.c
index e7d040ec4..f36106332 100644
--- a/src/namestore/gnunet-zoneimport.c
+++ b/src/namestore/gnunet-zoneimport.c
@@ -1583,9 +1583,8 @@ ns_lookup_result_cb (void *cls,
GNUNET_CONTAINER_multihashmap_remove (ns_pending,
&hc,
req));
- GNUNET_break (0 == memcmp (key,
- &req->zone->key,
- sizeof (*key)));
+ GNUNET_break (0 == GNUNET_memcmp (key,
+ &req->zone->key));
GNUNET_break (0 == strcasecmp (label,
get_label (req)));
for (unsigned int i=0;i<rd_count;i++)
diff --git a/src/namestore/namestore_api.c b/src/namestore/namestore_api.c
index 89eb0afa4..99fd17473 100644
--- a/src/namestore/namestore_api.c
+++ b/src/namestore/namestore_api.c
@@ -552,9 +552,8 @@ check_record_result (void *cls,
GNUNET_break (0);
return GNUNET_SYSERR;
}
- if (0 == memcmp (&msg->private_key,
- &priv_dummy,
- sizeof (priv_dummy)) )
+ if (0 == GNUNET_memcmp (&msg->private_key,
+ &priv_dummy) )
{
GNUNET_break (0);
return GNUNET_SYSERR;
diff --git a/src/namestore/namestore_api_monitor.c b/src/namestore/namestore_api_monitor.c
index 67715f634..99e3864c9 100644
--- a/src/namestore/namestore_api_monitor.c
+++ b/src/namestore/namestore_api_monitor.c
@@ -142,12 +142,9 @@ check_result (void *cls,
const char *rd_ser_tmp;
(void) cls;
- if ( (0 != memcmp (&lrm->private_key,
- &zm->zone,
- sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey))) &&
- (0 != memcmp (&zero,
- &zm->zone,
- sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey))) )
+ if ( (0 != GNUNET_memcmp (&lrm->private_key,
+ &zm->zone)) &&
+ (0 != GNUNET_is_zero (&zm->zone)) )
{
GNUNET_break (0);
return GNUNET_SYSERR;
diff --git a/src/namestore/perf_namestore_api_zone_iteration.c b/src/namestore/perf_namestore_api_zone_iteration.c
index 5da958aad..156f9227c 100644
--- a/src/namestore/perf_namestore_api_zone_iteration.c
+++ b/src/namestore/perf_namestore_api_zone_iteration.c
@@ -241,9 +241,8 @@ zone_proc (void *cls,
return;
}
GNUNET_free (wrd);
- if (0 != memcmp (zone,
- privkey,
- sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey)))
+ if (0 != GNUNET_memcmp (zone,
+ privkey))
{
res = 5;
GNUNET_break (0);
diff --git a/src/namestore/plugin_namestore_heap.c b/src/namestore/plugin_namestore_heap.c
index 01cf592ea..8fe03764d 100644
--- a/src/namestore/plugin_namestore_heap.c
+++ b/src/namestore/plugin_namestore_heap.c
@@ -592,9 +592,8 @@ iterate_zones (void *cls,
if (0 == ic->limit)
return GNUNET_NO;
if ( (NULL != ic->zone) &&
- (0 != memcmp (&entry->private_key,
- ic->zone,
- sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey))) )
+ (0 != GNUNET_memcmp (&entry->private_key,
+ ic->zone)) )
return GNUNET_YES;
ic->pos++;
if (ic->offset > 0)
@@ -676,9 +675,8 @@ zone_to_name (void *cls,
struct FlatFileEntry *entry = value;
(void) key;
- if (0 != memcmp (&entry->private_key,
- ztn->zone,
- sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey)))
+ if (0 != GNUNET_memcmp (&entry->private_key,
+ ztn->zone))
return GNUNET_YES;
for (unsigned int i = 0; i < entry->record_count; i++)
diff --git a/src/namestore/test_namestore_api_lookup_nick.c b/src/namestore/test_namestore_api_lookup_nick.c
index 1257701e9..392a2521d 100644
--- a/src/namestore/test_namestore_api_lookup_nick.c
+++ b/src/namestore/test_namestore_api_lookup_nick.c
@@ -111,7 +111,7 @@ lookup_it (void *cls,
int found_record = GNUNET_NO;
int found_nick = GNUNET_NO;
- if (0 != memcmp(privkey, zone, sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey)))
+ if (0 != GNUNET_memcmp(privkey, zone))
{
GNUNET_break(0);
GNUNET_SCHEDULER_cancel (endbadly_task);
diff --git a/src/namestore/test_namestore_api_lookup_private.c b/src/namestore/test_namestore_api_lookup_private.c
index 2615f52c8..cf9bfc20c 100644
--- a/src/namestore/test_namestore_api_lookup_private.c
+++ b/src/namestore/test_namestore_api_lookup_private.c
@@ -103,9 +103,8 @@ lookup_it (void *cls,
{
nsqe = NULL;
- if (0 != memcmp (privkey,
- zone,
- sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey)))
+ if (0 != GNUNET_memcmp (privkey,
+ zone))
{
GNUNET_break(0);
GNUNET_SCHEDULER_cancel (endbadly_task);
diff --git a/src/namestore/test_namestore_api_monitoring.c b/src/namestore/test_namestore_api_monitoring.c
index c85ec8457..8fbeb6479 100644
--- a/src/namestore/test_namestore_api_monitoring.c
+++ b/src/namestore/test_namestore_api_monitoring.c
@@ -156,9 +156,8 @@ zone_proc (void *cls,
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Comparing results name %s\n",
name);
- if (0 != memcmp (zone_key,
- privkey,
- sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey)))
+ if (0 != GNUNET_memcmp (zone_key,
+ privkey))
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Monitoring returned wrong zone key\n");
diff --git a/src/namestore/test_namestore_api_monitoring_existing.c b/src/namestore/test_namestore_api_monitoring_existing.c
index 64bfb6949..e54046c85 100644
--- a/src/namestore/test_namestore_api_monitoring_existing.c
+++ b/src/namestore/test_namestore_api_monitoring_existing.c
@@ -150,9 +150,8 @@ zone_proc (void *cls,
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Comparing results name %s\n",
name);
- if (0 != memcmp (zone_key,
- privkey,
- sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey)))
+ if (0 != GNUNET_memcmp (zone_key,
+ privkey))
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Monitoring returned wrong zone key\n");
diff --git a/src/namestore/test_namestore_api_zone_iteration.c b/src/namestore/test_namestore_api_zone_iteration.c
index fa641954b..94331f89e 100644
--- a/src/namestore/test_namestore_api_zone_iteration.c
+++ b/src/namestore/test_namestore_api_zone_iteration.c
@@ -160,9 +160,8 @@ zone_proc (void *cls,
int failed = GNUNET_NO;
GNUNET_assert (NULL != zone);
- if (0 == memcmp (zone,
- privkey,
- sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey)))
+ if (0 == GNUNET_memcmp (zone,
+ privkey))
{
if (0 == strcmp (label, s_name_1))
{
@@ -207,9 +206,8 @@ zone_proc (void *cls,
GNUNET_break (0);
}
}
- else if (0 == memcmp (zone,
- privkey2,
- sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey)))
+ else if (0 == GNUNET_memcmp (zone,
+ privkey2))
{
if (0 == strcmp (label, s_name_3))
{
diff --git a/src/namestore/test_namestore_api_zone_iteration_nick.c b/src/namestore/test_namestore_api_zone_iteration_nick.c
index 9df6c98cc..069c6d831 100644
--- a/src/namestore/test_namestore_api_zone_iteration_nick.c
+++ b/src/namestore/test_namestore_api_zone_iteration_nick.c
@@ -171,13 +171,13 @@ zone_proc (void *cls,
int failed = GNUNET_NO;
GNUNET_assert (NULL != zone);
- if (0 == memcmp (zone, privkey, sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey)))
+ if (0 == GNUNET_memcmp (zone, privkey))
{
failed = check_zone_1 (label, rd_count, rd);
if (GNUNET_YES == failed)
GNUNET_break (0);
}
- else if (0 == memcmp (zone, privkey2, sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey)))
+ else if (0 == GNUNET_memcmp (zone, privkey2))
{
failed = check_zone_2 (label, rd_count, rd);
if (GNUNET_YES == failed)
diff --git a/src/namestore/test_namestore_api_zone_iteration_specific_zone.c b/src/namestore/test_namestore_api_zone_iteration_specific_zone.c
index cbcd94cd5..e3c6d698a 100644
--- a/src/namestore/test_namestore_api_zone_iteration_specific_zone.c
+++ b/src/namestore/test_namestore_api_zone_iteration_specific_zone.c
@@ -142,9 +142,8 @@ zone_proc (void *cls,
int failed = GNUNET_NO;
GNUNET_assert (NULL != zone);
- if (0 == memcmp (zone,
- privkey,
- sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey)))
+ if (0 == GNUNET_memcmp (zone,
+ privkey))
{
if (0 == strcmp (label, s_name_1))
{
@@ -189,7 +188,7 @@ zone_proc (void *cls,
GNUNET_break (0);
}
}
- else if (0 == memcmp (zone, privkey2, sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey)))
+ else if (0 == GNUNET_memcmp (zone, privkey2))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Received data for not requested zone\n");
diff --git a/src/namestore/test_namestore_api_zone_iteration_stop.c b/src/namestore/test_namestore_api_zone_iteration_stop.c
index 38da3136c..28f424b23 100644
--- a/src/namestore/test_namestore_api_zone_iteration_stop.c
+++ b/src/namestore/test_namestore_api_zone_iteration_stop.c
@@ -130,7 +130,7 @@ zone_proc (void *cls,
int failed = GNUNET_NO;
GNUNET_assert (NULL != zone);
- if (0 == memcmp (zone, privkey, sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey)))
+ if (0 == GNUNET_memcmp (zone, privkey))
{
if (0 == strcmp (label, s_name_1))
{
@@ -174,7 +174,7 @@ zone_proc (void *cls,
GNUNET_break (0);
}
}
- else if (0 == memcmp (zone, privkey2, sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey)))
+ else if (0 == GNUNET_memcmp (zone, privkey2))
{
if (0 == strcmp (label, s_name_3))
{
diff --git a/src/namestore/test_namestore_api_zone_to_name.c b/src/namestore/test_namestore_api_zone_to_name.c
index 5d6444145..cb580572e 100644
--- a/src/namestore/test_namestore_api_zone_to_name.c
+++ b/src/namestore/test_namestore_api_zone_to_name.c
@@ -132,9 +132,8 @@ zone_to_name_proc (void *cls,
GNUNET_break (0);
}
if ( (NULL == zone_key) ||
- (0 != memcmp (zone_key,
- privkey,
- sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey))))
+ (0 != GNUNET_memcmp (zone_key,
+ privkey)))
{
fail = GNUNET_YES;
GNUNET_break (0);
diff --git a/src/namestore/test_plugin_namestore.c b/src/namestore/test_plugin_namestore.c
index 9c978749f..b81900931 100644
--- a/src/namestore/test_plugin_namestore.c
+++ b/src/namestore/test_plugin_namestore.c
@@ -120,9 +120,8 @@ test_record (void *cls,
(id % 241),
sizeof (tzone_private_key));
GNUNET_assert (0 == strcmp (label, tname));
- GNUNET_assert (0 == memcmp (&tzone_private_key,
- private_key,
- sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey)));
+ GNUNET_assert (0 == GNUNET_memcmp (&tzone_private_key,
+ private_key));
}
diff --git a/src/nat-auto/gnunet-service-nat-auto_legacy.c b/src/nat-auto/gnunet-service-nat-auto_legacy.c
index df2975e52..00bdeb693 100644
--- a/src/nat-auto/gnunet-service-nat-auto_legacy.c
+++ b/src/nat-auto/gnunet-service-nat-auto_legacy.c
@@ -563,8 +563,7 @@ process_if (void *cls,
if ( (sizeof (struct sockaddr_in6) == addrlen) &&
- (0 != memcmp (&in6addr_loopback, &((const struct sockaddr_in6 *) addr)->sin6_addr,
- sizeof (struct in6_addr))) &&
+ (0 != GNUNET_memcmp (&in6addr_loopback, &((const struct sockaddr_in6 *) addr)->sin6_addr)) &&
(! IN6_IS_ADDR_LINKLOCAL(&((const struct sockaddr_in6 *) addr)->sin6_addr)) )
{
ah->have_v6 = GNUNET_YES;
diff --git a/src/nat/gnunet-service-nat.c b/src/nat/gnunet-service-nat.c
index 8e7ce51e9..8d771f474 100644
--- a/src/nat/gnunet-service-nat.c
+++ b/src/nat/gnunet-service-nat.c
@@ -485,9 +485,8 @@ match_ipv6 (const char *network,
network,
&net));
memset (&mask, 0, sizeof (mask));
- if (0 == memcmp (&mask,
- ip,
- sizeof (mask)))
+ if (0 == GNUNET_memcmp (&mask,
+ ip))
return GNUNET_YES;
off = 0;
while (bits > 8)
@@ -731,9 +730,8 @@ check_notify_client (struct LocalAddressList *delta,
(! is_nat_v4 (&v4.sin_addr)) )
continue; /* based on external-IP, but this IP is not
from private address range. */
- if ( (0 != memcmp (&v4.sin_addr,
- &c4->sin_addr,
- sizeof (struct in_addr))) &&
+ if ( (0 != GNUNET_memcmp (&v4.sin_addr,
+ &c4->sin_addr)) &&
(0 != c4->sin_addr.s_addr) &&
(! is_nat_v4 (&c4->sin_addr)) )
continue; /* this IP is not from private address range,
@@ -762,37 +760,31 @@ check_notify_client (struct LocalAddressList *delta,
continue; /* IPv4 not relevant */
c6 = (const struct sockaddr_in6 *) &ch->caddrs[i].ss;
if ( match_ipv6 ("::1", &c6->sin6_addr, 128) &&
- (0 != memcmp (&c6->sin6_addr,
- &in6addr_any,
- sizeof (struct in6_addr))) &&
+ (0 != GNUNET_memcmp (&c6->sin6_addr,
+ &in6addr_any)) &&
(! match_ipv6 ("::1", &v6.sin6_addr, 128)) )
continue; /* bound to loopback, but this is not loopback */
if ( (! match_ipv6 ("::1", &c6->sin6_addr, 128) ) &&
match_ipv6 ("::1", &v6.sin6_addr, 128) )
continue; /* bound to non-loopback, but this is loopback */
if ( (0 != (delta->ac & GNUNET_NAT_AC_EXTERN)) &&
- (0 != memcmp (&c6->sin6_addr,
- &in6addr_any,
- sizeof (struct in6_addr))) &&
+ (0 != GNUNET_memcmp (&c6->sin6_addr,
+ &in6addr_any)) &&
(! is_nat_v6 (&v6.sin6_addr)) )
continue; /* based on external-IP, but this IP is not
from private address range. */
- if ( (0 != memcmp (&v6.sin6_addr,
- &c6->sin6_addr,
- sizeof (struct in6_addr))) &&
- (0 != memcmp (&c6->sin6_addr,
- &in6addr_any,
- sizeof (struct in6_addr))) &&
+ if ( (0 != GNUNET_memcmp (&v6.sin6_addr,
+ &c6->sin6_addr)) &&
+ (0 != GNUNET_memcmp (&c6->sin6_addr,
+ &in6addr_any)) &&
(! is_nat_v6 (&c6->sin6_addr)) )
continue; /* this IP is not from private address range,
and IP does not match. */
if ( (match_ipv6 ("fe80::", &c6->sin6_addr, 10)) &&
- (0 != memcmp (&c6->sin6_addr,
- &in6addr_any,
- sizeof (struct in6_addr))) &&
- (0 != memcmp (&v6.sin6_addr,
- &c6->sin6_addr,
- sizeof (struct in6_addr))) &&
+ (0 != GNUNET_memcmp (&c6->sin6_addr,
+ &in6addr_any)) &&
+ (0 != GNUNET_memcmp (&v6.sin6_addr,
+ &c6->sin6_addr)) &&
(0 == (delta->ac & GNUNET_NAT_AC_EXTERN)) )
continue; /* client bound to link-local, and the other address
does not match and is not an external IP */
@@ -1726,9 +1718,8 @@ handle_stun (void *cls,
&se->stun_server_addr,
sa_len)) )
continue; /* different STUN server */
- if (0 != memcmp (&external_addr,
- &se->external_addr,
- sizeof (struct sockaddr_in)))
+ if (0 != GNUNET_memcmp (&external_addr,
+ &se->external_addr))
{
/* external IP changed, update! */
notify_clients_stun_change (&se->external_addr,
diff --git a/src/nse/gnunet-service-nse.c b/src/nse/gnunet-service-nse.c
index b1f70214c..5b12c4b98 100644
--- a/src/nse/gnunet-service-nse.c
+++ b/src/nse/gnunet-service-nse.c
@@ -1124,14 +1124,13 @@ handle_p2p_estimate (void *cls,
1, GNUNET_NO);
return;
}
- if (0 == (memcmp (peer_entry->id,
- &my_identity,
- sizeof (struct GNUNET_PeerIdentity))))
+ if (0 == (GNUNET_memcmp (peer_entry->id,
+ &my_identity)))
{
/* send to self, update our own estimate IF this also comes from us! */
if (0 ==
- memcmp (&incoming_flood->origin,
- &my_identity, sizeof (my_identity)))
+ GNUNET_memcmp (&incoming_flood->origin,
+ &my_identity))
update_network_size_estimate ();
return;
}
@@ -1405,9 +1404,8 @@ core_init (void *cls,
return;
}
GNUNET_assert (0 ==
- memcmp (&my_identity,
- identity,
- sizeof (struct GNUNET_PeerIdentity)));
+ GNUNET_memcmp (&my_identity,
+ identity));
now = GNUNET_TIME_absolute_get ();
current_timestamp.abs_value_us =
(now.abs_value_us / gnunet_nse_interval.rel_value_us) *
diff --git a/src/peerinfo/gnunet-service-peerinfo.c b/src/peerinfo/gnunet-service-peerinfo.c
index 75e99d1f8..61fdd0f24 100644
--- a/src/peerinfo/gnunet-service-peerinfo.c
+++ b/src/peerinfo/gnunet-service-peerinfo.c
@@ -584,9 +584,8 @@ hosts_directory_scan_callback (void *cls,
if ( (NULL != r.hello) &&
(NULL != r.friend_only_hello) &&
- (0 != memcmp (&id_friend,
- &id_public,
- sizeof (id_friend))) )
+ (0 != GNUNET_memcmp (&id_friend,
+ &id_public)) )
{
/* HELLOs are not for the same peer */
GNUNET_break (0);
@@ -599,7 +598,7 @@ hosts_directory_scan_callback (void *cls,
strlen (filename),
&identity.public_key))
{
- if (0 != memcmp (&id, &identity, sizeof (id_friend)))
+ if (0 != GNUNET_memcmp (&id, &identity))
{
/* HELLOs are not for the same peer */
GNUNET_break (0);
diff --git a/src/peerinfo/peerinfo_api.c b/src/peerinfo/peerinfo_api.c
index 4b56b34c7..485b5e183 100644
--- a/src/peerinfo/peerinfo_api.c
+++ b/src/peerinfo/peerinfo_api.c
@@ -271,9 +271,8 @@ check_info (void *cls,
return GNUNET_SYSERR;
}
if ( (GNUNET_YES == ic->have_peer) &&
- (0 != memcmp (&ic->peer,
- &im->peer,
- sizeof (struct GNUNET_PeerIdentity))) )
+ (0 != GNUNET_memcmp (&ic->peer,
+ &im->peer)) )
{
/* bogus message (from a different iteration call?); out of sequence! */
LOG (GNUNET_ERROR_TYPE_ERROR,
@@ -303,9 +302,8 @@ check_info (void *cls,
GNUNET_break (0);
return GNUNET_SYSERR;
}
- if (0 != memcmp (&im->peer,
- &id,
- sizeof (struct GNUNET_PeerIdentity)))
+ if (0 != GNUNET_memcmp (&im->peer,
+ &id))
{
/* malformed message */
GNUNET_break (0);
diff --git a/src/peerinfo/test_peerinfo_api_notify_friend_only.c b/src/peerinfo/test_peerinfo_api_notify_friend_only.c
index 50118f8bb..0a9bfc083 100644
--- a/src/peerinfo/test_peerinfo_api_notify_friend_only.c
+++ b/src/peerinfo/test_peerinfo_api_notify_friend_only.c
@@ -160,7 +160,7 @@ process_w_fo (void *cls,
GNUNET_log(GNUNET_ERROR_TYPE_INFO, "Received %s HELLO for peer `%s'\n",
(GNUNET_YES == GNUNET_HELLO_is_friend_only (hello)) ? "friend only" : "public",
GNUNET_i2s (peer));
- if (0 == memcmp (&pid, peer, sizeof(pid)))
+ if (0 == GNUNET_memcmp (&pid, peer))
{
res_cb_w_fo = GNUNET_YES;
GNUNET_SCHEDULER_add_now (&done, NULL);
@@ -199,7 +199,7 @@ process_wo_fo (void *cls, const struct GNUNET_PeerIdentity *peer,
GNUNET_log(GNUNET_ERROR_TYPE_INFO, "Received %s HELLO for peer `%s'\n",
(GNUNET_YES == GNUNET_HELLO_is_friend_only (hello)) ? "friend only" : "public",
GNUNET_i2s (peer));
- if (0 == memcmp (&pid, peer, sizeof(pid)))
+ if (0 == GNUNET_memcmp (&pid, peer))
{
GNUNET_break(0);
res_cb_wo_fo = GNUNET_YES;
diff --git a/src/pq/test_pq.c b/src/pq/test_pq.c
index cfcf7dcd7..67cf32733 100644
--- a/src/pq/test_pq.c
+++ b/src/pq/test_pq.c
@@ -191,9 +191,8 @@ run_queries (PGconn *conn)
GNUNET_break (abs_time.abs_value_us == abs_time2.abs_value_us);
GNUNET_break (forever.abs_value_us == forever2.abs_value_us);
GNUNET_break (0 ==
- memcmp (&hc,
- &hc2,
- sizeof (struct GNUNET_HashCode)));
+ GNUNET_memcmp (&hc,
+ &hc2));
GNUNET_break (0 ==
GNUNET_CRYPTO_rsa_signature_cmp (sig,
sig2));
diff --git a/src/pt/gnunet-daemon-pt.c b/src/pt/gnunet-daemon-pt.c
index 6a07b6e42..cd17c2b7b 100644
--- a/src/pt/gnunet-daemon-pt.c
+++ b/src/pt/gnunet-daemon-pt.c
@@ -1151,9 +1151,8 @@ handle_dht_result (void *cls,
}
ad = data;
for (exit = exit_head; NULL != exit; exit = exit->next)
- if (0 == memcmp (&ad->peer,
- &exit->peer,
- sizeof (struct GNUNET_PeerIdentity)))
+ if (0 == GNUNET_memcmp (&ad->peer,
+ &exit->peer))
break;
if (NULL == exit)
{
diff --git a/src/reclaim/oidc_helper.c b/src/reclaim/oidc_helper.c
index 750b276a4..331bd2711 100644
--- a/src/reclaim/oidc_helper.c
+++ b/src/reclaim/oidc_helper.c
@@ -314,8 +314,7 @@ OIDC_parse_authz_code (const struct GNUNET_CRYPTO_EcdsaPublicKey *audience,
}
*ticket = GNUNET_new (struct GNUNET_RECLAIM_Ticket);
memcpy (*ticket, &purpose[1], sizeof (struct GNUNET_RECLAIM_Ticket));
- if (0 != memcmp (audience, &(*ticket)->audience,
- sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey))) {
+ if (0 != GNUNET_memcmp (audience, &(*ticket)->audience)) {
GNUNET_free (purpose);
GNUNET_free (*ticket);
json_decref (code_json);
diff --git a/src/reclaim/plugin_rest_openid_connect.c b/src/reclaim/plugin_rest_openid_connect.c
index 761c9e83d..6cf1ffdee 100644
--- a/src/reclaim/plugin_rest_openid_connect.c
+++ b/src/reclaim/plugin_rest_openid_connect.c
@@ -1007,8 +1007,7 @@ code_redirect (void *cls)
for (handle->ego_entry = handle->ego_head; NULL != handle->ego_entry;
handle->ego_entry = handle->ego_entry->next) {
GNUNET_IDENTITY_ego_get_public_key (handle->ego_entry->ego, &ego_pkey);
- if (0 == memcmp (&ego_pkey, &pubkey,
- sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey))) {
+ if (0 == GNUNET_memcmp (&ego_pkey, &pubkey)) {
handle->priv_key =
*GNUNET_IDENTITY_ego_get_private_key (handle->ego_entry->ego);
handle->idp = GNUNET_RECLAIM_connect (cfg);
@@ -1261,8 +1260,7 @@ tld_iter (void *cls, const char *section, const char *option, const char *value)
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Skipping non key %s\n", value);
return;
}
- if (0 == memcmp (&pkey, &handle->oidc->client_pkey,
- sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey)))
+ if (0 == GNUNET_memcmp (&pkey, &handle->oidc->client_pkey))
handle->tld = GNUNET_strdup (option + 1);
}
@@ -1337,8 +1335,7 @@ authorize_endpoint (struct GNUNET_REST_RequestHandle *con_handle,
for (tmp_ego = handle->ego_head; NULL != tmp_ego; tmp_ego = tmp_ego->next) {
priv_key = GNUNET_IDENTITY_ego_get_private_key (tmp_ego->ego);
GNUNET_CRYPTO_ecdsa_key_get_public (priv_key, &pkey);
- if (0 == memcmp (&pkey, &handle->oidc->client_pkey,
- sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey))) {
+ if (0 == GNUNET_memcmp (&pkey, &handle->oidc->client_pkey)) {
handle->tld = GNUNET_strdup (tmp_ego->identifier);
handle->ego_entry = handle->ego_tail;
}
@@ -1522,8 +1519,7 @@ ego_exists (struct RequestHandle *handle,
for (ego_entry = handle->ego_head; NULL != ego_entry;
ego_entry = ego_entry->next) {
GNUNET_IDENTITY_ego_get_public_key (ego_entry->ego, &pub_key);
- if (0 == memcmp (&pub_key, test_key,
- sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey))) {
+ if (0 == GNUNET_memcmp (&pub_key, test_key)) {
break;
}
}
diff --git a/src/regex/regex_block_lib.c b/src/regex/regex_block_lib.c
index b535394ca..77efa6180 100644
--- a/src/regex/regex_block_lib.c
+++ b/src/regex/regex_block_lib.c
@@ -222,9 +222,8 @@ REGEX_BLOCK_check (const struct RegexBlock *block,
return GNUNET_SYSERR;
}
if (NULL != query &&
- 0 != memcmp (&key,
- query,
- sizeof (struct GNUNET_HashCode)))
+ 0 != GNUNET_memcmp (&key,
+ query))
{
GNUNET_break_op (0);
return GNUNET_SYSERR;
diff --git a/src/revocation/gnunet-revocation.c b/src/revocation/gnunet-revocation.c
index 7596cab2d..4b8fa15bb 100644
--- a/src/revocation/gnunet-revocation.c
+++ b/src/revocation/gnunet-revocation.c
@@ -365,9 +365,8 @@ ego_callback (void *cls,
rd,
sizeof (struct RevocationData))) )
{
- if (0 != memcmp (&rd->key,
- &key,
- sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey)))
+ if (0 != GNUNET_memcmp (&rd->key,
+ &key))
{
fprintf (stderr,
_("Error: revocation certificate in `%s' is not for `%s'\n"),
diff --git a/src/revocation/gnunet-service-revocation.c b/src/revocation/gnunet-service-revocation.c
index fd646b4b7..e4ea1f2ff 100644
--- a/src/revocation/gnunet-service-revocation.c
+++ b/src/revocation/gnunet-service-revocation.c
@@ -545,9 +545,8 @@ handle_core_connect (void *cls,
struct GNUNET_HashCode my_hash;
struct GNUNET_HashCode peer_hash;
- if (0 == memcmp (peer,
- &my_identity,
- sizeof (my_identity)))
+ if (0 == GNUNET_memcmp (peer,
+ &my_identity))
{
return NULL;
}
@@ -608,9 +607,8 @@ handle_core_disconnect (void *cls,
{
struct PeerEntry *peer_entry = internal_cls;
- if (0 == memcmp (peer,
- &my_identity,
- sizeof (my_identity)))
+ if (0 == GNUNET_memcmp (peer,
+ &my_identity))
return;
GNUNET_assert (NULL != peer_entry);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
diff --git a/src/scalarproduct/gnunet-service-scalarproduct-ecc_alice.c b/src/scalarproduct/gnunet-service-scalarproduct-ecc_alice.c
index 368bbe605..4b1a09e50 100644
--- a/src/scalarproduct/gnunet-service-scalarproduct-ecc_alice.c
+++ b/src/scalarproduct/gnunet-service-scalarproduct-ecc_alice.c
@@ -776,9 +776,8 @@ cb_intersection_request_alice (void *cls,
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Received intersection request from %s!\n",
GNUNET_i2s (other_peer));
- if (0 != memcmp (other_peer,
- &s->peer,
- sizeof (struct GNUNET_PeerIdentity)))
+ if (0 != GNUNET_memcmp (other_peer,
+ &s->peer))
{
GNUNET_break_op (0);
return;
diff --git a/src/scalarproduct/gnunet-service-scalarproduct_alice.c b/src/scalarproduct/gnunet-service-scalarproduct_alice.c
index 38aef6409..393a1951b 100644
--- a/src/scalarproduct/gnunet-service-scalarproduct_alice.c
+++ b/src/scalarproduct/gnunet-service-scalarproduct_alice.c
@@ -1012,9 +1012,8 @@ cb_intersection_request_alice (void *cls,
{
struct AliceServiceSession *s = cls;
- if (0 != memcmp (other_peer,
- &s->peer,
- sizeof (struct GNUNET_PeerIdentity)))
+ if (0 != GNUNET_memcmp (other_peer,
+ &s->peer))
{
GNUNET_break_op (0);
return;
diff --git a/src/secretsharing/gnunet-secretsharing-profiler.c b/src/secretsharing/gnunet-secretsharing-profiler.c
index f4cc0f248..85abe154b 100644
--- a/src/secretsharing/gnunet-secretsharing-profiler.c
+++ b/src/secretsharing/gnunet-secretsharing-profiler.c
@@ -228,7 +228,7 @@ static void decrypt_cb (void *cls,
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "decrypt failed for peer %u\n", n);
return;
}
- else if (0 == memcmp (&reference_plaintext, plaintext, sizeof (struct GNUNET_SECRETSHARING_Plaintext)))
+ else if (0 == GNUNET_memcmp (&reference_plaintext, plaintext))
GNUNET_log (GNUNET_ERROR_TYPE_INFO, "decrypt got correct result for peer %u\n", n);
else
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "decrypt got wrong result for peer %u\n", n);
@@ -331,7 +331,7 @@ secret_ready_cb (void *cls,
{
common_pubkey = *public_key;
}
- else if (0 != memcmp (public_key, &common_pubkey, sizeof (struct GNUNET_SECRETSHARING_PublicKey)))
+ else if (0 != GNUNET_memcmp (public_key, &common_pubkey))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "generated public keys do not match\n");
GNUNET_SCHEDULER_shutdown ();
diff --git a/src/secretsharing/gnunet-service-secretsharing.c b/src/secretsharing/gnunet-service-secretsharing.c
index 1ffde0436..d136c5a68 100644
--- a/src/secretsharing/gnunet-service-secretsharing.c
+++ b/src/secretsharing/gnunet-service-secretsharing.c
@@ -330,7 +330,7 @@ get_keygen_peer_info (const struct KeygenSession *ks,
{
unsigned int i;
for (i = 0; i < ks->num_peers; i++)
- if (0 == memcmp (peer, &ks->info[i].peer, sizeof (struct GNUNET_PeerIdentity)))
+ if (0 == GNUNET_memcmp (peer, &ks->info[i].peer))
return &ks->info[i];
return NULL;
}
@@ -349,7 +349,7 @@ get_decrypt_peer_info (const struct DecryptSession *ds,
{
unsigned int i;
for (i = 0; i < ds->share->num_peers; i++)
- if (0 == memcmp (peer, &ds->info[i].peer, sizeof (struct GNUNET_PeerIdentity)))
+ if (0 == GNUNET_memcmp (peer, &ds->info[i].peer))
return &ds->info[i];
return NULL;
}
@@ -411,9 +411,8 @@ peer_find (const struct GNUNET_PeerIdentity *haystack, unsigned int n,
unsigned int i;
for (i = 0; i < n; i++)
- if (0 == memcmp (&haystack[i],
- needle,
- sizeof (struct GNUNET_PeerIdentity)))
+ if (0 == GNUNET_memcmp (&haystack[i],
+ needle))
return i;
return -1;
}
@@ -827,7 +826,7 @@ keygen_round2_conclude (void *cls)
GNUNET_SECRETSHARING_ELGAMAL_BITS / 8,
ks->info[i].sigma);
share->original_indices[i] = j;
- if (0 == memcmp (&share->peers[i], &my_peer, sizeof (struct GNUNET_PeerIdentity)))
+ if (0 == GNUNET_memcmp (&share->peers[i], &my_peer))
share->my_peer = j;
j += 1;
}
@@ -1897,7 +1896,7 @@ decrypt_new_element (void *cls,
return;
}
- if (0 != memcmp (&d->ciphertext, &session->ciphertext, sizeof (struct GNUNET_SECRETSHARING_Ciphertext)))
+ if (0 != GNUNET_memcmp (&d->ciphertext, &session->ciphertext))
{
GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "P%u: got decrypt element with non-matching ciphertext from P%u\n",
(unsigned int) session->share->my_peer, (unsigned int) (info - session->info));
diff --git a/src/set/gnunet-service-set_intersection.c b/src/set/gnunet-service-set_intersection.c
index d681666fe..e1bbcc152 100644
--- a/src/set/gnunet-service-set_intersection.c
+++ b/src/set/gnunet-service-set_intersection.c
@@ -843,9 +843,8 @@ process_bf (struct Operation *op)
if ( (0 == op->state->my_element_count) || /* fully disjoint */
( (op->state->my_element_count == op->remote_element_count) &&
- (0 == memcmp (&op->state->my_xor,
- &op->state->other_xor,
- sizeof (struct GNUNET_HashCode))) ) )
+ (0 == GNUNET_memcmp (&op->state->my_xor,
+ &op->state->other_xor)) ) )
{
/* we are done */
op->state->phase = PHASE_MUST_SEND_DONE;
@@ -1059,9 +1058,8 @@ handle_intersection_p2p_done (void *cls,
op);
}
if ( (op->state->my_element_count != ntohl (idm->final_element_count)) ||
- (0 != memcmp (&op->state->my_xor,
- &idm->element_xor_hash,
- sizeof (struct GNUNET_HashCode))) )
+ (0 != GNUNET_memcmp (&op->state->my_xor,
+ &idm->element_xor_hash)) )
{
/* Other peer thinks we are done, but we disagree on the result! */
GNUNET_break_op (0);
diff --git a/src/sq/test_sq.c b/src/sq/test_sq.c
index c6711bf0d..69216443f 100644
--- a/src/sq/test_sq.c
+++ b/src/sq/test_sq.c
@@ -192,9 +192,8 @@ run_queries (sqlite3 *dbh)
GNUNET_break (abs_time.abs_value_us == abs_time2.abs_value_us);
GNUNET_break (forever.abs_value_us == forever2.abs_value_us);
GNUNET_break (0 ==
- memcmp (&hc,
- &hc2,
- sizeof (struct GNUNET_HashCode)));
+ GNUNET_memcmp (&hc,
+ &hc2));
GNUNET_break (0 ==
GNUNET_CRYPTO_rsa_signature_cmp (sig,
sig2));
diff --git a/src/topology/gnunet-daemon-topology.c b/src/topology/gnunet-daemon-topology.c
index 6c93e9845..e5734abb4 100644
--- a/src/topology/gnunet-daemon-topology.c
+++ b/src/topology/gnunet-daemon-topology.c
@@ -306,9 +306,8 @@ attempt_connect (struct Peer *pos)
uint32_t strength;
if (0 ==
- memcmp (&my_identity,
- &pos->pid,
- sizeof (struct GNUNET_PeerIdentity)))
+ GNUNET_memcmp (&my_identity,
+ &pos->pid))
return; /* This is myself, nothing to do. */
if (connection_count < target_connection_count)
strength = 1;
@@ -602,9 +601,8 @@ connect_notify (void *cls,
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Core told us that we are connecting to `%s'\n",
GNUNET_i2s (peer));
- if (0 == memcmp (&my_identity,
- peer,
- sizeof (struct GNUNET_PeerIdentity)))
+ if (0 == GNUNET_memcmp (&my_identity,
+ peer))
return NULL;
extra = GNUNET_CORE_get_mq_options (GNUNET_YES,
GNUNET_CORE_PRIO_BEST_EFFORT,
@@ -781,9 +779,8 @@ consider_for_advertising (const struct GNUNET_HELLO_Message *hello)
GNUNET_break (0);
return;
}
- if (0 == memcmp (&pid,
- &my_identity,
- sizeof (struct GNUNET_PeerIdentity)))
+ if (0 == GNUNET_memcmp (&pid,
+ &my_identity))
return; /* that's me! */
have_address = GNUNET_NO;
GNUNET_HELLO_iterate_addresses (hello,
@@ -869,9 +866,8 @@ process_peer (void *cls,
return;
}
GNUNET_assert (NULL != peer);
- if (0 == memcmp (&my_identity,
- peer,
- sizeof (struct GNUNET_PeerIdentity)))
+ if (0 == GNUNET_memcmp (&my_identity,
+ peer))
return; /* that's me! */
if (NULL == hello)
{
@@ -948,9 +944,8 @@ handle_friend (void *cls,
unsigned int *entries_found = cls;
struct Peer *fl;
- if (0 == memcmp (pid,
- &my_identity,
- sizeof (struct GNUNET_PeerIdentity)))
+ if (0 == GNUNET_memcmp (pid,
+ &my_identity))
{
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
_("Found myself `%s' in friend list (useless, ignored)\n"),
diff --git a/src/vpn/gnunet-service-vpn.c b/src/vpn/gnunet-service-vpn.c
index 40a890070..91bc13fd8 100644
--- a/src/vpn/gnunet-service-vpn.c
+++ b/src/vpn/gnunet-service-vpn.c
@@ -2437,12 +2437,10 @@ allocate_v6_address (struct in6_addr *v6)
while ( (GNUNET_YES ==
GNUNET_CONTAINER_multihashmap_contains (destination_map,
&key)) ||
- (0 == memcmp (v6,
- &addr,
- sizeof (struct in6_addr))) ||
- (0 == memcmp (v6,
- &mask,
- sizeof (struct in6_addr))) );
+ (0 == GNUNET_memcmp (v6,
+ &addr)) ||
+ (0 == GNUNET_memcmp (v6,
+ &mask)) );
return GNUNET_OK;
}