diff options
author | Julius Bünger <buenger@mytum.de> | 2019-04-26 05:56:54 +0200 |
---|---|---|
committer | Julius Bünger <buenger@mytum.de> | 2019-04-26 05:56:54 +0200 |
commit | f5f5a9f680df2cebe6435ec87650cb3cb6e3ef6e (patch) | |
tree | 94055d2c049a65b5ab6c61fd3c5867fe49f6f429 | |
parent | a097690795f4f814de7cdbc97ef95fb899eeacd3 (diff) | |
download | gnunet-f5f5a9f680df2cebe6435ec87650cb3cb6e3ef6e.tar.gz gnunet-f5f5a9f680df2cebe6435ec87650cb3cb6e3ef6e.zip |
memcmp() -> GNUNET_memcmp(), first take
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, | |||
151 | for (c_m = 0; c_m < me->num_partners; c_m++) | 151 | for (c_m = 0; c_m < me->num_partners; c_m++) |
152 | { | 152 | { |
153 | /* Find a partner with other as destination */ | 153 | /* Find a partner with other as destination */ |
154 | if (0 == memcmp (peer, | 154 | if (0 == GNUNET_memcmp (peer, |
155 | &me->partners[c_m].dest->id, | 155 | &me->partners[c_m].dest->id)) |
156 | sizeof (struct GNUNET_PeerIdentity))) | ||
157 | { | 156 | { |
158 | return &me->partners[c_m]; | 157 | return &me->partners[c_m]; |
159 | } | 158 | } |
@@ -170,17 +169,15 @@ find_peer (const struct GNUNET_PeerIdentity * peer) | |||
170 | 169 | ||
171 | for (c_p = 0; c_p < top->num_masters; c_p++) | 170 | for (c_p = 0; c_p < top->num_masters; c_p++) |
172 | { | 171 | { |
173 | if (0 == memcmp (&top->mps[c_p].id, | 172 | if (0 == GNUNET_memcmp (&top->mps[c_p].id, |
174 | peer, | 173 | peer)) |
175 | sizeof(struct GNUNET_PeerIdentity))) | ||
176 | return &top->mps[c_p]; | 174 | return &top->mps[c_p]; |
177 | } | 175 | } |
178 | 176 | ||
179 | for (c_p = 0; c_p < top->num_slaves; c_p++) | 177 | for (c_p = 0; c_p < top->num_slaves; c_p++) |
180 | { | 178 | { |
181 | if (0 == memcmp (&top->sps[c_p].id, | 179 | if (0 == GNUNET_memcmp (&top->sps[c_p].id, |
182 | peer, | 180 | peer)) |
183 | sizeof(struct GNUNET_PeerIdentity))) | ||
184 | return &top->sps[c_p]; | 181 | return &top->sps[c_p]; |
185 | } | 182 | } |
186 | return NULL ; | 183 | 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, | |||
328 | for (c_m = 0; c_m < me->num_partners; c_m++) | 328 | for (c_m = 0; c_m < me->num_partners; c_m++) |
329 | { | 329 | { |
330 | /* Find a partner with other as destination */ | 330 | /* Find a partner with other as destination */ |
331 | if (0 == memcmp (peer, &me->partners[c_m].dest->id, | 331 | if (0 == GNUNET_memcmp (peer, &me->partners[c_m].dest->id)) |
332 | sizeof(struct GNUNET_PeerIdentity))) | ||
333 | { | 332 | { |
334 | return &me->partners[c_m]; | 333 | return &me->partners[c_m]; |
335 | } | 334 | } |
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, | |||
383 | 383 | ||
384 | amount = ntohl (rr->amount); | 384 | amount = ntohl (rr->amount); |
385 | rc = ph->reservation_head; | 385 | rc = ph->reservation_head; |
386 | if (0 != memcmp (&rr->peer, | 386 | if (0 != GNUNET_memcmp (&rr->peer, |
387 | &rc->peer, | 387 | &rc->peer)) |
388 | sizeof(struct GNUNET_PeerIdentity))) | ||
389 | { | 388 | { |
390 | GNUNET_break(0); | 389 | GNUNET_break(0); |
391 | reconnect (ph); | 390 | reconnect (ph); |
@@ -498,7 +497,7 @@ handle_address_list (void *cls, | |||
498 | return; /* was canceled */ | 497 | return; /* was canceled */ |
499 | 498 | ||
500 | memset (&allzeros, '\0', sizeof (allzeros)); | 499 | memset (&allzeros, '\0', sizeof (allzeros)); |
501 | if ( (0 == memcmp (&allzeros, &pi->peer, sizeof(allzeros))) && | 500 | if ( (0 == GNUNET_is_zero (&pi->peer)) && |
502 | (0 == plugin_name_length) && | 501 | (0 == plugin_name_length) && |
503 | (0 == plugin_address_length) ) | 502 | (0 == plugin_address_length) ) |
504 | { | 503 | { |
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, | |||
230 | as we communicate asynchronously with the ATS service. */ | 230 | as we communicate asynchronously with the ATS service. */ |
231 | return NULL; | 231 | return NULL; |
232 | } | 232 | } |
233 | if (0 != memcmp (peer, | 233 | if (0 != GNUNET_memcmp (peer, |
234 | &ar->address->peer, | 234 | &ar->address->peer)) |
235 | sizeof (struct GNUNET_PeerIdentity))) | ||
236 | { | 235 | { |
237 | GNUNET_break (0); | 236 | GNUNET_break (0); |
238 | return NULL; | 237 | return NULL; |
@@ -298,9 +297,8 @@ find_session_id (struct GNUNET_ATS_SchedulingHandle *sh, | |||
298 | (GNUNET_NO == sh->session_array[i]->in_destroy) && | 297 | (GNUNET_NO == sh->session_array[i]->in_destroy) && |
299 | ( (session == sh->session_array[i]->session) || | 298 | ( (session == sh->session_array[i]->session) || |
300 | (NULL == sh->session_array[i]->session) ) && | 299 | (NULL == sh->session_array[i]->session) ) && |
301 | (0 == memcmp (&address->peer, | 300 | (0 == GNUNET_memcmp (&address->peer, |
302 | &sh->session_array[i]->address->peer, | 301 | &sh->session_array[i]->address->peer)) && |
303 | sizeof (struct GNUNET_PeerIdentity))) && | ||
304 | (0 == GNUNET_HELLO_address_cmp (address, | 302 | (0 == GNUNET_HELLO_address_cmp (address, |
305 | sh->session_array[i]->address)) ) | 303 | sh->session_array[i]->address)) ) |
306 | return i; | 304 | 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) | |||
122 | { | 122 | { |
123 | struct TestPeer *cur; | 123 | struct TestPeer *cur; |
124 | for (cur = peer_head; NULL != cur; cur = cur->next) | 124 | for (cur = peer_head; NULL != cur; cur = cur->next) |
125 | if (0 == memcmp (&cur->peer_id, pid, sizeof (struct GNUNET_PeerIdentity))) | 125 | if (0 == GNUNET_memcmp (&cur->peer_id, pid)) |
126 | return cur; | 126 | return cur; |
127 | return NULL; | 127 | return NULL; |
128 | } | 128 | } |
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, | |||
362 | cp = cp->next) | 362 | cp = cp->next) |
363 | if ( (cp->pref.pk == (enum GNUNET_MQ_PreferenceKind) ntohl (msg->pk)) && | 363 | if ( (cp->pref.pk == (enum GNUNET_MQ_PreferenceKind) ntohl (msg->pk)) && |
364 | (cp->pref.bw.value__ == msg->bw.value__) && | 364 | (cp->pref.bw.value__ == msg->bw.value__) && |
365 | (0 == memcmp (&cp->pref.peer, | 365 | (0 == GNUNET_memcmp (&cp->pref.peer, |
366 | &msg->peer, | 366 | &msg->peer)) ) |
367 | sizeof (struct GNUNET_PeerIdentity))) ) | ||
368 | break; | 367 | break; |
369 | if (NULL == cp) | 368 | if (NULL == cp) |
370 | { | 369 | { |
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, | |||
682 | memset (&allzeros, | 682 | memset (&allzeros, |
683 | '\0', | 683 | '\0', |
684 | sizeof (struct GNUNET_PeerIdentity)); | 684 | sizeof (struct GNUNET_PeerIdentity)); |
685 | if (0 == memcmp (&alrm->peer, | 685 | if (0 == GNUNET_is_zero (&alrm->peer)) |
686 | &allzeros, | ||
687 | sizeof (struct GNUNET_PeerIdentity))) | ||
688 | { | 686 | { |
689 | /* Return addresses for all peers */ | 687 | /* Return addresses for all peers */ |
690 | GAS_addresses_get_peer_info (NULL, | 688 | 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) | |||
250 | GNUNET_CONTAINER_multipeermap_iterate (GSA_addresses, | 250 | GNUNET_CONTAINER_multipeermap_iterate (GSA_addresses, |
251 | &find_min_max_it, | 251 | &find_min_max_it, |
252 | &range); | 252 | &range); |
253 | if (0 != memcmp (&range, | 253 | if (0 != GNUNET_memcmp (&range, |
254 | &property_range, | 254 | &property_range)) |
255 | sizeof (struct PropertyRange))) | ||
256 | { | 255 | { |
257 | /* limits changed, (re)normalize all addresses */ | 256 | /* limits changed, (re)normalize all addresses */ |
258 | property_range = range; | 257 | 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, | |||
492 | struct GNUNET_TIME_Absolute expiration; | 492 | struct GNUNET_TIME_Absolute expiration; |
493 | struct Hello *hello; | 493 | struct Hello *hello; |
494 | 494 | ||
495 | if (0 != memcmp (&p->pid, | 495 | if (0 != GNUNET_memcmp (&p->pid, |
496 | &record->peer, | 496 | &record->peer)) |
497 | sizeof (struct GNUNET_PeerIdentity))) | ||
498 | { | 497 | { |
499 | GNUNET_break (0); | 498 | GNUNET_break (0); |
500 | return; | 499 | 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, | |||
1401 | mlpi->b_in = mlp_bw_in; | 1401 | mlpi->b_in = mlp_bw_in; |
1402 | address->assigned_bw_out = mlp_bw_out; | 1402 | address->assigned_bw_out = mlp_bw_out; |
1403 | mlpi->b_out = mlp_bw_out; | 1403 | mlpi->b_out = mlp_bw_out; |
1404 | if ((NULL == mlp->exclude_peer) || (0 != memcmp (&address->peer, mlp->exclude_peer, sizeof (address->peer)))) | 1404 | if ((NULL == mlp->exclude_peer) || (0 != GNUNET_memcmp (&address->peer, mlp->exclude_peer))) |
1405 | mlp->env->bandwidth_changed_cb (mlp->env->cls, address); | 1405 | mlp->env->bandwidth_changed_cb (mlp->env->cls, address); |
1406 | return GNUNET_OK; | 1406 | return GNUNET_OK; |
1407 | } | 1407 | } |
@@ -1417,7 +1417,7 @@ mlp_propagate_results (void *cls, | |||
1417 | mlpi->b_in = mlp_bw_in; | 1417 | mlpi->b_in = mlp_bw_in; |
1418 | address->assigned_bw_out = mlp_bw_out; | 1418 | address->assigned_bw_out = mlp_bw_out; |
1419 | mlpi->b_out = mlp_bw_out; | 1419 | mlpi->b_out = mlp_bw_out; |
1420 | if ((NULL == mlp->exclude_peer) || (0 != memcmp (&address->peer, mlp->exclude_peer, sizeof (address->peer)))) | 1420 | if ((NULL == mlp->exclude_peer) || (0 != GNUNET_memcmp (&address->peer, mlp->exclude_peer))) |
1421 | mlp->env->bandwidth_changed_cb (mlp->env->cls, address); | 1421 | mlp->env->bandwidth_changed_cb (mlp->env->cls, address); |
1422 | return GNUNET_OK; | 1422 | return GNUNET_OK; |
1423 | } | 1423 | } |
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 * | |||
2016 | 2016 | ||
2017 | for (cur = solver->agents_head; NULL != cur; cur = cur->next) | 2017 | for (cur = solver->agents_head; NULL != cur; cur = cur->next) |
2018 | { | 2018 | { |
2019 | if (0 == memcmp (peer, &cur->peer, sizeof(struct GNUNET_PeerIdentity))) | 2019 | if (0 == GNUNET_memcmp (peer, &cur->peer)) |
2020 | { | 2020 | { |
2021 | return cur; | 2021 | return cur; |
2022 | } | 2022 | } |
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, | |||
540 | cmd->details.reserve_bandwidth.rc = NULL; | 540 | cmd->details.reserve_bandwidth.rc = NULL; |
541 | make_peer (cmd->details.reserve_bandwidth.pid, | 541 | make_peer (cmd->details.reserve_bandwidth.pid, |
542 | &pid); | 542 | &pid); |
543 | GNUNET_assert (0 == memcmp (peer, | 543 | GNUNET_assert (0 == GNUNET_memcmp (peer, |
544 | &pid, | 544 | &pid)); |
545 | sizeof (struct GNUNET_PeerIdentity))); | ||
546 | switch (cmd->details.reserve_bandwidth.expected_result) | 545 | switch (cmd->details.reserve_bandwidth.expected_result) |
547 | { | 546 | { |
548 | case GNUNET_OK: | 547 | 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, | |||
679 | GCCH_hash_port (&ch->h_port, | 679 | GCCH_hash_port (&ch->h_port, |
680 | port, | 680 | port, |
681 | GCP_get_id (destination)); | 681 | GCP_get_id (destination)); |
682 | if (0 == memcmp (&my_full_id, | 682 | if (0 == GNUNET_memcmp (&my_full_id, |
683 | GCP_get_id (destination), | 683 | GCP_get_id (destination))) |
684 | sizeof (struct GNUNET_PeerIdentity))) | ||
685 | { | 684 | { |
686 | struct OpenPort *op; | 685 | struct OpenPort *op; |
687 | 686 | ||
@@ -1185,9 +1184,8 @@ GCCH_handle_channel_open_ack (struct CadetChannel *ch, | |||
1185 | GNUNET_break_op (0); | 1184 | GNUNET_break_op (0); |
1186 | return; | 1185 | return; |
1187 | } | 1186 | } |
1188 | if (0 != memcmp (&ch->port, | 1187 | if (0 != GNUNET_memcmp (&ch->port, |
1189 | port, | 1188 | port)) |
1190 | sizeof (struct GNUNET_HashCode))) | ||
1191 | { | 1189 | { |
1192 | /* Other peer failed to provide the right port, | 1190 | /* Other peer failed to provide the right port, |
1193 | refuse connection. */ | 1191 | refuse connection. */ |
@@ -1612,9 +1610,8 @@ handle_matching_ack (struct CadetChannel *ch, | |||
1612 | (NULL != cti) ) | 1610 | (NULL != cti) ) |
1613 | { | 1611 | { |
1614 | GCC_ack_observed (cti); | 1612 | GCC_ack_observed (cti); |
1615 | if (0 == memcmp (cti, | 1613 | if (0 == GNUNET_memcmp (cti, |
1616 | &crm->connection_taken, | 1614 | &crm->connection_taken)) |
1617 | sizeof (struct GNUNET_CADET_ConnectionTunnelIdentifier))) | ||
1618 | { | 1615 | { |
1619 | GCC_latency_observed (cti, | 1616 | GCC_latency_observed (cti, |
1620 | GNUNET_TIME_absolute_get_duration (crm->first_transmission_time)); | 1617 | 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, | |||
919 | { | 919 | { |
920 | int cmp; | 920 | int cmp; |
921 | 921 | ||
922 | cmp = memcmp (cid, | 922 | cmp = GNUNET_memcmp (cid, |
923 | &cc->cid, | 923 | &cc->cid); |
924 | sizeof (*cid)); | ||
925 | if (0 == cmp) | 924 | if (0 == cmp) |
926 | { | 925 | { |
927 | /* Two peers picked the SAME random connection identifier at the | 926 | /* 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, | |||
843 | } | 843 | } |
844 | /* Initiator is at offset 0, find us */ | 844 | /* Initiator is at offset 0, find us */ |
845 | for (off=1;off<path_length;off++) | 845 | for (off=1;off<path_length;off++) |
846 | if (0 == memcmp (&my_full_id, | 846 | if (0 == GNUNET_memcmp (&my_full_id, |
847 | &pids[off], | 847 | &pids[off])) |
848 | sizeof (struct GNUNET_PeerIdentity))) | ||
849 | break; | 848 | break; |
850 | if (off == path_length) | 849 | if (off == path_length) |
851 | { | 850 | { |
@@ -1310,9 +1309,8 @@ core_init_cb (void *cls, | |||
1310 | return; | 1309 | return; |
1311 | } | 1310 | } |
1312 | GNUNET_break (0 == | 1311 | GNUNET_break (0 == |
1313 | memcmp (my_identity, | 1312 | GNUNET_memcmp (my_identity, |
1314 | &my_full_id, | 1313 | &my_full_id)); |
1315 | sizeof (struct GNUNET_PeerIdentity))); | ||
1316 | } | 1314 | } |
1317 | 1315 | ||
1318 | 1316 | ||
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, | |||
72 | if ( (NULL == id) || | 72 | if ( (NULL == id) || |
73 | (NULL == hello) ) | 73 | (NULL == hello) ) |
74 | return; | 74 | return; |
75 | if (0 == memcmp (id, | 75 | if (0 == GNUNET_memcmp (id, |
76 | &my_full_id, | 76 | &my_full_id)) |
77 | sizeof (struct GNUNET_PeerIdentity))) | ||
78 | { | 77 | { |
79 | GNUNET_free_non_null (mine); | 78 | GNUNET_free_non_null (mine); |
80 | mine = (struct GNUNET_HELLO_Message *) GNUNET_copy_message (&hello->header); | 79 | 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, | |||
496 | ? &get_path[get_path_length - off - 1] | 496 | ? &get_path[get_path_length - off - 1] |
497 | : &put_path[get_path_length + put_path_length - off - 1]; | 497 | : &put_path[get_path_length + put_path_length - off - 1]; |
498 | /* Check that I am not in the path */ | 498 | /* Check that I am not in the path */ |
499 | if (0 == memcmp (&my_full_id, | 499 | if (0 == GNUNET_memcmp (&my_full_id, |
500 | pid, | 500 | pid)) |
501 | sizeof (struct GNUNET_PeerIdentity))) | ||
502 | { | 501 | { |
503 | skip = off + 1; | 502 | skip = off + 1; |
504 | continue; | 503 | 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, | |||
1013 | 0, | 1013 | 0, |
1014 | &key->HK, | 1014 | &key->HK, |
1015 | hmac); | 1015 | hmac); |
1016 | if (0 == memcmp (hmac, | 1016 | if (0 == GNUNET_memcmp (hmac, |
1017 | &src->hmac, | 1017 | &src->hmac)) |
1018 | sizeof (*hmac))) | ||
1019 | { | 1018 | { |
1020 | valid_HK = &key->HK; | 1019 | valid_HK = &key->HK; |
1021 | break; | 1020 | break; |
@@ -1047,9 +1046,8 @@ try_old_ax_keys (struct CadetTunnelAxolotl *ax, | |||
1047 | (N != key->Kn) ) | 1046 | (N != key->Kn) ) |
1048 | key = key->next; | 1047 | key = key->next; |
1049 | if ( (NULL == key) || | 1048 | if ( (NULL == key) || |
1050 | (0 != memcmp (&key->HK, | 1049 | (0 != GNUNET_memcmp (&key->HK, |
1051 | valid_HK, | 1050 | valid_HK)) ) |
1052 | sizeof (*valid_HK))) ) | ||
1053 | return -1; | 1051 | return -1; |
1054 | 1052 | ||
1055 | /* Decrypt payload */ | 1053 | /* Decrypt payload */ |
@@ -1181,9 +1179,8 @@ t_ax_decrypt_and_validate (struct CadetTunnelAxolotl *ax, | |||
1181 | sizeof (struct GNUNET_CADET_AxHeader) + esize, | 1179 | sizeof (struct GNUNET_CADET_AxHeader) + esize, |
1182 | 0, &ax->HKr, | 1180 | 0, &ax->HKr, |
1183 | &msg_hmac); | 1181 | &msg_hmac); |
1184 | if (0 != memcmp (&msg_hmac, | 1182 | if (0 != GNUNET_memcmp (&msg_hmac, |
1185 | &src->hmac, | 1183 | &src->hmac)) |
1186 | sizeof (msg_hmac))) | ||
1187 | { | 1184 | { |
1188 | static const char ctx[] = "axolotl ratchet"; | 1185 | static const char ctx[] = "axolotl ratchet"; |
1189 | struct GNUNET_CRYPTO_SymmetricSessionKey keys[3]; /* RKp, NHKp, CKp */ | 1186 | struct GNUNET_CRYPTO_SymmetricSessionKey keys[3]; /* RKp, NHKp, CKp */ |
@@ -1197,9 +1194,8 @@ t_ax_decrypt_and_validate (struct CadetTunnelAxolotl *ax, | |||
1197 | 0, | 1194 | 0, |
1198 | &ax->NHKr, | 1195 | &ax->NHKr, |
1199 | &msg_hmac); | 1196 | &msg_hmac); |
1200 | if (0 != memcmp (&msg_hmac, | 1197 | if (0 != GNUNET_memcmp (&msg_hmac, |
1201 | &src->hmac, | 1198 | &src->hmac)) |
1202 | sizeof (msg_hmac))) | ||
1203 | { | 1199 | { |
1204 | /* Try the skipped keys, if that fails, we're out of luck. */ | 1200 | /* Try the skipped keys, if that fails, we're out of luck. */ |
1205 | return try_old_ax_keys (ax, | 1201 | return try_old_ax_keys (ax, |
@@ -1528,9 +1524,8 @@ update_ax_by_kx (struct CadetTunnelAxolotl *ax, | |||
1528 | GNUNET_break_op (0); | 1524 | GNUNET_break_op (0); |
1529 | return GNUNET_SYSERR; | 1525 | return GNUNET_SYSERR; |
1530 | } | 1526 | } |
1531 | if (0 == memcmp (&ax->DHRr, | 1527 | if (0 == GNUNET_memcmp (&ax->DHRr, |
1532 | ratchet_key, | 1528 | ratchet_key)) |
1533 | sizeof (*ratchet_key))) | ||
1534 | { | 1529 | { |
1535 | GNUNET_STATISTICS_update (stats, | 1530 | GNUNET_STATISTICS_update (stats, |
1536 | "# Ratchet key already known", | 1531 | "# Ratchet key already known", |
@@ -1872,9 +1867,8 @@ check_ee (const struct GNUNET_CRYPTO_EcdhePrivateKey *e1, | |||
1872 | GNUNET_CRYPTO_ecc_ecdh (e2, | 1867 | GNUNET_CRYPTO_ecc_ecdh (e2, |
1873 | &p1, | 1868 | &p1, |
1874 | &hc2)); | 1869 | &hc2)); |
1875 | GNUNET_break (0 == memcmp (&hc1, | 1870 | GNUNET_break (0 == GNUNET_memcmp (&hc1, |
1876 | &hc2, | 1871 | &hc2)); |
1877 | sizeof (hc1))); | ||
1878 | } | 1872 | } |
1879 | 1873 | ||
1880 | 1874 | ||
@@ -1899,9 +1893,8 @@ check_ed (const struct GNUNET_CRYPTO_EcdhePrivateKey *e1, | |||
1899 | GNUNET_CRYPTO_eddsa_ecdh (e2, | 1893 | GNUNET_CRYPTO_eddsa_ecdh (e2, |
1900 | &p1, | 1894 | &p1, |
1901 | &hc2)); | 1895 | &hc2)); |
1902 | GNUNET_break (0 == memcmp (&hc1, | 1896 | GNUNET_break (0 == GNUNET_memcmp (&hc1, |
1903 | &hc2, | 1897 | &hc2)); |
1904 | sizeof (hc1))); | ||
1905 | } | 1898 | } |
1906 | 1899 | ||
1907 | 1900 | ||
@@ -1974,9 +1967,8 @@ GCT_handle_kx_auth (struct CadetTConnection *ct, | |||
1974 | GNUNET_CRYPTO_hash (&ax_tmp.RK, | 1967 | GNUNET_CRYPTO_hash (&ax_tmp.RK, |
1975 | sizeof (ax_tmp.RK), | 1968 | sizeof (ax_tmp.RK), |
1976 | &kx_auth); | 1969 | &kx_auth); |
1977 | if (0 != memcmp (&kx_auth, | 1970 | if (0 != GNUNET_memcmp (&kx_auth, |
1978 | &msg->auth, | 1971 | &msg->auth)) |
1979 | sizeof (kx_auth))) | ||
1980 | { | 1972 | { |
1981 | /* This KX_AUTH is not using the latest KX/KX_AUTH data | 1973 | /* This KX_AUTH is not using the latest KX/KX_AUTH data |
1982 | we transmitted to the sender, refuse it, try KX again. */ | 1974 | we transmitted to the sender, refuse it, try KX again. */ |
@@ -1992,9 +1984,8 @@ GCT_handle_kx_auth (struct CadetTConnection *ct, | |||
1992 | 1984 | ||
1993 | GNUNET_CRYPTO_ecdhe_key_get_public (&ax_tmp.kx_0, | 1985 | GNUNET_CRYPTO_ecdhe_key_get_public (&ax_tmp.kx_0, |
1994 | &ephemeral_key); | 1986 | &ephemeral_key); |
1995 | if (0 != memcmp (&ephemeral_key, | 1987 | if (0 != GNUNET_memcmp (&ephemeral_key, |
1996 | &msg->r_ephemeral_key_XXX, | 1988 | &msg->r_ephemeral_key_XXX)) |
1997 | sizeof (ephemeral_key))) | ||
1998 | { | 1989 | { |
1999 | LOG (GNUNET_ERROR_TYPE_WARNING, | 1990 | LOG (GNUNET_ERROR_TYPE_WARNING, |
2000 | "My ephemeral is %s!\n", | 1991 | "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 | |||
2406 | { | 2406 | { |
2407 | int i; | 2407 | int i; |
2408 | for (i = 0; i < session->num_peers; i++) | 2408 | for (i = 0; i < session->num_peers; i++) |
2409 | if (0 == memcmp (peer, &session->peers[i], sizeof (struct GNUNET_PeerIdentity))) | 2409 | if (0 == GNUNET_memcmp (peer, &session->peers[i])) |
2410 | return i; | 2410 | return i; |
2411 | return -1; | 2411 | return -1; |
2412 | } | 2412 | } |
@@ -2476,9 +2476,8 @@ initialize_session_peer_list (struct ConsensusSession *session, | |||
2476 | local_peer_in_list = GNUNET_NO; | 2476 | local_peer_in_list = GNUNET_NO; |
2477 | for (unsigned int i = 0; i < session->num_peers; i++) | 2477 | for (unsigned int i = 0; i < session->num_peers; i++) |
2478 | { | 2478 | { |
2479 | if (0 == memcmp (&msg_peers[i], | 2479 | if (0 == GNUNET_memcmp (&msg_peers[i], |
2480 | &my_peer, | 2480 | &my_peer)) |
2481 | sizeof (struct GNUNET_PeerIdentity))) | ||
2482 | { | 2481 | { |
2483 | local_peer_in_list = GNUNET_YES; | 2482 | local_peer_in_list = GNUNET_YES; |
2484 | break; | 2483 | 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, | |||
640 | for (cred_pointer = vrh->cred_chain_head; cred_pointer != NULL; | 640 | for (cred_pointer = vrh->cred_chain_head; cred_pointer != NULL; |
641 | cred_pointer = cred_pointer->next) { | 641 | cred_pointer = cred_pointer->next) { |
642 | if (0 | 642 | if (0 |
643 | != memcmp (&set->subject_key, | 643 | != GNUNET_memcmp (&set->subject_key, |
644 | &cred_pointer->credential->issuer_key, | 644 | &cred_pointer->credential->issuer_key)) |
645 | sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey))) | ||
646 | continue; | 645 | continue; |
647 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 646 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
648 | "Checking if %s matches %s\n", | 647 | "Checking if %s matches %s\n", |
@@ -755,9 +754,8 @@ delegation_chain_resolution_start (void *cls) | |||
755 | for (cr_entry = vrh->cred_chain_head; cr_entry != NULL; | 754 | for (cr_entry = vrh->cred_chain_head; cr_entry != NULL; |
756 | cr_entry = cr_entry->next) { | 755 | cr_entry = cr_entry->next) { |
757 | if (0 | 756 | if (0 |
758 | != memcmp (&cr_entry->credential->issuer_key, | 757 | != GNUNET_memcmp (&cr_entry->credential->issuer_key, |
759 | &vrh->issuer_key, | 758 | &vrh->issuer_key)) |
760 | sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey))) | ||
761 | continue; | 759 | continue; |
762 | if (0 | 760 | if (0 |
763 | != strcmp (cr_entry->credential->issuer_attribute, | 761 | != 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, | |||
862 | { | 862 | { |
863 | ret = GNUNET_MY_extract_result (plugin->get_all_keys, | 863 | ret = GNUNET_MY_extract_result (plugin->get_all_keys, |
864 | results_select); | 864 | results_select); |
865 | if (0 != memcmp (&last, | 865 | if (0 != GNUNET_memcmp (&last, |
866 | &key, | 866 | &key)) |
867 | sizeof (key))) | ||
868 | { | 867 | { |
869 | if (0 != cnt) | 868 | if (0 != cnt) |
870 | proc (proc_cls, | 869 | 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, | |||
727 | 727 | ||
728 | (void) cls; | 728 | (void) cls; |
729 | /* Check for connect to self message */ | 729 | /* Check for connect to self message */ |
730 | if (0 == memcmp (&my_identity, | 730 | if (0 == GNUNET_memcmp (&my_identity, |
731 | peer, | 731 | peer)) |
732 | sizeof (struct GNUNET_PeerIdentity))) | ||
733 | return NULL; | 732 | return NULL; |
734 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 733 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
735 | "Connected to %s\n", | 734 | "Connected to %s\n", |
@@ -959,9 +958,8 @@ GDS_am_closest_peer (const struct GNUNET_HashCode *key, | |||
959 | int bucket_num; | 958 | int bucket_num; |
960 | struct PeerInfo *pos; | 959 | struct PeerInfo *pos; |
961 | 960 | ||
962 | if (0 == memcmp (&my_identity_hash, | 961 | if (0 == GNUNET_memcmp (&my_identity_hash, |
963 | key, | 962 | key)) |
964 | sizeof (struct GNUNET_HashCode))) | ||
965 | return GNUNET_YES; | 963 | return GNUNET_YES; |
966 | bucket_num = find_bucket (key); | 964 | bucket_num = find_bucket (key); |
967 | GNUNET_assert (bucket_num >= 0); | 965 | 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, | |||
368 | struct RecentRequest *in = cls; | 368 | struct RecentRequest *in = cls; |
369 | struct RecentRequest *rr = value; | 369 | struct RecentRequest *rr = value; |
370 | 370 | ||
371 | if ( (0 != memcmp (&in->peer, | 371 | if ( (0 != GNUNET_memcmp (&in->peer, |
372 | &rr->peer, | 372 | &rr->peer)) || |
373 | sizeof (struct GNUNET_PeerIdentity))) || | ||
374 | (in->type != rr->type) || | 373 | (in->type != rr->type) || |
375 | (in->xquery_size != rr->xquery_size) || | 374 | (in->xquery_size != rr->xquery_size) || |
376 | (0 != memcmp (in->xquery, | 375 | (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, | |||
1227 | = (addr.s6_addr[i] | rnd.s6_addr[i]) & mask.s6_addr[i]; | 1227 | = (addr.s6_addr[i] | rnd.s6_addr[i]) & mask.s6_addr[i]; |
1228 | } | 1228 | } |
1229 | } | 1229 | } |
1230 | while ( (0 == memcmp (&local_address->address.ipv6, | 1230 | while ( (0 == GNUNET_memcmp (&local_address->address.ipv6, |
1231 | &addr, | 1231 | &addr)) || |
1232 | sizeof (struct in6_addr))) || | 1232 | (0 == GNUNET_memcmp (&local_address->address.ipv6, |
1233 | (0 == memcmp (&local_address->address.ipv6, | 1233 | &mask)) ); |
1234 | &mask, | ||
1235 | sizeof (struct in6_addr))) ); | ||
1236 | } | 1234 | } |
1237 | break; | 1235 | break; |
1238 | default: | 1236 | 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, | |||
153 | GNUNET_CRYPTO_hash (&block->derived_key, | 153 | GNUNET_CRYPTO_hash (&block->derived_key, |
154 | sizeof (block->derived_key), | 154 | sizeof (block->derived_key), |
155 | &h); | 155 | &h); |
156 | if (0 != memcmp (&h, query, sizeof (struct GNUNET_HashCode))) | 156 | if (0 != GNUNET_memcmp (&h, query)) |
157 | { | 157 | { |
158 | GNUNET_break_op (0); | 158 | GNUNET_break_op (0); |
159 | return GNUNET_BLOCK_EVALUATION_RESULT_INVALID; | 159 | 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, | |||
838 | if (h1->header.type != h2->header.type) | 838 | if (h1->header.type != h2->header.type) |
839 | return GNUNET_TIME_UNIT_ZERO_ABS; | 839 | return GNUNET_TIME_UNIT_ZERO_ABS; |
840 | if (0 != | 840 | if (0 != |
841 | memcmp (&h1->publicKey, | 841 | GNUNET_memcmp (&h1->publicKey, |
842 | &h2->publicKey, | 842 | &h2->publicKey)) |
843 | sizeof (struct GNUNET_CRYPTO_EddsaPublicKey))) | ||
844 | return GNUNET_TIME_UNIT_ZERO_ABS; | 843 | return GNUNET_TIME_UNIT_ZERO_ABS; |
845 | ec.expiration_limit = now; | 844 | ec.expiration_limit = now; |
846 | ec.result = GNUNET_TIME_UNIT_FOREVER_ABS; | 845 | 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, | |||
179 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 179 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
180 | "Testing get_key from HELLO...\n"); | 180 | "Testing get_key from HELLO...\n"); |
181 | GNUNET_assert (GNUNET_OK == GNUNET_HELLO_get_id (msg2, &pid)); | 181 | GNUNET_assert (GNUNET_OK == GNUNET_HELLO_get_id (msg2, &pid)); |
182 | GNUNET_assert (0 == memcmp (&publicKey, | 182 | GNUNET_assert (0 == GNUNET_memcmp (&publicKey, |
183 | &pid.public_key, | 183 | &pid.public_key)); |
184 | sizeof (struct GNUNET_CRYPTO_EddsaPublicKey))); | ||
185 | GNUNET_free (msg1); | 184 | GNUNET_free (msg1); |
186 | 185 | ||
187 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 186 | 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, | |||
201 | const struct GNUNET_PeerIdentity *peer, | 201 | const struct GNUNET_PeerIdentity *peer, |
202 | struct GNUNET_MQ_Handle *mq) | 202 | struct GNUNET_MQ_Handle *mq) |
203 | { | 203 | { |
204 | if (0 == memcmp (&me, | 204 | if (0 == GNUNET_memcmp (&me, |
205 | peer, | 205 | peer)) |
206 | sizeof (struct GNUNET_PeerIdentity))) | ||
207 | return NULL; | 206 | return NULL; |
208 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 207 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
209 | "A new peer connected, notifying client and server\n"); | 208 | "A new peer connected, notifying client and server\n"); |
@@ -235,9 +234,8 @@ disconnect_handler (void *cls, | |||
235 | const struct GNUNET_PeerIdentity *peer, | 234 | const struct GNUNET_PeerIdentity *peer, |
236 | void *internal_cls) | 235 | void *internal_cls) |
237 | { | 236 | { |
238 | if (0 == memcmp (&me, | 237 | if (0 == GNUNET_memcmp (&me, |
239 | peer, | 238 | peer)) |
240 | sizeof (struct GNUNET_PeerIdentity))) | ||
241 | return; | 239 | return; |
242 | /* call hostlist client disconnect handler */ | 240 | /* call hostlist client disconnect handler */ |
243 | if (NULL != client_dh) | 241 | 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 | |||
429 | key_cmp (const struct GNUNET_CRYPTO_EcdsaPrivateKey *pk1, | 429 | key_cmp (const struct GNUNET_CRYPTO_EcdsaPrivateKey *pk1, |
430 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *pk2) | 430 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *pk2) |
431 | { | 431 | { |
432 | return memcmp (pk1, pk2, sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey)); | 432 | return GNUNET_memcmp (pk1, pk2); |
433 | } | 433 | } |
434 | 434 | ||
435 | /** | 435 | /** |
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, | |||
553 | (oldest->last_used.abs_value_us > | 553 | (oldest->last_used.abs_value_us > |
554 | pos->last_used.abs_value_us) ) | 554 | pos->last_used.abs_value_us) ) |
555 | oldest = pos; | 555 | oldest = pos; |
556 | if (0 == memcmp (zone, | 556 | if (0 == GNUNET_memcmp (zone, |
557 | &pos->zone, | 557 | &pos->zone)) |
558 | sizeof (*zone))) | ||
559 | { | 558 | { |
560 | oldest = pos; | 559 | oldest = pos; |
561 | break; | 560 | break; |
@@ -592,9 +591,8 @@ get_nick_record (const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone) | |||
592 | { | 591 | { |
593 | struct NickCache *pos = &nick_cache[i]; | 592 | struct NickCache *pos = &nick_cache[i]; |
594 | if ( (NULL != pos->rd) && | 593 | if ( (NULL != pos->rd) && |
595 | (0 == memcmp (zone, | 594 | (0 == GNUNET_memcmp (zone, |
596 | &pos->zone, | 595 | &pos->zone)) ) |
597 | sizeof (*zone))) ) | ||
598 | { | 596 | { |
599 | nick = GNUNET_malloc (sizeof (*nick) + | 597 | nick = GNUNET_malloc (sizeof (*nick) + |
600 | pos->rd->data_size); | 598 | pos->rd->data_size); |
@@ -1082,12 +1080,10 @@ continue_store_activity (struct StoreActivity *sa) | |||
1082 | NULL != zm; | 1080 | NULL != zm; |
1083 | zm = sa->zm_pos) | 1081 | zm = sa->zm_pos) |
1084 | { | 1082 | { |
1085 | if ( (0 != memcmp (&rp_msg->private_key, | 1083 | if ( (0 != GNUNET_memcmp (&rp_msg->private_key, |
1086 | &zm->zone, | 1084 | &zm->zone)) && |
1087 | sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey))) && | 1085 | (0 != GNUNET_memcmp (&zm->zone, |
1088 | (0 != memcmp (&zm->zone, | 1086 | &zero)) ) |
1089 | &zero, | ||
1090 | sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey))) ) | ||
1091 | { | 1087 | { |
1092 | sa->zm_pos = zm->next; /* not interesting to this monitor */ | 1088 | sa->zm_pos = zm->next; /* not interesting to this monitor */ |
1093 | continue; | 1089 | continue; |
@@ -1921,9 +1917,7 @@ run_zone_iteration_round (struct ZoneIteration *zi, | |||
1921 | start = GNUNET_TIME_absolute_get (); | 1917 | start = GNUNET_TIME_absolute_get (); |
1922 | GNUNET_break (GNUNET_SYSERR != | 1918 | GNUNET_break (GNUNET_SYSERR != |
1923 | GSN_database->iterate_records (GSN_database->cls, | 1919 | GSN_database->iterate_records (GSN_database->cls, |
1924 | (0 == memcmp (&zi->zone, | 1920 | (0 == GNUNET_is_zero (&zi->zone)) |
1925 | &zero, | ||
1926 | sizeof (zero))) | ||
1927 | ? NULL | 1921 | ? NULL |
1928 | : &zi->zone, | 1922 | : &zi->zone, |
1929 | zi->seq, | 1923 | zi->seq, |
@@ -2220,9 +2214,7 @@ monitor_iteration_next (void *cls) | |||
2220 | else | 2214 | else |
2221 | zm->iteration_cnt = zm->limit; /* use it all */ | 2215 | zm->iteration_cnt = zm->limit; /* use it all */ |
2222 | ret = GSN_database->iterate_records (GSN_database->cls, | 2216 | ret = GSN_database->iterate_records (GSN_database->cls, |
2223 | (0 == memcmp (&zm->zone, | 2217 | (0 == GNUNET_is_zero (&zm->zone)) |
2224 | &zero, | ||
2225 | sizeof (zero))) | ||
2226 | ? NULL | 2218 | ? NULL |
2227 | : &zm->zone, | 2219 | : &zm->zone, |
2228 | zm->seq, | 2220 | 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, | |||
1583 | GNUNET_CONTAINER_multihashmap_remove (ns_pending, | 1583 | GNUNET_CONTAINER_multihashmap_remove (ns_pending, |
1584 | &hc, | 1584 | &hc, |
1585 | req)); | 1585 | req)); |
1586 | GNUNET_break (0 == memcmp (key, | 1586 | GNUNET_break (0 == GNUNET_memcmp (key, |
1587 | &req->zone->key, | 1587 | &req->zone->key)); |
1588 | sizeof (*key))); | ||
1589 | GNUNET_break (0 == strcasecmp (label, | 1588 | GNUNET_break (0 == strcasecmp (label, |
1590 | get_label (req))); | 1589 | get_label (req))); |
1591 | for (unsigned int i=0;i<rd_count;i++) | 1590 | 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, | |||
552 | GNUNET_break (0); | 552 | GNUNET_break (0); |
553 | return GNUNET_SYSERR; | 553 | return GNUNET_SYSERR; |
554 | } | 554 | } |
555 | if (0 == memcmp (&msg->private_key, | 555 | if (0 == GNUNET_memcmp (&msg->private_key, |
556 | &priv_dummy, | 556 | &priv_dummy) ) |
557 | sizeof (priv_dummy)) ) | ||
558 | { | 557 | { |
559 | GNUNET_break (0); | 558 | GNUNET_break (0); |
560 | return GNUNET_SYSERR; | 559 | 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, | |||
142 | const char *rd_ser_tmp; | 142 | const char *rd_ser_tmp; |
143 | 143 | ||
144 | (void) cls; | 144 | (void) cls; |
145 | if ( (0 != memcmp (&lrm->private_key, | 145 | if ( (0 != GNUNET_memcmp (&lrm->private_key, |
146 | &zm->zone, | 146 | &zm->zone)) && |
147 | sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey))) && | 147 | (0 != GNUNET_is_zero (&zm->zone)) ) |
148 | (0 != memcmp (&zero, | ||
149 | &zm->zone, | ||
150 | sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey))) ) | ||
151 | { | 148 | { |
152 | GNUNET_break (0); | 149 | GNUNET_break (0); |
153 | return GNUNET_SYSERR; | 150 | 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, | |||
241 | return; | 241 | return; |
242 | } | 242 | } |
243 | GNUNET_free (wrd); | 243 | GNUNET_free (wrd); |
244 | if (0 != memcmp (zone, | 244 | if (0 != GNUNET_memcmp (zone, |
245 | privkey, | 245 | privkey)) |
246 | sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey))) | ||
247 | { | 246 | { |
248 | res = 5; | 247 | res = 5; |
249 | GNUNET_break (0); | 248 | 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, | |||
592 | if (0 == ic->limit) | 592 | if (0 == ic->limit) |
593 | return GNUNET_NO; | 593 | return GNUNET_NO; |
594 | if ( (NULL != ic->zone) && | 594 | if ( (NULL != ic->zone) && |
595 | (0 != memcmp (&entry->private_key, | 595 | (0 != GNUNET_memcmp (&entry->private_key, |
596 | ic->zone, | 596 | ic->zone)) ) |
597 | sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey))) ) | ||
598 | return GNUNET_YES; | 597 | return GNUNET_YES; |
599 | ic->pos++; | 598 | ic->pos++; |
600 | if (ic->offset > 0) | 599 | if (ic->offset > 0) |
@@ -676,9 +675,8 @@ zone_to_name (void *cls, | |||
676 | struct FlatFileEntry *entry = value; | 675 | struct FlatFileEntry *entry = value; |
677 | 676 | ||
678 | (void) key; | 677 | (void) key; |
679 | if (0 != memcmp (&entry->private_key, | 678 | if (0 != GNUNET_memcmp (&entry->private_key, |
680 | ztn->zone, | 679 | ztn->zone)) |
681 | sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey))) | ||
682 | return GNUNET_YES; | 680 | return GNUNET_YES; |
683 | 681 | ||
684 | for (unsigned int i = 0; i < entry->record_count; i++) | 682 | 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, | |||
111 | int found_record = GNUNET_NO; | 111 | int found_record = GNUNET_NO; |
112 | int found_nick = GNUNET_NO; | 112 | int found_nick = GNUNET_NO; |
113 | 113 | ||
114 | if (0 != memcmp(privkey, zone, sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey))) | 114 | if (0 != GNUNET_memcmp(privkey, zone)) |
115 | { | 115 | { |
116 | GNUNET_break(0); | 116 | GNUNET_break(0); |
117 | GNUNET_SCHEDULER_cancel (endbadly_task); | 117 | 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, | |||
103 | { | 103 | { |
104 | nsqe = NULL; | 104 | nsqe = NULL; |
105 | 105 | ||
106 | if (0 != memcmp (privkey, | 106 | if (0 != GNUNET_memcmp (privkey, |
107 | zone, | 107 | zone)) |
108 | sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey))) | ||
109 | { | 108 | { |
110 | GNUNET_break(0); | 109 | GNUNET_break(0); |
111 | GNUNET_SCHEDULER_cancel (endbadly_task); | 110 | 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, | |||
156 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 156 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
157 | "Comparing results name %s\n", | 157 | "Comparing results name %s\n", |
158 | name); | 158 | name); |
159 | if (0 != memcmp (zone_key, | 159 | if (0 != GNUNET_memcmp (zone_key, |
160 | privkey, | 160 | privkey)) |
161 | sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey))) | ||
162 | { | 161 | { |
163 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 162 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
164 | "Monitoring returned wrong zone key\n"); | 163 | "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, | |||
150 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 150 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
151 | "Comparing results name %s\n", | 151 | "Comparing results name %s\n", |
152 | name); | 152 | name); |
153 | if (0 != memcmp (zone_key, | 153 | if (0 != GNUNET_memcmp (zone_key, |
154 | privkey, | 154 | privkey)) |
155 | sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey))) | ||
156 | { | 155 | { |
157 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 156 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
158 | "Monitoring returned wrong zone key\n"); | 157 | "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, | |||
160 | int failed = GNUNET_NO; | 160 | int failed = GNUNET_NO; |
161 | 161 | ||
162 | GNUNET_assert (NULL != zone); | 162 | GNUNET_assert (NULL != zone); |
163 | if (0 == memcmp (zone, | 163 | if (0 == GNUNET_memcmp (zone, |
164 | privkey, | 164 | privkey)) |
165 | sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey))) | ||
166 | { | 165 | { |
167 | if (0 == strcmp (label, s_name_1)) | 166 | if (0 == strcmp (label, s_name_1)) |
168 | { | 167 | { |
@@ -207,9 +206,8 @@ zone_proc (void *cls, | |||
207 | GNUNET_break (0); | 206 | GNUNET_break (0); |
208 | } | 207 | } |
209 | } | 208 | } |
210 | else if (0 == memcmp (zone, | 209 | else if (0 == GNUNET_memcmp (zone, |
211 | privkey2, | 210 | privkey2)) |
212 | sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey))) | ||
213 | { | 211 | { |
214 | if (0 == strcmp (label, s_name_3)) | 212 | if (0 == strcmp (label, s_name_3)) |
215 | { | 213 | { |
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, | |||
171 | int failed = GNUNET_NO; | 171 | int failed = GNUNET_NO; |
172 | 172 | ||
173 | GNUNET_assert (NULL != zone); | 173 | GNUNET_assert (NULL != zone); |
174 | if (0 == memcmp (zone, privkey, sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey))) | 174 | if (0 == GNUNET_memcmp (zone, privkey)) |
175 | { | 175 | { |
176 | failed = check_zone_1 (label, rd_count, rd); | 176 | failed = check_zone_1 (label, rd_count, rd); |
177 | if (GNUNET_YES == failed) | 177 | if (GNUNET_YES == failed) |
178 | GNUNET_break (0); | 178 | GNUNET_break (0); |
179 | } | 179 | } |
180 | else if (0 == memcmp (zone, privkey2, sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey))) | 180 | else if (0 == GNUNET_memcmp (zone, privkey2)) |
181 | { | 181 | { |
182 | failed = check_zone_2 (label, rd_count, rd); | 182 | failed = check_zone_2 (label, rd_count, rd); |
183 | if (GNUNET_YES == failed) | 183 | 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, | |||
142 | int failed = GNUNET_NO; | 142 | int failed = GNUNET_NO; |
143 | 143 | ||
144 | GNUNET_assert (NULL != zone); | 144 | GNUNET_assert (NULL != zone); |
145 | if (0 == memcmp (zone, | 145 | if (0 == GNUNET_memcmp (zone, |
146 | privkey, | 146 | privkey)) |
147 | sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey))) | ||
148 | { | 147 | { |
149 | if (0 == strcmp (label, s_name_1)) | 148 | if (0 == strcmp (label, s_name_1)) |
150 | { | 149 | { |
@@ -189,7 +188,7 @@ zone_proc (void *cls, | |||
189 | GNUNET_break (0); | 188 | GNUNET_break (0); |
190 | } | 189 | } |
191 | } | 190 | } |
192 | else if (0 == memcmp (zone, privkey2, sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey))) | 191 | else if (0 == GNUNET_memcmp (zone, privkey2)) |
193 | { | 192 | { |
194 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 193 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
195 | "Received data for not requested zone\n"); | 194 | "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, | |||
130 | int failed = GNUNET_NO; | 130 | int failed = GNUNET_NO; |
131 | 131 | ||
132 | GNUNET_assert (NULL != zone); | 132 | GNUNET_assert (NULL != zone); |
133 | if (0 == memcmp (zone, privkey, sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey))) | 133 | if (0 == GNUNET_memcmp (zone, privkey)) |
134 | { | 134 | { |
135 | if (0 == strcmp (label, s_name_1)) | 135 | if (0 == strcmp (label, s_name_1)) |
136 | { | 136 | { |
@@ -174,7 +174,7 @@ zone_proc (void *cls, | |||
174 | GNUNET_break (0); | 174 | GNUNET_break (0); |
175 | } | 175 | } |
176 | } | 176 | } |
177 | else if (0 == memcmp (zone, privkey2, sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey))) | 177 | else if (0 == GNUNET_memcmp (zone, privkey2)) |
178 | { | 178 | { |
179 | if (0 == strcmp (label, s_name_3)) | 179 | if (0 == strcmp (label, s_name_3)) |
180 | { | 180 | { |
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, | |||
132 | GNUNET_break (0); | 132 | GNUNET_break (0); |
133 | } | 133 | } |
134 | if ( (NULL == zone_key) || | 134 | if ( (NULL == zone_key) || |
135 | (0 != memcmp (zone_key, | 135 | (0 != GNUNET_memcmp (zone_key, |
136 | privkey, | 136 | privkey))) |
137 | sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey)))) | ||
138 | { | 137 | { |
139 | fail = GNUNET_YES; | 138 | fail = GNUNET_YES; |
140 | GNUNET_break (0); | 139 | 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, | |||
120 | (id % 241), | 120 | (id % 241), |
121 | sizeof (tzone_private_key)); | 121 | sizeof (tzone_private_key)); |
122 | GNUNET_assert (0 == strcmp (label, tname)); | 122 | GNUNET_assert (0 == strcmp (label, tname)); |
123 | GNUNET_assert (0 == memcmp (&tzone_private_key, | 123 | GNUNET_assert (0 == GNUNET_memcmp (&tzone_private_key, |
124 | private_key, | 124 | private_key)); |
125 | sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey))); | ||
126 | } | 125 | } |
127 | 126 | ||
128 | 127 | ||
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, | |||
563 | 563 | ||
564 | 564 | ||
565 | if ( (sizeof (struct sockaddr_in6) == addrlen) && | 565 | if ( (sizeof (struct sockaddr_in6) == addrlen) && |
566 | (0 != memcmp (&in6addr_loopback, &((const struct sockaddr_in6 *) addr)->sin6_addr, | 566 | (0 != GNUNET_memcmp (&in6addr_loopback, &((const struct sockaddr_in6 *) addr)->sin6_addr)) && |
567 | sizeof (struct in6_addr))) && | ||
568 | (! IN6_IS_ADDR_LINKLOCAL(&((const struct sockaddr_in6 *) addr)->sin6_addr)) ) | 567 | (! IN6_IS_ADDR_LINKLOCAL(&((const struct sockaddr_in6 *) addr)->sin6_addr)) ) |
569 | { | 568 | { |
570 | ah->have_v6 = GNUNET_YES; | 569 | 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, | |||
485 | network, | 485 | network, |
486 | &net)); | 486 | &net)); |
487 | memset (&mask, 0, sizeof (mask)); | 487 | memset (&mask, 0, sizeof (mask)); |
488 | if (0 == memcmp (&mask, | 488 | if (0 == GNUNET_memcmp (&mask, |
489 | ip, | 489 | ip)) |
490 | sizeof (mask))) | ||
491 | return GNUNET_YES; | 490 | return GNUNET_YES; |
492 | off = 0; | 491 | off = 0; |
493 | while (bits > 8) | 492 | while (bits > 8) |
@@ -731,9 +730,8 @@ check_notify_client (struct LocalAddressList *delta, | |||
731 | (! is_nat_v4 (&v4.sin_addr)) ) | 730 | (! is_nat_v4 (&v4.sin_addr)) ) |
732 | continue; /* based on external-IP, but this IP is not | 731 | continue; /* based on external-IP, but this IP is not |
733 | from private address range. */ | 732 | from private address range. */ |
734 | if ( (0 != memcmp (&v4.sin_addr, | 733 | if ( (0 != GNUNET_memcmp (&v4.sin_addr, |
735 | &c4->sin_addr, | 734 | &c4->sin_addr)) && |
736 | sizeof (struct in_addr))) && | ||
737 | (0 != c4->sin_addr.s_addr) && | 735 | (0 != c4->sin_addr.s_addr) && |
738 | (! is_nat_v4 (&c4->sin_addr)) ) | 736 | (! is_nat_v4 (&c4->sin_addr)) ) |
739 | continue; /* this IP is not from private address range, | 737 | continue; /* this IP is not from private address range, |
@@ -762,37 +760,31 @@ check_notify_client (struct LocalAddressList *delta, | |||
762 | continue; /* IPv4 not relevant */ | 760 | continue; /* IPv4 not relevant */ |
763 | c6 = (const struct sockaddr_in6 *) &ch->caddrs[i].ss; | 761 | c6 = (const struct sockaddr_in6 *) &ch->caddrs[i].ss; |
764 | if ( match_ipv6 ("::1", &c6->sin6_addr, 128) && | 762 | if ( match_ipv6 ("::1", &c6->sin6_addr, 128) && |
765 | (0 != memcmp (&c6->sin6_addr, | 763 | (0 != GNUNET_memcmp (&c6->sin6_addr, |
766 | &in6addr_any, | 764 | &in6addr_any)) && |
767 | sizeof (struct in6_addr))) && | ||
768 | (! match_ipv6 ("::1", &v6.sin6_addr, 128)) ) | 765 | (! match_ipv6 ("::1", &v6.sin6_addr, 128)) ) |
769 | continue; /* bound to loopback, but this is not loopback */ | 766 | continue; /* bound to loopback, but this is not loopback */ |
770 | if ( (! match_ipv6 ("::1", &c6->sin6_addr, 128) ) && | 767 | if ( (! match_ipv6 ("::1", &c6->sin6_addr, 128) ) && |
771 | match_ipv6 ("::1", &v6.sin6_addr, 128) ) | 768 | match_ipv6 ("::1", &v6.sin6_addr, 128) ) |
772 | continue; /* bound to non-loopback, but this is loopback */ | 769 | continue; /* bound to non-loopback, but this is loopback */ |
773 | if ( (0 != (delta->ac & GNUNET_NAT_AC_EXTERN)) && | 770 | if ( (0 != (delta->ac & GNUNET_NAT_AC_EXTERN)) && |
774 | (0 != memcmp (&c6->sin6_addr, | 771 | (0 != GNUNET_memcmp (&c6->sin6_addr, |
775 | &in6addr_any, | 772 | &in6addr_any)) && |
776 | sizeof (struct in6_addr))) && | ||
777 | (! is_nat_v6 (&v6.sin6_addr)) ) | 773 | (! is_nat_v6 (&v6.sin6_addr)) ) |
778 | continue; /* based on external-IP, but this IP is not | 774 | continue; /* based on external-IP, but this IP is not |
779 | from private address range. */ | 775 | from private address range. */ |
780 | if ( (0 != memcmp (&v6.sin6_addr, | 776 | if ( (0 != GNUNET_memcmp (&v6.sin6_addr, |
781 | &c6->sin6_addr, | 777 | &c6->sin6_addr)) && |
782 | sizeof (struct in6_addr))) && | 778 | (0 != GNUNET_memcmp (&c6->sin6_addr, |
783 | (0 != memcmp (&c6->sin6_addr, | 779 | &in6addr_any)) && |
784 | &in6addr_any, | ||
785 | sizeof (struct in6_addr))) && | ||
786 | (! is_nat_v6 (&c6->sin6_addr)) ) | 780 | (! is_nat_v6 (&c6->sin6_addr)) ) |
787 | continue; /* this IP is not from private address range, | 781 | continue; /* this IP is not from private address range, |
788 | and IP does not match. */ | 782 | and IP does not match. */ |
789 | if ( (match_ipv6 ("fe80::", &c6->sin6_addr, 10)) && | 783 | if ( (match_ipv6 ("fe80::", &c6->sin6_addr, 10)) && |
790 | (0 != memcmp (&c6->sin6_addr, | 784 | (0 != GNUNET_memcmp (&c6->sin6_addr, |
791 | &in6addr_any, | 785 | &in6addr_any)) && |
792 | sizeof (struct in6_addr))) && | 786 | (0 != GNUNET_memcmp (&v6.sin6_addr, |
793 | (0 != memcmp (&v6.sin6_addr, | 787 | &c6->sin6_addr)) && |
794 | &c6->sin6_addr, | ||
795 | sizeof (struct in6_addr))) && | ||
796 | (0 == (delta->ac & GNUNET_NAT_AC_EXTERN)) ) | 788 | (0 == (delta->ac & GNUNET_NAT_AC_EXTERN)) ) |
797 | continue; /* client bound to link-local, and the other address | 789 | continue; /* client bound to link-local, and the other address |
798 | does not match and is not an external IP */ | 790 | does not match and is not an external IP */ |
@@ -1726,9 +1718,8 @@ handle_stun (void *cls, | |||
1726 | &se->stun_server_addr, | 1718 | &se->stun_server_addr, |
1727 | sa_len)) ) | 1719 | sa_len)) ) |
1728 | continue; /* different STUN server */ | 1720 | continue; /* different STUN server */ |
1729 | if (0 != memcmp (&external_addr, | 1721 | if (0 != GNUNET_memcmp (&external_addr, |
1730 | &se->external_addr, | 1722 | &se->external_addr)) |
1731 | sizeof (struct sockaddr_in))) | ||
1732 | { | 1723 | { |
1733 | /* external IP changed, update! */ | 1724 | /* external IP changed, update! */ |
1734 | notify_clients_stun_change (&se->external_addr, | 1725 | 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, | |||
1124 | 1, GNUNET_NO); | 1124 | 1, GNUNET_NO); |
1125 | return; | 1125 | return; |
1126 | } | 1126 | } |
1127 | if (0 == (memcmp (peer_entry->id, | 1127 | if (0 == (GNUNET_memcmp (peer_entry->id, |
1128 | &my_identity, | 1128 | &my_identity))) |
1129 | sizeof (struct GNUNET_PeerIdentity)))) | ||
1130 | { | 1129 | { |
1131 | /* send to self, update our own estimate IF this also comes from us! */ | 1130 | /* send to self, update our own estimate IF this also comes from us! */ |
1132 | if (0 == | 1131 | if (0 == |
1133 | memcmp (&incoming_flood->origin, | 1132 | GNUNET_memcmp (&incoming_flood->origin, |
1134 | &my_identity, sizeof (my_identity))) | 1133 | &my_identity)) |
1135 | update_network_size_estimate (); | 1134 | update_network_size_estimate (); |
1136 | return; | 1135 | return; |
1137 | } | 1136 | } |
@@ -1405,9 +1404,8 @@ core_init (void *cls, | |||
1405 | return; | 1404 | return; |
1406 | } | 1405 | } |
1407 | GNUNET_assert (0 == | 1406 | GNUNET_assert (0 == |
1408 | memcmp (&my_identity, | 1407 | GNUNET_memcmp (&my_identity, |
1409 | identity, | 1408 | identity)); |
1410 | sizeof (struct GNUNET_PeerIdentity))); | ||
1411 | now = GNUNET_TIME_absolute_get (); | 1409 | now = GNUNET_TIME_absolute_get (); |
1412 | current_timestamp.abs_value_us = | 1410 | current_timestamp.abs_value_us = |
1413 | (now.abs_value_us / gnunet_nse_interval.rel_value_us) * | 1411 | (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, | |||
584 | 584 | ||
585 | if ( (NULL != r.hello) && | 585 | if ( (NULL != r.hello) && |
586 | (NULL != r.friend_only_hello) && | 586 | (NULL != r.friend_only_hello) && |
587 | (0 != memcmp (&id_friend, | 587 | (0 != GNUNET_memcmp (&id_friend, |
588 | &id_public, | 588 | &id_public)) ) |
589 | sizeof (id_friend))) ) | ||
590 | { | 589 | { |
591 | /* HELLOs are not for the same peer */ | 590 | /* HELLOs are not for the same peer */ |
592 | GNUNET_break (0); | 591 | GNUNET_break (0); |
@@ -599,7 +598,7 @@ hosts_directory_scan_callback (void *cls, | |||
599 | strlen (filename), | 598 | strlen (filename), |
600 | &identity.public_key)) | 599 | &identity.public_key)) |
601 | { | 600 | { |
602 | if (0 != memcmp (&id, &identity, sizeof (id_friend))) | 601 | if (0 != GNUNET_memcmp (&id, &identity)) |
603 | { | 602 | { |
604 | /* HELLOs are not for the same peer */ | 603 | /* HELLOs are not for the same peer */ |
605 | GNUNET_break (0); | 604 | 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, | |||
271 | return GNUNET_SYSERR; | 271 | return GNUNET_SYSERR; |
272 | } | 272 | } |
273 | if ( (GNUNET_YES == ic->have_peer) && | 273 | if ( (GNUNET_YES == ic->have_peer) && |
274 | (0 != memcmp (&ic->peer, | 274 | (0 != GNUNET_memcmp (&ic->peer, |
275 | &im->peer, | 275 | &im->peer)) ) |
276 | sizeof (struct GNUNET_PeerIdentity))) ) | ||
277 | { | 276 | { |
278 | /* bogus message (from a different iteration call?); out of sequence! */ | 277 | /* bogus message (from a different iteration call?); out of sequence! */ |
279 | LOG (GNUNET_ERROR_TYPE_ERROR, | 278 | LOG (GNUNET_ERROR_TYPE_ERROR, |
@@ -303,9 +302,8 @@ check_info (void *cls, | |||
303 | GNUNET_break (0); | 302 | GNUNET_break (0); |
304 | return GNUNET_SYSERR; | 303 | return GNUNET_SYSERR; |
305 | } | 304 | } |
306 | if (0 != memcmp (&im->peer, | 305 | if (0 != GNUNET_memcmp (&im->peer, |
307 | &id, | 306 | &id)) |
308 | sizeof (struct GNUNET_PeerIdentity))) | ||
309 | { | 307 | { |
310 | /* malformed message */ | 308 | /* malformed message */ |
311 | GNUNET_break (0); | 309 | 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, | |||
160 | GNUNET_log(GNUNET_ERROR_TYPE_INFO, "Received %s HELLO for peer `%s'\n", | 160 | GNUNET_log(GNUNET_ERROR_TYPE_INFO, "Received %s HELLO for peer `%s'\n", |
161 | (GNUNET_YES == GNUNET_HELLO_is_friend_only (hello)) ? "friend only" : "public", | 161 | (GNUNET_YES == GNUNET_HELLO_is_friend_only (hello)) ? "friend only" : "public", |
162 | GNUNET_i2s (peer)); | 162 | GNUNET_i2s (peer)); |
163 | if (0 == memcmp (&pid, peer, sizeof(pid))) | 163 | if (0 == GNUNET_memcmp (&pid, peer)) |
164 | { | 164 | { |
165 | res_cb_w_fo = GNUNET_YES; | 165 | res_cb_w_fo = GNUNET_YES; |
166 | GNUNET_SCHEDULER_add_now (&done, NULL); | 166 | GNUNET_SCHEDULER_add_now (&done, NULL); |
@@ -199,7 +199,7 @@ process_wo_fo (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
199 | GNUNET_log(GNUNET_ERROR_TYPE_INFO, "Received %s HELLO for peer `%s'\n", | 199 | GNUNET_log(GNUNET_ERROR_TYPE_INFO, "Received %s HELLO for peer `%s'\n", |
200 | (GNUNET_YES == GNUNET_HELLO_is_friend_only (hello)) ? "friend only" : "public", | 200 | (GNUNET_YES == GNUNET_HELLO_is_friend_only (hello)) ? "friend only" : "public", |
201 | GNUNET_i2s (peer)); | 201 | GNUNET_i2s (peer)); |
202 | if (0 == memcmp (&pid, peer, sizeof(pid))) | 202 | if (0 == GNUNET_memcmp (&pid, peer)) |
203 | { | 203 | { |
204 | GNUNET_break(0); | 204 | GNUNET_break(0); |
205 | res_cb_wo_fo = GNUNET_YES; | 205 | 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) | |||
191 | GNUNET_break (abs_time.abs_value_us == abs_time2.abs_value_us); | 191 | GNUNET_break (abs_time.abs_value_us == abs_time2.abs_value_us); |
192 | GNUNET_break (forever.abs_value_us == forever2.abs_value_us); | 192 | GNUNET_break (forever.abs_value_us == forever2.abs_value_us); |
193 | GNUNET_break (0 == | 193 | GNUNET_break (0 == |
194 | memcmp (&hc, | 194 | GNUNET_memcmp (&hc, |
195 | &hc2, | 195 | &hc2)); |
196 | sizeof (struct GNUNET_HashCode))); | ||
197 | GNUNET_break (0 == | 196 | GNUNET_break (0 == |
198 | GNUNET_CRYPTO_rsa_signature_cmp (sig, | 197 | GNUNET_CRYPTO_rsa_signature_cmp (sig, |
199 | sig2)); | 198 | 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, | |||
1151 | } | 1151 | } |
1152 | ad = data; | 1152 | ad = data; |
1153 | for (exit = exit_head; NULL != exit; exit = exit->next) | 1153 | for (exit = exit_head; NULL != exit; exit = exit->next) |
1154 | if (0 == memcmp (&ad->peer, | 1154 | if (0 == GNUNET_memcmp (&ad->peer, |
1155 | &exit->peer, | 1155 | &exit->peer)) |
1156 | sizeof (struct GNUNET_PeerIdentity))) | ||
1157 | break; | 1156 | break; |
1158 | if (NULL == exit) | 1157 | if (NULL == exit) |
1159 | { | 1158 | { |
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, | |||
314 | } | 314 | } |
315 | *ticket = GNUNET_new (struct GNUNET_RECLAIM_Ticket); | 315 | *ticket = GNUNET_new (struct GNUNET_RECLAIM_Ticket); |
316 | memcpy (*ticket, &purpose[1], sizeof (struct GNUNET_RECLAIM_Ticket)); | 316 | memcpy (*ticket, &purpose[1], sizeof (struct GNUNET_RECLAIM_Ticket)); |
317 | if (0 != memcmp (audience, &(*ticket)->audience, | 317 | if (0 != GNUNET_memcmp (audience, &(*ticket)->audience)) { |
318 | sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey))) { | ||
319 | GNUNET_free (purpose); | 318 | GNUNET_free (purpose); |
320 | GNUNET_free (*ticket); | 319 | GNUNET_free (*ticket); |
321 | json_decref (code_json); | 320 | 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) | |||
1007 | for (handle->ego_entry = handle->ego_head; NULL != handle->ego_entry; | 1007 | for (handle->ego_entry = handle->ego_head; NULL != handle->ego_entry; |
1008 | handle->ego_entry = handle->ego_entry->next) { | 1008 | handle->ego_entry = handle->ego_entry->next) { |
1009 | GNUNET_IDENTITY_ego_get_public_key (handle->ego_entry->ego, &ego_pkey); | 1009 | GNUNET_IDENTITY_ego_get_public_key (handle->ego_entry->ego, &ego_pkey); |
1010 | if (0 == memcmp (&ego_pkey, &pubkey, | 1010 | if (0 == GNUNET_memcmp (&ego_pkey, &pubkey)) { |
1011 | sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey))) { | ||
1012 | handle->priv_key = | 1011 | handle->priv_key = |
1013 | *GNUNET_IDENTITY_ego_get_private_key (handle->ego_entry->ego); | 1012 | *GNUNET_IDENTITY_ego_get_private_key (handle->ego_entry->ego); |
1014 | handle->idp = GNUNET_RECLAIM_connect (cfg); | 1013 | handle->idp = GNUNET_RECLAIM_connect (cfg); |
@@ -1261,8 +1260,7 @@ tld_iter (void *cls, const char *section, const char *option, const char *value) | |||
1261 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Skipping non key %s\n", value); | 1260 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Skipping non key %s\n", value); |
1262 | return; | 1261 | return; |
1263 | } | 1262 | } |
1264 | if (0 == memcmp (&pkey, &handle->oidc->client_pkey, | 1263 | if (0 == GNUNET_memcmp (&pkey, &handle->oidc->client_pkey)) |
1265 | sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey))) | ||
1266 | handle->tld = GNUNET_strdup (option + 1); | 1264 | handle->tld = GNUNET_strdup (option + 1); |
1267 | } | 1265 | } |
1268 | 1266 | ||
@@ -1337,8 +1335,7 @@ authorize_endpoint (struct GNUNET_REST_RequestHandle *con_handle, | |||
1337 | for (tmp_ego = handle->ego_head; NULL != tmp_ego; tmp_ego = tmp_ego->next) { | 1335 | for (tmp_ego = handle->ego_head; NULL != tmp_ego; tmp_ego = tmp_ego->next) { |
1338 | priv_key = GNUNET_IDENTITY_ego_get_private_key (tmp_ego->ego); | 1336 | priv_key = GNUNET_IDENTITY_ego_get_private_key (tmp_ego->ego); |
1339 | GNUNET_CRYPTO_ecdsa_key_get_public (priv_key, &pkey); | 1337 | GNUNET_CRYPTO_ecdsa_key_get_public (priv_key, &pkey); |
1340 | if (0 == memcmp (&pkey, &handle->oidc->client_pkey, | 1338 | if (0 == GNUNET_memcmp (&pkey, &handle->oidc->client_pkey)) { |
1341 | sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey))) { | ||
1342 | handle->tld = GNUNET_strdup (tmp_ego->identifier); | 1339 | handle->tld = GNUNET_strdup (tmp_ego->identifier); |
1343 | handle->ego_entry = handle->ego_tail; | 1340 | handle->ego_entry = handle->ego_tail; |
1344 | } | 1341 | } |
@@ -1522,8 +1519,7 @@ ego_exists (struct RequestHandle *handle, | |||
1522 | for (ego_entry = handle->ego_head; NULL != ego_entry; | 1519 | for (ego_entry = handle->ego_head; NULL != ego_entry; |
1523 | ego_entry = ego_entry->next) { | 1520 | ego_entry = ego_entry->next) { |
1524 | GNUNET_IDENTITY_ego_get_public_key (ego_entry->ego, &pub_key); | 1521 | GNUNET_IDENTITY_ego_get_public_key (ego_entry->ego, &pub_key); |
1525 | if (0 == memcmp (&pub_key, test_key, | 1522 | if (0 == GNUNET_memcmp (&pub_key, test_key)) { |
1526 | sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey))) { | ||
1527 | break; | 1523 | break; |
1528 | } | 1524 | } |
1529 | } | 1525 | } |
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, | |||
222 | return GNUNET_SYSERR; | 222 | return GNUNET_SYSERR; |
223 | } | 223 | } |
224 | if (NULL != query && | 224 | if (NULL != query && |
225 | 0 != memcmp (&key, | 225 | 0 != GNUNET_memcmp (&key, |
226 | query, | 226 | query)) |
227 | sizeof (struct GNUNET_HashCode))) | ||
228 | { | 227 | { |
229 | GNUNET_break_op (0); | 228 | GNUNET_break_op (0); |
230 | return GNUNET_SYSERR; | 229 | 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, | |||
365 | rd, | 365 | rd, |
366 | sizeof (struct RevocationData))) ) | 366 | sizeof (struct RevocationData))) ) |
367 | { | 367 | { |
368 | if (0 != memcmp (&rd->key, | 368 | if (0 != GNUNET_memcmp (&rd->key, |
369 | &key, | 369 | &key)) |
370 | sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey))) | ||
371 | { | 370 | { |
372 | fprintf (stderr, | 371 | fprintf (stderr, |
373 | _("Error: revocation certificate in `%s' is not for `%s'\n"), | 372 | _("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, | |||
545 | struct GNUNET_HashCode my_hash; | 545 | struct GNUNET_HashCode my_hash; |
546 | struct GNUNET_HashCode peer_hash; | 546 | struct GNUNET_HashCode peer_hash; |
547 | 547 | ||
548 | if (0 == memcmp (peer, | 548 | if (0 == GNUNET_memcmp (peer, |
549 | &my_identity, | 549 | &my_identity)) |
550 | sizeof (my_identity))) | ||
551 | { | 550 | { |
552 | return NULL; | 551 | return NULL; |
553 | } | 552 | } |
@@ -608,9 +607,8 @@ handle_core_disconnect (void *cls, | |||
608 | { | 607 | { |
609 | struct PeerEntry *peer_entry = internal_cls; | 608 | struct PeerEntry *peer_entry = internal_cls; |
610 | 609 | ||
611 | if (0 == memcmp (peer, | 610 | if (0 == GNUNET_memcmp (peer, |
612 | &my_identity, | 611 | &my_identity)) |
613 | sizeof (my_identity))) | ||
614 | return; | 612 | return; |
615 | GNUNET_assert (NULL != peer_entry); | 613 | GNUNET_assert (NULL != peer_entry); |
616 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 614 | 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, | |||
776 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 776 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
777 | "Received intersection request from %s!\n", | 777 | "Received intersection request from %s!\n", |
778 | GNUNET_i2s (other_peer)); | 778 | GNUNET_i2s (other_peer)); |
779 | if (0 != memcmp (other_peer, | 779 | if (0 != GNUNET_memcmp (other_peer, |
780 | &s->peer, | 780 | &s->peer)) |
781 | sizeof (struct GNUNET_PeerIdentity))) | ||
782 | { | 781 | { |
783 | GNUNET_break_op (0); | 782 | GNUNET_break_op (0); |
784 | return; | 783 | 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, | |||
1012 | { | 1012 | { |
1013 | struct AliceServiceSession *s = cls; | 1013 | struct AliceServiceSession *s = cls; |
1014 | 1014 | ||
1015 | if (0 != memcmp (other_peer, | 1015 | if (0 != GNUNET_memcmp (other_peer, |
1016 | &s->peer, | 1016 | &s->peer)) |
1017 | sizeof (struct GNUNET_PeerIdentity))) | ||
1018 | { | 1017 | { |
1019 | GNUNET_break_op (0); | 1018 | GNUNET_break_op (0); |
1020 | return; | 1019 | 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, | |||
228 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "decrypt failed for peer %u\n", n); | 228 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "decrypt failed for peer %u\n", n); |
229 | return; | 229 | return; |
230 | } | 230 | } |
231 | else if (0 == memcmp (&reference_plaintext, plaintext, sizeof (struct GNUNET_SECRETSHARING_Plaintext))) | 231 | else if (0 == GNUNET_memcmp (&reference_plaintext, plaintext)) |
232 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "decrypt got correct result for peer %u\n", n); | 232 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "decrypt got correct result for peer %u\n", n); |
233 | else | 233 | else |
234 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "decrypt got wrong result for peer %u\n", n); | 234 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "decrypt got wrong result for peer %u\n", n); |
@@ -331,7 +331,7 @@ secret_ready_cb (void *cls, | |||
331 | { | 331 | { |
332 | common_pubkey = *public_key; | 332 | common_pubkey = *public_key; |
333 | } | 333 | } |
334 | else if (0 != memcmp (public_key, &common_pubkey, sizeof (struct GNUNET_SECRETSHARING_PublicKey))) | 334 | else if (0 != GNUNET_memcmp (public_key, &common_pubkey)) |
335 | { | 335 | { |
336 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "generated public keys do not match\n"); | 336 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "generated public keys do not match\n"); |
337 | GNUNET_SCHEDULER_shutdown (); | 337 | 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, | |||
330 | { | 330 | { |
331 | unsigned int i; | 331 | unsigned int i; |
332 | for (i = 0; i < ks->num_peers; i++) | 332 | for (i = 0; i < ks->num_peers; i++) |
333 | if (0 == memcmp (peer, &ks->info[i].peer, sizeof (struct GNUNET_PeerIdentity))) | 333 | if (0 == GNUNET_memcmp (peer, &ks->info[i].peer)) |
334 | return &ks->info[i]; | 334 | return &ks->info[i]; |
335 | return NULL; | 335 | return NULL; |
336 | } | 336 | } |
@@ -349,7 +349,7 @@ get_decrypt_peer_info (const struct DecryptSession *ds, | |||
349 | { | 349 | { |
350 | unsigned int i; | 350 | unsigned int i; |
351 | for (i = 0; i < ds->share->num_peers; i++) | 351 | for (i = 0; i < ds->share->num_peers; i++) |
352 | if (0 == memcmp (peer, &ds->info[i].peer, sizeof (struct GNUNET_PeerIdentity))) | 352 | if (0 == GNUNET_memcmp (peer, &ds->info[i].peer)) |
353 | return &ds->info[i]; | 353 | return &ds->info[i]; |
354 | return NULL; | 354 | return NULL; |
355 | } | 355 | } |
@@ -411,9 +411,8 @@ peer_find (const struct GNUNET_PeerIdentity *haystack, unsigned int n, | |||
411 | unsigned int i; | 411 | unsigned int i; |
412 | 412 | ||
413 | for (i = 0; i < n; i++) | 413 | for (i = 0; i < n; i++) |
414 | if (0 == memcmp (&haystack[i], | 414 | if (0 == GNUNET_memcmp (&haystack[i], |
415 | needle, | 415 | needle)) |
416 | sizeof (struct GNUNET_PeerIdentity))) | ||
417 | return i; | 416 | return i; |
418 | return -1; | 417 | return -1; |
419 | } | 418 | } |
@@ -827,7 +826,7 @@ keygen_round2_conclude (void *cls) | |||
827 | GNUNET_SECRETSHARING_ELGAMAL_BITS / 8, | 826 | GNUNET_SECRETSHARING_ELGAMAL_BITS / 8, |
828 | ks->info[i].sigma); | 827 | ks->info[i].sigma); |
829 | share->original_indices[i] = j; | 828 | share->original_indices[i] = j; |
830 | if (0 == memcmp (&share->peers[i], &my_peer, sizeof (struct GNUNET_PeerIdentity))) | 829 | if (0 == GNUNET_memcmp (&share->peers[i], &my_peer)) |
831 | share->my_peer = j; | 830 | share->my_peer = j; |
832 | j += 1; | 831 | j += 1; |
833 | } | 832 | } |
@@ -1897,7 +1896,7 @@ decrypt_new_element (void *cls, | |||
1897 | return; | 1896 | return; |
1898 | } | 1897 | } |
1899 | 1898 | ||
1900 | if (0 != memcmp (&d->ciphertext, &session->ciphertext, sizeof (struct GNUNET_SECRETSHARING_Ciphertext))) | 1899 | if (0 != GNUNET_memcmp (&d->ciphertext, &session->ciphertext)) |
1901 | { | 1900 | { |
1902 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "P%u: got decrypt element with non-matching ciphertext from P%u\n", | 1901 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "P%u: got decrypt element with non-matching ciphertext from P%u\n", |
1903 | (unsigned int) session->share->my_peer, (unsigned int) (info - session->info)); | 1902 | (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) | |||
843 | 843 | ||
844 | if ( (0 == op->state->my_element_count) || /* fully disjoint */ | 844 | if ( (0 == op->state->my_element_count) || /* fully disjoint */ |
845 | ( (op->state->my_element_count == op->remote_element_count) && | 845 | ( (op->state->my_element_count == op->remote_element_count) && |
846 | (0 == memcmp (&op->state->my_xor, | 846 | (0 == GNUNET_memcmp (&op->state->my_xor, |
847 | &op->state->other_xor, | 847 | &op->state->other_xor)) ) ) |
848 | sizeof (struct GNUNET_HashCode))) ) ) | ||
849 | { | 848 | { |
850 | /* we are done */ | 849 | /* we are done */ |
851 | op->state->phase = PHASE_MUST_SEND_DONE; | 850 | op->state->phase = PHASE_MUST_SEND_DONE; |
@@ -1059,9 +1058,8 @@ handle_intersection_p2p_done (void *cls, | |||
1059 | op); | 1058 | op); |
1060 | } | 1059 | } |
1061 | if ( (op->state->my_element_count != ntohl (idm->final_element_count)) || | 1060 | if ( (op->state->my_element_count != ntohl (idm->final_element_count)) || |
1062 | (0 != memcmp (&op->state->my_xor, | 1061 | (0 != GNUNET_memcmp (&op->state->my_xor, |
1063 | &idm->element_xor_hash, | 1062 | &idm->element_xor_hash)) ) |
1064 | sizeof (struct GNUNET_HashCode))) ) | ||
1065 | { | 1063 | { |
1066 | /* Other peer thinks we are done, but we disagree on the result! */ | 1064 | /* Other peer thinks we are done, but we disagree on the result! */ |
1067 | GNUNET_break_op (0); | 1065 | 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) | |||
192 | GNUNET_break (abs_time.abs_value_us == abs_time2.abs_value_us); | 192 | GNUNET_break (abs_time.abs_value_us == abs_time2.abs_value_us); |
193 | GNUNET_break (forever.abs_value_us == forever2.abs_value_us); | 193 | GNUNET_break (forever.abs_value_us == forever2.abs_value_us); |
194 | GNUNET_break (0 == | 194 | GNUNET_break (0 == |
195 | memcmp (&hc, | 195 | GNUNET_memcmp (&hc, |
196 | &hc2, | 196 | &hc2)); |
197 | sizeof (struct GNUNET_HashCode))); | ||
198 | GNUNET_break (0 == | 197 | GNUNET_break (0 == |
199 | GNUNET_CRYPTO_rsa_signature_cmp (sig, | 198 | GNUNET_CRYPTO_rsa_signature_cmp (sig, |
200 | sig2)); | 199 | 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) | |||
306 | uint32_t strength; | 306 | uint32_t strength; |
307 | 307 | ||
308 | if (0 == | 308 | if (0 == |
309 | memcmp (&my_identity, | 309 | GNUNET_memcmp (&my_identity, |
310 | &pos->pid, | 310 | &pos->pid)) |
311 | sizeof (struct GNUNET_PeerIdentity))) | ||
312 | return; /* This is myself, nothing to do. */ | 311 | return; /* This is myself, nothing to do. */ |
313 | if (connection_count < target_connection_count) | 312 | if (connection_count < target_connection_count) |
314 | strength = 1; | 313 | strength = 1; |
@@ -602,9 +601,8 @@ connect_notify (void *cls, | |||
602 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 601 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
603 | "Core told us that we are connecting to `%s'\n", | 602 | "Core told us that we are connecting to `%s'\n", |
604 | GNUNET_i2s (peer)); | 603 | GNUNET_i2s (peer)); |
605 | if (0 == memcmp (&my_identity, | 604 | if (0 == GNUNET_memcmp (&my_identity, |
606 | peer, | 605 | peer)) |
607 | sizeof (struct GNUNET_PeerIdentity))) | ||
608 | return NULL; | 606 | return NULL; |
609 | extra = GNUNET_CORE_get_mq_options (GNUNET_YES, | 607 | extra = GNUNET_CORE_get_mq_options (GNUNET_YES, |
610 | GNUNET_CORE_PRIO_BEST_EFFORT, | 608 | GNUNET_CORE_PRIO_BEST_EFFORT, |
@@ -781,9 +779,8 @@ consider_for_advertising (const struct GNUNET_HELLO_Message *hello) | |||
781 | GNUNET_break (0); | 779 | GNUNET_break (0); |
782 | return; | 780 | return; |
783 | } | 781 | } |
784 | if (0 == memcmp (&pid, | 782 | if (0 == GNUNET_memcmp (&pid, |
785 | &my_identity, | 783 | &my_identity)) |
786 | sizeof (struct GNUNET_PeerIdentity))) | ||
787 | return; /* that's me! */ | 784 | return; /* that's me! */ |
788 | have_address = GNUNET_NO; | 785 | have_address = GNUNET_NO; |
789 | GNUNET_HELLO_iterate_addresses (hello, | 786 | GNUNET_HELLO_iterate_addresses (hello, |
@@ -869,9 +866,8 @@ process_peer (void *cls, | |||
869 | return; | 866 | return; |
870 | } | 867 | } |
871 | GNUNET_assert (NULL != peer); | 868 | GNUNET_assert (NULL != peer); |
872 | if (0 == memcmp (&my_identity, | 869 | if (0 == GNUNET_memcmp (&my_identity, |
873 | peer, | 870 | peer)) |
874 | sizeof (struct GNUNET_PeerIdentity))) | ||
875 | return; /* that's me! */ | 871 | return; /* that's me! */ |
876 | if (NULL == hello) | 872 | if (NULL == hello) |
877 | { | 873 | { |
@@ -948,9 +944,8 @@ handle_friend (void *cls, | |||
948 | unsigned int *entries_found = cls; | 944 | unsigned int *entries_found = cls; |
949 | struct Peer *fl; | 945 | struct Peer *fl; |
950 | 946 | ||
951 | if (0 == memcmp (pid, | 947 | if (0 == GNUNET_memcmp (pid, |
952 | &my_identity, | 948 | &my_identity)) |
953 | sizeof (struct GNUNET_PeerIdentity))) | ||
954 | { | 949 | { |
955 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 950 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
956 | _("Found myself `%s' in friend list (useless, ignored)\n"), | 951 | _("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) | |||
2437 | while ( (GNUNET_YES == | 2437 | while ( (GNUNET_YES == |
2438 | GNUNET_CONTAINER_multihashmap_contains (destination_map, | 2438 | GNUNET_CONTAINER_multihashmap_contains (destination_map, |
2439 | &key)) || | 2439 | &key)) || |
2440 | (0 == memcmp (v6, | 2440 | (0 == GNUNET_memcmp (v6, |
2441 | &addr, | 2441 | &addr)) || |
2442 | sizeof (struct in6_addr))) || | 2442 | (0 == GNUNET_memcmp (v6, |
2443 | (0 == memcmp (v6, | 2443 | &mask)) ); |
2444 | &mask, | ||
2445 | sizeof (struct in6_addr))) ); | ||
2446 | return GNUNET_OK; | 2444 | return GNUNET_OK; |
2447 | } | 2445 | } |
2448 | 2446 | ||