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];
}
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 ;
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];
}
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);
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) )
{
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;
(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;
{
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;
}
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)
{
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,
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;
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;
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;
}
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;
}
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;
}
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:
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;
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. */
(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));
{
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
}
/* 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)
{
return;
}
GNUNET_break (0 ==
- memcmp (my_identity,
- &my_full_id,
- sizeof (struct GNUNET_PeerIdentity)));
+ GNUNET_memcmp (my_identity,
+ &my_full_id));
}
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);
? &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;
0,
&key->HK,
hmac);
- if (0 == memcmp (hmac,
- &src->hmac,
- sizeof (*hmac)))
+ if (0 == GNUNET_memcmp (hmac,
+ &src->hmac))
{
valid_HK = &key->HK;
break;
(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 */
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 */
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,
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",
GNUNET_CRYPTO_ecc_ecdh (e2,
&p1,
&hc2));
- GNUNET_break (0 == memcmp (&hc1,
- &hc2,
- sizeof (hc1)));
+ GNUNET_break (0 == GNUNET_memcmp (&hc1,
+ &hc2));
}
GNUNET_CRYPTO_eddsa_ecdh (e2,
&p1,
&hc2));
- GNUNET_break (0 == memcmp (&hc1,
- &hc2,
- sizeof (hc1)));
+ GNUNET_break (0 == GNUNET_memcmp (&hc1,
+ &hc2));
}
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. */
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",
{
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;
}
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;
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",
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,
{
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,
(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",
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);
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,
= (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:
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;
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;
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,
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");
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)
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);
}
/**
(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;
{
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);
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;
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,
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,
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++)
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;
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;
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);
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)
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++)
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);
{
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);
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");
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");
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))
{
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))
{
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)
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))
{
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");
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))
{
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))
{
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);
(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));
}
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;
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)
(! 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,
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 */
&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,
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;
}
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) *
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);
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);
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,
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);
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);
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;
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));
}
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)
{
}
*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);
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);
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);
}
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;
}
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;
}
}
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;
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"),
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;
}
{
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,
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;
{
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;
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);
{
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 ();
{
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;
}
{
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;
}
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;
}
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;
}
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));
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;
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);
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));
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;
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,
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,
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)
{
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"),
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;
}