Browse Source

sync to GNUnet API changes

master
Dejvino 3 years ago
parent
commit
43b7cab5ba
5 changed files with 16 additions and 19 deletions
  1. +1
    -1
      src/multicast/gnunet-multicast.c
  2. +6
    -6
      src/multicast/gnunet-service-multicast.c
  3. +5
    -5
      src/multicast/multicast.h
  4. +3
    -6
      src/social/gnunet-service-social.c
  5. +1
    -1
      src/social/gnunet-social.c

+ 1
- 1
src/multicast/gnunet-multicast.c View File

@@ -72,7 +72,7 @@ main (int argc, char *const *argv)
gettext_noop ("This command doesn't do anything yet."), gettext_noop ("This command doesn't do anything yet."),
options, &run, options, &run,
NULL)) ? ret : 1; NULL)) ? ret : 1;
GNUNET_free ((void*) argv);
GNUNET_free_nz ((void*) argv);
return ret; return ret;
} }




+ 6
- 6
src/multicast/gnunet-service-multicast.c View File

@@ -969,7 +969,7 @@ check_cadet_join_request (void *cls,
return GNUNET_SYSERR; return GNUNET_SYSERR;
} }
if (GNUNET_OK != if (GNUNET_OK !=
GNUNET_CRYPTO_ecdsa_verify (GNUNET_SIGNATURE_PURPOSE_MULTICAST_REQUEST,
GNUNET_CRYPTO_ecdsa_verify_ (GNUNET_SIGNATURE_PURPOSE_MULTICAST_REQUEST,
&req->purpose, &req->signature, &req->purpose, &req->signature,
&req->member_pub_key)) &req->member_pub_key))
{ {
@@ -1098,7 +1098,7 @@ check_cadet_message (void *cls,
return GNUNET_SYSERR; return GNUNET_SYSERR;
} }
if (GNUNET_OK != if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (GNUNET_SIGNATURE_PURPOSE_MULTICAST_MESSAGE,
GNUNET_CRYPTO_eddsa_verify_ (GNUNET_SIGNATURE_PURPOSE_MULTICAST_MESSAGE,
&msg->purpose, &msg->signature, &msg->purpose, &msg->signature,
&chn->group_pub_key)) &chn->group_pub_key))
{ {
@@ -1150,7 +1150,7 @@ check_cadet_request (void *cls,
return GNUNET_SYSERR; return GNUNET_SYSERR;
} }
if (GNUNET_OK != if (GNUNET_OK !=
GNUNET_CRYPTO_ecdsa_verify (GNUNET_SIGNATURE_PURPOSE_MULTICAST_REQUEST,
GNUNET_CRYPTO_ecdsa_verify_ (GNUNET_SIGNATURE_PURPOSE_MULTICAST_REQUEST,
&req->purpose, &req->signature, &req->purpose, &req->signature,
&req->member_pub_key)) &req->member_pub_key))
{ {
@@ -1605,7 +1605,7 @@ handle_client_member_join (void *cls,
- sizeof (req->signature)); - sizeof (req->signature));
req->purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_MULTICAST_REQUEST); req->purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_MULTICAST_REQUEST);


if (GNUNET_OK != GNUNET_CRYPTO_ecdsa_sign (&mem->priv_key, &req->purpose,
if (GNUNET_OK != GNUNET_CRYPTO_ecdsa_sign_ (&mem->priv_key, &req->purpose,
&req->signature)) &req->signature))
{ {
/* FIXME: handle error */ /* FIXME: handle error */
@@ -1770,7 +1770,7 @@ handle_client_multicast_message (void *cls,
- sizeof (out->signature)); - sizeof (out->signature));
out->purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_MULTICAST_MESSAGE); out->purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_MULTICAST_MESSAGE);


if (GNUNET_OK != GNUNET_CRYPTO_eddsa_sign (&orig->priv_key, &out->purpose,
if (GNUNET_OK != GNUNET_CRYPTO_eddsa_sign_ (&orig->priv_key, &out->purpose,
&out->signature)) &out->signature))
{ {
GNUNET_assert (0); GNUNET_assert (0);
@@ -1825,7 +1825,7 @@ handle_client_multicast_request (void *cls,
- sizeof (out->signature)); - sizeof (out->signature));
out->purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_MULTICAST_REQUEST); out->purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_MULTICAST_REQUEST);


if (GNUNET_OK != GNUNET_CRYPTO_ecdsa_sign (&mem->priv_key, &out->purpose,
if (GNUNET_OK != GNUNET_CRYPTO_ecdsa_sign_ (&mem->priv_key, &out->purpose,
&out->signature)) &out->signature))
{ {
GNUNET_assert (0); GNUNET_assert (0);


+ 5
- 5
src/multicast/multicast.h View File

@@ -38,6 +38,11 @@ GNUNET_NETWORK_STRUCT_BEGIN
*/ */
struct MulticastJoinRequestMessage struct MulticastJoinRequestMessage
{ {
/**
* Purpose for the signature and size of the signed data.
*/
struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
/** /**
* Type: GNUNET_MESSAGE_TYPE_MULTICAST_JOIN_REQUEST * Type: GNUNET_MESSAGE_TYPE_MULTICAST_JOIN_REQUEST
*/ */
@@ -55,11 +60,6 @@ struct MulticastJoinRequestMessage
*/ */
struct GNUNET_CRYPTO_EcdsaSignature signature; struct GNUNET_CRYPTO_EcdsaSignature signature;


/**
* Purpose for the signature and size of the signed data.
*/
struct GNUNET_CRYPTO_EccSignaturePurpose purpose;

/** /**
* Public key of the target group. * Public key of the target group.
*/ */


+ 3
- 6
src/social/gnunet-service-social.c View File

@@ -1675,12 +1675,9 @@ handle_client_host_enter (void *cls,


if (0 == memcmp (&hreq->place_pub_key, &empty_pub_key, sizeof (empty_pub_key))) if (0 == memcmp (&hreq->place_pub_key, &empty_pub_key, sizeof (empty_pub_key)))
{ // no public key set: create new private key & save the place { // no public key set: create new private key & save the place
struct GNUNET_CRYPTO_EddsaPrivateKey *
place_key = GNUNET_CRYPTO_eddsa_key_create ();
hreq->place_key = *place_key;
GNUNET_CRYPTO_eddsa_key_get_public (place_key, &hreq->place_pub_key);
GNUNET_CRYPTO_eddsa_key_clear (place_key);
GNUNET_free (place_key);
GNUNET_CRYPTO_eddsa_key_create (&hreq->place_key);
GNUNET_CRYPTO_eddsa_key_get_public (&hreq->place_key, &hreq->place_pub_key);
GNUNET_CRYPTO_eddsa_key_clear (&hreq->place_key);


app_place_save (app_id, (const struct PlaceEnterRequest *) hreq); app_place_save (app_id, (const struct PlaceEnterRequest *) hreq);
} }


+ 1
- 1
src/social/gnunet-social.c View File

@@ -1402,7 +1402,7 @@ main (int argc, char *const *argv)


res = GNUNET_PROGRAM_run (argc, argv, help, usage, options, &run, NULL); res = GNUNET_PROGRAM_run (argc, argv, help, usage, options, &run, NULL);


GNUNET_free ((void *) argv);
GNUNET_free_nz ((void *) argv);


if (GNUNET_OK == res) if (GNUNET_OK == res)
return ret; return ret;


Loading…
Cancel
Save