summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Schanzenbach <schanzen@gnunet.org>2022-11-05 08:41:36 +0900
committerMartin Schanzenbach <schanzen@gnunet.org>2022-11-05 08:41:36 +0900
commite22c4a47f4d77c4013da2a7781abdeb8838901de (patch)
treef21b2c858c83214807b595b07f14e8a2fee2d070
parent145a04e3ac6763644a94b01e16b87964a0716ac7 (diff)
RECLAIM: Fix length field inconsistencies in IPC protocol. Issue #7432
m---------contrib/sphinx0
-rw-r--r--po/de.po2
-rw-r--r--po/es.po2
-rw-r--r--po/fr.po2
-rw-r--r--po/it.po2
-rw-r--r--po/sr.po2
-rw-r--r--po/sv.po2
-rw-r--r--po/vi.po2
-rw-r--r--po/zh_CN.po2
-rw-r--r--src/reclaim/gnunet-service-reclaim.c32
-rw-r--r--src/reclaim/reclaim.h9
-rw-r--r--src/reclaim/reclaim_api.c20
12 files changed, 36 insertions, 41 deletions
diff --git a/contrib/sphinx b/contrib/sphinx
-Subproject 5f853d253daa5bc700b549fd40e4086aee1058b
+Subproject 84cb6aaaaebe9b79d5453a8444ee95459c8f502
diff --git a/po/de.po b/po/de.po
index a0b9a0e15..8b84b7407 100644
--- a/po/de.po
+++ b/po/de.po
@@ -10,7 +10,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gnunet 0.10.1\n"
"Report-Msgid-Bugs-To: gnunet-developers@mail.gnu.org\n"
-"POT-Creation-Date: 2022-11-01 12:18+0900\n"
+"POT-Creation-Date: 2022-11-04 14:22+0900\n"
"PO-Revision-Date: 2015-03-08 16:16+0100\n"
"Last-Translator: Mario Blättermann <mario.blaettermann@gmail.com>\n"
"Language-Team: German <translation-team-de@lists.sourceforge.net>\n"
diff --git a/po/es.po b/po/es.po
index 922104c99..52d0f2533 100644
--- a/po/es.po
+++ b/po/es.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gnunet 0.9.5a\n"
"Report-Msgid-Bugs-To: gnunet-developers@mail.gnu.org\n"
-"POT-Creation-Date: 2022-11-01 12:18+0900\n"
+"POT-Creation-Date: 2022-11-04 14:22+0900\n"
"PO-Revision-Date: 2013-02-23 17:50+0100\n"
"Last-Translator: Miguel Ángel Arruga Vivas <rosen644835@gmail.com>\n"
"Language-Team: Spanish <es@li.org>\n"
diff --git a/po/fr.po b/po/fr.po
index 99dcd3c06..35094e2f6 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gnunet 0.10.1\n"
"Report-Msgid-Bugs-To: gnunet-developers@mail.gnu.org\n"
-"POT-Creation-Date: 2022-11-01 12:18+0900\n"
+"POT-Creation-Date: 2022-11-04 14:22+0900\n"
"PO-Revision-Date: 2021-11-21 00:53+0100\n"
"Last-Translator: Stéphane Aulery <lkppo@free.fr>\n"
"Language-Team: French <traduc@traduc.org>\n"
diff --git a/po/it.po b/po/it.po
index 735d5a341..24fc982b6 100644
--- a/po/it.po
+++ b/po/it.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gnunet 0.10.1\n"
"Report-Msgid-Bugs-To: gnunet-developers@mail.gnu.org\n"
-"POT-Creation-Date: 2022-11-01 12:18+0900\n"
+"POT-Creation-Date: 2022-11-04 14:22+0900\n"
"PO-Revision-Date: 2019-10-16 11:00+0200\n"
"Last-Translator: Sebastiano Pistore <sebastianopistore.info@protonmail.ch>\n"
"Language-Team: Italian <tp@lists.linux.it>\n"
diff --git a/po/sr.po b/po/sr.po
index 122e76df0..5e09a76d6 100644
--- a/po/sr.po
+++ b/po/sr.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gnunet-0.10.1\n"
"Report-Msgid-Bugs-To: gnunet-developers@mail.gnu.org\n"
-"POT-Creation-Date: 2022-11-01 12:18+0900\n"
+"POT-Creation-Date: 2022-11-04 14:22+0900\n"
"PO-Revision-Date: 2020-10-23 18:39+0200\n"
"Last-Translator: Мирослав Николић <miroslavnikolic@rocketmail.com>\n"
"Language-Team: Serbian <(nothing)>\n"
diff --git a/po/sv.po b/po/sv.po
index 7cdfda7a8..480e32615 100644
--- a/po/sv.po
+++ b/po/sv.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: GNUnet 0.7.0b\n"
"Report-Msgid-Bugs-To: gnunet-developers@mail.gnu.org\n"
-"POT-Creation-Date: 2022-11-01 12:18+0900\n"
+"POT-Creation-Date: 2022-11-04 14:22+0900\n"
"PO-Revision-Date: 2006-01-21 17:16+0100\n"
"Last-Translator: Daniel Nylander <po@danielnylander.se>\n"
"Language-Team: Swedish <tp-sv@listor.tp-sv.se>\n"
diff --git a/po/vi.po b/po/vi.po
index 92c004906..7efd3a1f3 100644
--- a/po/vi.po
+++ b/po/vi.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gnunet 0.8.0a\n"
"Report-Msgid-Bugs-To: gnunet-developers@mail.gnu.org\n"
-"POT-Creation-Date: 2022-11-01 12:18+0900\n"
+"POT-Creation-Date: 2022-11-04 14:22+0900\n"
"PO-Revision-Date: 2008-09-10 22:05+0930\n"
"Last-Translator: Clytie Siddall <clytie@riverland.net.au>\n"
"Language-Team: Vietnamese <vi-VN@googlegroups.com>\n"
diff --git a/po/zh_CN.po b/po/zh_CN.po
index 4bcc8d253..50e8fc217 100644
--- a/po/zh_CN.po
+++ b/po/zh_CN.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gnunet-0.8.1\n"
"Report-Msgid-Bugs-To: gnunet-developers@mail.gnu.org\n"
-"POT-Creation-Date: 2022-11-01 12:18+0900\n"
+"POT-Creation-Date: 2022-11-04 14:22+0900\n"
"PO-Revision-Date: 2011-07-09 12:12+0800\n"
"Last-Translator: Wylmer Wang <wantinghard@gmail.com>\n"
"Language-Team: Chinese (simplified) <i18n-zh@googlegroups.com>\n"
diff --git a/src/reclaim/gnunet-service-reclaim.c b/src/reclaim/gnunet-service-reclaim.c
index 4c80d6d24..2cf223173 100644
--- a/src/reclaim/gnunet-service-reclaim.c
+++ b/src/reclaim/gnunet-service-reclaim.c
@@ -681,7 +681,7 @@ send_ticket_result (const struct IdpClient *client,
}
// TODO add success member
irm->id = htonl (r_id);
- irm->presentations_len = htons (pres_len);
+ irm->presentations_len = htonl (pres_len);
if (NULL != presentations)
{
GNUNET_RECLAIM_presentation_list_serialize (presentations,
@@ -745,7 +745,7 @@ check_issue_ticket_message (void *cls, const struct IssueTicketMessage *im)
size_t pkey_len;
size = ntohs (im->header.size);
- attrs_len = ntohs (im->attr_len);
+ attrs_len = ntohl (im->attr_len);
key_len = ntohl (im->key_len);
pkey_len = ntohl (im->pkey_len);
if (size != attrs_len + key_len + pkey_len + sizeof(struct
@@ -806,7 +806,7 @@ handle_issue_ticket_message (void *cls, const struct IssueTicketMessage *im)
}
buf += read;
tio = GNUNET_new (struct TicketIssueOperation);
- attrs_len = ntohs (im->attr_len);
+ attrs_len = ntohl (im->attr_len);
attrs = GNUNET_RECLAIM_attribute_list_deserialize (buf,
attrs_len);
for (le = attrs->list_head; NULL != le; le = le->next)
@@ -972,8 +972,8 @@ consume_result_cb (void *cls,
attrs_len + pres_len + key_len,
GNUNET_MESSAGE_TYPE_RECLAIM_CONSUME_TICKET_RESULT);
crm->id = htonl (cop->r_id);
- crm->attrs_len = htons (attrs_len);
- crm->presentations_len = htons (pres_len);
+ crm->attrs_len = htonl (attrs_len);
+ crm->presentations_len = htonl (pres_len);
crm->key_len = htonl (key_len);
crm->result = htonl (success);
data_tmp = (char *) &crm[1];
@@ -1196,7 +1196,7 @@ handle_attribute_store_message (void *cls,
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received ATTRIBUTE_STORE message\n");
- data_len = ntohs (sam->attr_len);
+ data_len = ntohl (sam->attr_len);
key_len = ntohl (sam->key_len);
buf = (char *) &sam[1];
if ((GNUNET_SYSERR ==
@@ -1397,7 +1397,7 @@ handle_credential_store_message (void *cls,
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received CREDENTIAL_STORE message\n");
- data_len = ntohs (sam->attr_len);
+ data_len = ntohl (sam->attr_len);
key_len = ntohl (sam->key_len);
buf = (char *) &sam[1];
if ((GNUNET_SYSERR ==
@@ -1868,7 +1868,7 @@ handle_attribute_delete_message (void *cls,
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received ATTRIBUTE_DELETE message\n");
- data_len = ntohs (dam->attr_len);
+ data_len = ntohl (dam->attr_len);
key_len = ntohl (dam->key_len);
buf = (char *) &dam[1];
if ((GNUNET_SYSERR ==
@@ -1975,7 +1975,7 @@ handle_credential_delete_message (void *cls,
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received CREDENTIAL_DELETE message\n");
- data_len = ntohs (dam->attr_len);
+ data_len = ntohl (dam->attr_len);
key_len = ntohl (dam->key_len);
buf = (char *) &dam[1];
if ((GNUNET_SYSERR ==
@@ -2032,7 +2032,7 @@ attr_iter_finished (void *cls)
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Sending ATTRIBUTE_RESULT message\n");
env = GNUNET_MQ_msg (arm, GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_RESULT);
arm->id = htonl (ai->request_id);
- arm->attr_len = htons (0);
+ arm->attr_len = htonl (0);
arm->pkey_len = htonl (0);
GNUNET_MQ_send (ai->client->mq, env);
GNUNET_CONTAINER_DLL_remove (ai->client->attr_iter_head,
@@ -2097,7 +2097,7 @@ attr_iter_cb (void *cls,
rd->data_size + key_len,
GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_RESULT);
arm->id = htonl (ai->request_id);
- arm->attr_len = htons (rd->data_size);
+ arm->attr_len = htonl (rd->data_size);
data_tmp = (char *) &arm[1];
arm->pkey_len = htonl (key_len);
written = GNUNET_IDENTITY_write_public_key_to_buffer (&identity,
@@ -2119,7 +2119,7 @@ check_iteration_start (
size_t key_len;
size = ntohs (ais_msg->header.size);
- key_len = ntohs (ais_msg->key_len);
+ key_len = ntohl (ais_msg->key_len);
if (size < key_len + sizeof(*ais_msg))
{
@@ -2262,7 +2262,7 @@ cred_iter_finished (void *cls)
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Sending CREDENTIAL_RESULT message\n");
env = GNUNET_MQ_msg (arm, GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_RESULT);
arm->id = htonl (ai->request_id);
- arm->credential_len = htons (0);
+ arm->credential_len = htonl (0);
GNUNET_MQ_send (ai->client->mq, env);
GNUNET_CONTAINER_DLL_remove (ai->client->cred_iter_head,
ai->client->cred_iter_tail,
@@ -2326,7 +2326,7 @@ cred_iter_cb (void *cls,
rd->data_size + key_len,
GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_RESULT);
arm->id = htonl (ai->request_id);
- arm->credential_len = htons (rd->data_size);
+ arm->credential_len = htonl (rd->data_size);
data_tmp = (char *) &arm[1];
written = GNUNET_IDENTITY_write_public_key_to_buffer (&identity,
data_tmp,
@@ -2346,7 +2346,7 @@ check_credential_iteration_start (
size_t key_len;
size = ntohs (cis_msg->header.size);
- key_len = ntohs (cis_msg->key_len);
+ key_len = ntohl (cis_msg->key_len);
if (size < key_len + sizeof(*cis_msg))
{
@@ -2531,7 +2531,7 @@ check_ticket_iteration_start (
size_t key_len;
size = ntohs (tis_msg->header.size);
- key_len = ntohs (tis_msg->key_len);
+ key_len = ntohl (tis_msg->key_len);
if (size < key_len + sizeof(*tis_msg))
{
diff --git a/src/reclaim/reclaim.h b/src/reclaim/reclaim.h
index 5813beaf7..d2d2d4b89 100644
--- a/src/reclaim/reclaim.h
+++ b/src/reclaim/reclaim.h
@@ -138,17 +138,12 @@ struct AttributeResultMessage
/**
* Length of serialized attribute data
*/
- uint16_t attr_len GNUNET_PACKED;
+ uint32_t attr_len GNUNET_PACKED;
/**
* Length of serialized credential data
*/
- uint16_t credential_len GNUNET_PACKED;
-
- /**
- * always zero (for alignment)
- */
- uint16_t reserved GNUNET_PACKED;
+ uint32_t credential_len GNUNET_PACKED;
/**
* The length of the public key
diff --git a/src/reclaim/reclaim_api.c b/src/reclaim/reclaim_api.c
index efc45e616..cb1aa305a 100644
--- a/src/reclaim/reclaim_api.c
+++ b/src/reclaim/reclaim_api.c
@@ -570,9 +570,9 @@ check_consume_ticket_result (void *cls,
size_t key_len;
msg_len = ntohs (msg->header.size);
- attrs_len = ntohs (msg->attrs_len);
+ attrs_len = ntohl (msg->attrs_len);
key_len = ntohl (msg->key_len);
- pl_len = ntohs (msg->presentations_len);
+ pl_len = ntohl (msg->presentations_len);
if (msg_len != sizeof(*msg) + attrs_len + pl_len + key_len)
{
GNUNET_break (0);
@@ -603,9 +603,9 @@ handle_consume_ticket_result (void *cls,
uint32_t r_id = ntohl (msg->id);
char *read_ptr;
- attrs_len = ntohs (msg->attrs_len);
+ attrs_len = ntohl (msg->attrs_len);
key_len = ntohl (msg->key_len);
- pl_len = ntohs (msg->presentations_len);
+ pl_len = ntohl (msg->presentations_len);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Processing ticket result.\n");
@@ -694,7 +694,7 @@ check_attribute_result (void *cls, const struct AttributeResultMessage *msg)
size_t key_len;
msg_len = ntohs (msg->header.size);
- attr_len = ntohs (msg->attr_len);
+ attr_len = ntohl (msg->attr_len);
key_len = ntohl (msg->pkey_len);
if (msg_len != sizeof(*msg) + attr_len + key_len)
{
@@ -725,7 +725,7 @@ handle_attribute_result (void *cls, const struct AttributeResultMessage *msg)
uint32_t r_id = ntohl (msg->id);
char *buf;
- attr_len = ntohs (msg->attr_len);
+ attr_len = ntohl (msg->attr_len);
key_len = ntohl (msg->pkey_len);
LOG (GNUNET_ERROR_TYPE_DEBUG, "Processing attribute result.\n");
@@ -805,7 +805,7 @@ check_credential_result (void *cls, const struct CredentialResultMessage *msg)
size_t key_len;
msg_len = ntohs (msg->header.size);
- cred_len = ntohs (msg->credential_len);
+ cred_len = ntohl (msg->credential_len);
key_len = ntohl (msg->key_len);
if (msg_len != sizeof(*msg) + cred_len + key_len)
{
@@ -838,7 +838,7 @@ handle_credential_result (void *cls, const struct
char *buf;
key_len = ntohl (msg->key_len);
- att_len = ntohs (msg->credential_len);
+ att_len = ntohl (msg->credential_len);
LOG (GNUNET_ERROR_TYPE_DEBUG, "Processing credential result.\n");
@@ -922,7 +922,7 @@ check_ticket_result (void *cls, const struct TicketResultMessage *msg)
size_t tkt_len;
msg_len = ntohs (msg->header.size);
- pres_len = ntohs (msg->presentations_len);
+ pres_len = ntohl (msg->presentations_len);
tkt_len = ntohl (msg->tkt_len);
if (msg_len != sizeof(*msg) + pres_len + tkt_len)
{
@@ -955,7 +955,7 @@ handle_ticket_result (void *cls, const struct TicketResultMessage *msg)
char *buf;
tkt_len = ntohl (msg->tkt_len);
- pres_len = ntohs (msg->presentations_len);
+ pres_len = ntohl (msg->presentations_len);
for (op = handle->op_head; NULL != op; op = op->next)
if (op->r_id == r_id)
break;