- diff --git a/src/abd/abd.h b/src/abd/abd.h
- index 1e9d6bcea..0af0d43ca 100644
- --- a/src/abd/abd.h
- +++ b/src/abd/abd.h
- @@ -245,14 +245,14 @@ struct DelegateEntry
- {
- /**
- - * The signature for this credential by the issuer
- + * Signature meta
- */
- - struct GNUNET_CRYPTO_EcdsaSignature signature;
- + struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
- /**
- - * Signature meta
- + * The signature for this credential by the issuer
- */
- - struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
- + struct GNUNET_CRYPTO_EcdsaSignature signature;
- /**
- * Public key of the issuer
- diff --git a/src/abd/abd_serialization.c b/src/abd/abd_serialization.c
- index 90a89886b..c03fab7dc 100644
- --- a/src/abd/abd_serialization.c
- +++ b/src/abd/abd_serialization.c
- @@ -451,7 +451,7 @@ GNUNET_ABD_delegate_serialize (struct GNUNET_ABD_Delegate *dele,
- if (GNUNET_OK !=
- GNUNET_CRYPTO_ecdsa_verify (GNUNET_SIGNATURE_PURPOSE_DELEGATE,
- - &cdata->purpose,
- + cdata,
- &cdata->signature,
- &cdata->issuer_key))
- {
- @@ -474,7 +474,7 @@ GNUNET_ABD_delegate_deserialize (const char *data, size_t data_size)
- cdata = (struct DelegateEntry *) data;
- if (GNUNET_OK !=
- GNUNET_CRYPTO_ecdsa_verify (GNUNET_SIGNATURE_PURPOSE_DELEGATE,
- - &cdata->purpose,
- + cdata,
- &cdata->signature,
- &cdata->issuer_key))
- {
- diff --git a/src/abd/delegate_misc.c b/src/abd/delegate_misc.c
- index df34cff8b..4740a3e30 100644
- --- a/src/abd/delegate_misc.c
- +++ b/src/abd/delegate_misc.c
- @@ -240,13 +240,7 @@ GNUNET_ABD_delegate_issue (
- GNUNET_memcpy (&del[1], tmp_str, attr_len);
- - if (GNUNET_OK !=
- - GNUNET_CRYPTO_ecdsa_sign (issuer, &del->purpose, &del->signature))
- - {
- - GNUNET_break (0);
- - GNUNET_free (del);
- - return NULL;
- - }
- + GNUNET_CRYPTO_ecdsa_sign (issuer, del, &del->signature);
- dele = GNUNET_malloc (sizeof (struct GNUNET_ABD_Delegate) + attr_len);
- dele->signature = del->signature;
- diff --git a/src/abd/gnunet-abd.c b/src/abd/gnunet-abd.c
- index eb3e29e23..6cf4aab0d 100644
- --- a/src/abd/gnunet-abd.c
- +++ b/src/abd/gnunet-abd.c
- @@ -512,11 +512,13 @@ get_existing_record (void *cls,
- unsigned int rd_count,
- const struct GNUNET_GNSRECORD_Data *rd)
- {
- - struct GNUNET_GNSRECORD_Data rdn[rd_count + 1];
- struct GNUNET_GNSRECORD_Data *rde;
- + struct GNUNET_GNSRECORD_Data* rdn =
- + GNUNET_malloc(sizeof(*rdn)*(rd_count + 1));
- memset (rdn, 0, sizeof (struct GNUNET_GNSRECORD_Data));
- - GNUNET_memcpy (&rdn[1], rd, rd_count * sizeof (struct GNUNET_GNSRECORD_Data));
- + GNUNET_memcpy (&rdn[1], rd,
- + rd_count * sizeof (struct GNUNET_GNSRECORD_Data));
- rde = &rdn[0];
- rde->data = data;
- rde->data_size = data_size;
- @@ -539,7 +541,7 @@ get_existing_record (void *cls,
- rde,
- &add_continuation,
- &add_qe);
- -
- + GNUNET_free(rdn);
- return;
- }
- @@ -602,10 +604,18 @@ store_cb (void *cls, const struct GNUNET_IDENTITY_Ego *ego)
- if (GNUNET_OK !=
- GNUNET_GNSRECORD_string_to_value (type, subject, &data, &data_size))
- {
- - fprintf (stderr,
- - "Value `%s' invalid for record type `%s'\n",
- - subject,
- - typestring);
- + if(typestring == NULL) {
- + fputs("No value for unknown record type\n", stderr);
- + } else if(subject == NULL) {
- + fprintf(stderr,
- + "No value for record type`%s'\n",
- + typestring);
- + } else {
- + fprintf (stderr,
- + "Value `%s' invalid for record type `%s'\n",
- + subject,
- + typestring);
- + }
- GNUNET_SCHEDULER_shutdown ();
- return;
- }
- @@ -917,7 +927,8 @@ run (void *cls,
- int i;
- while (NULL != (tok = strtok (NULL, ",")))
- count++;
- - struct GNUNET_ABD_Delegate delegates[count];
- + struct GNUNET_ABD_Delegate* delegates =
- + GNUNET_malloc(sizeof(*delegates)*count);
- struct GNUNET_ABD_Delegate *dele;
- GNUNET_free (tmp);
- tmp = GNUNET_strdup (subject_delegate);
- @@ -946,9 +957,11 @@ run (void *cls,
- NULL);
- for (i = 0; i < count; i++)
- {
- - GNUNET_free ((char *) delegates[i].issuer_attribute);
- + GNUNET_free_nz ((char *) delegates[i].issuer_attribute);
- + delegates[i].issuer_attribute = NULL;
- }
- GNUNET_free (tmp);
- + GNUNET_free(delegates);
- }
- else
- {
- diff --git a/src/abd/plugin_gnsrecord_abd.c b/src/abd/plugin_gnsrecord_abd.c
- index c7635b997..850fa9a45 100644
- --- a/src/abd/plugin_gnsrecord_abd.c
- +++ b/src/abd/plugin_gnsrecord_abd.c
- @@ -235,8 +235,10 @@ abd_string_to_value (void *cls,
- (char *) &sets[1]);
- for (i = 0; i < entries; i++)
- {
- - if (0 != set[i].subject_attribute_len)
- - GNUNET_free ((char *) set[i].subject_attribute);
- + if (0 != set[i].subject_attribute_len) {
- + GNUNET_free_nz ((char *) set[i].subject_attribute);
- + set[i].subject_attribute = NULL;
- + }
- }
- sets->set_count = htonl (entries);
- sets->data_size = GNUNET_htonll (tmp_data_size);
Undefined
By: Guest | Date: Apr 27 2020 23:21 | Format: None | Expires: never | Size: 5.52 KB | Hits: 501
Latest pastes
1 days ago
2 days ago
5 days ago
6 days ago
6 days ago