&do_rekey,
NULL);
if (NULL != my_ephemeral_key)
- GNUNET_CRYPTO_ecc_key_free (my_ephemeral_key);
+ GNUNET_free (my_ephemeral_key);
my_ephemeral_key = GNUNET_CRYPTO_ecc_key_create ();
GNUNET_assert (NULL != my_ephemeral_key);
sign_ephemeral_key ();
if (NULL == my_ephemeral_key)
{
GNUNET_break (0);
- GNUNET_CRYPTO_ecc_key_free (my_private_key);
+ GNUNET_free (my_private_key);
my_private_key = NULL;
return GNUNET_SYSERR;
}
if ( (NULL != my_ephemeral_key) &&
(my_ephemeral_key != my_private_key) )
{
- GNUNET_CRYPTO_ecc_key_free (my_ephemeral_key);
+ GNUNET_free (my_ephemeral_key);
my_ephemeral_key = NULL;
}
if (NULL != my_private_key)
{
- GNUNET_CRYPTO_ecc_key_free (my_private_key);
+ GNUNET_free (my_private_key);
my_private_key = NULL;
}
if (NULL != mst)
GNUNET_CRYPTO_hash (&ub_enc->verification_key,
sizeof (ub_enc->verification_key),
&query);
- GNUNET_CRYPTO_ecc_key_free (nsd);
+ GNUNET_free (nsd);
uc = GNUNET_new (struct GNUNET_FS_PublishUblockContext);
uc->cont = cont;
GNUNET_assert (GNUNET_OK ==
GNUNET_CRYPTO_ecc_sign (my_private_key, &ass.purpose,
&uri->data.loc.contentSignature));
- GNUNET_CRYPTO_ecc_key_free (my_private_key);
+ GNUNET_free (my_private_key);
return uri;
}
GNUNET_FS_publish_sks (fs, ns, "this", "next", meta, uri,
&bo, GNUNET_FS_PUBLISH_OPTION_NONE, &sks_cont, NULL);
GNUNET_CONTAINER_meta_data_destroy (meta);
- GNUNET_CRYPTO_ecc_key_free (ns);
+ GNUNET_free (ns);
}
NULL);
GNUNET_FS_uri_destroy (ksk_uri);
GNUNET_CONTAINER_meta_data_destroy (meta);
- GNUNET_CRYPTO_ecc_key_free (ns);
+ GNUNET_free (ns);
}
if (uri_next != NULL)
GNUNET_FS_uri_destroy (uri_next);
if (ns != NULL)
- GNUNET_CRYPTO_ecc_key_free (ns);
+ GNUNET_free (ns);
if (meta != NULL)
GNUNET_CONTAINER_meta_data_destroy (meta);
}
ph = GNUNET_CRYPTO_ecc_key_create ();
GNUNET_CRYPTO_ecc_key_get_public (ph, pseu);
- GNUNET_CRYPTO_ecc_key_free (ph);
+ GNUNET_free (ph);
}
GNUNET_CRYPTO_hash_to_enc (&user_zone, &zonename);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Using zone: %s!\n", &zonename);
- GNUNET_CRYPTO_ecc_key_free(key);
+ GNUNET_free(key);
}
GNUNET_free(keyfile);
}
GNUNET_CRYPTO_short_hash_to_enc (zone, &zonename);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Using zone: %s!\n", &zonename);
- GNUNET_CRYPTO_ecc_key_free(key);
+ GNUNET_free(key);
GNUNET_free(keyfile);
keyfile = NULL;
GNUNET_CRYPTO_short_hash_to_enc (zone, &zonename);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Using private zone: %s!\n", &zonename);
- GNUNET_CRYPTO_ecc_key_free(key);
+ GNUNET_free(key);
GNUNET_free(keyfile);
}
keyfile = NULL;
GNUNET_CRYPTO_short_hash_to_enc (zone, &zonename);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Using shorten zone: %s!\n", &zonename);
- GNUNET_CRYPTO_ecc_key_free(key);
+ GNUNET_free(key);
GNUNET_free(keyfile);
}
/* FIXME: use identity service and/or allow user to specify public key! */
key = GNUNET_CRYPTO_ecc_key_create_from_file (keyfile);
GNUNET_CRYPTO_ecc_key_get_public (key, &pkey);
- GNUNET_CRYPTO_ecc_key_free (key);
+ GNUNET_free (key);
GNUNET_free (keyfile);
if (GNUNET_OK !=
return;
}
if (NULL != shorten_key)
- GNUNET_CRYPTO_ecc_key_free (shorten_key);
+ GNUNET_free (shorten_key);
GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
&do_shutdown, NULL);
}
1, &rd,
&commence_testing,
NULL);
- GNUNET_CRYPTO_ecc_key_free(alice_key);
- GNUNET_CRYPTO_ecc_key_free(bob_key);
+ GNUNET_free(alice_key);
+ GNUNET_free(bob_key);
}
if (NULL == nh[0])
{
GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Failed to connect to namestore\n");
- GNUNET_CRYPTO_ecc_key_free (key);
+ GNUNET_free (key);
GNUNET_free (keyfile);
return GNUNET_SYSERR;
}
1, &rd,
&cont_ns, nh[0]);
- GNUNET_CRYPTO_ecc_key_free(key);
+ GNUNET_free(key);
GNUNET_free(keyfile);
GNUNET_free(web);
dave_is_setup = GNUNET_YES;
if (NULL == nh[1])
{
GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Failed to connect to namestore\n");
- GNUNET_CRYPTO_ecc_key_free (key);
+ GNUNET_free (key);
GNUNET_free (keyfile);
return GNUNET_SYSERR;
}
1, &rd,
&cont_ns, nh[1]);
- GNUNET_CRYPTO_ecc_key_free(key);
+ GNUNET_free(key);
GNUNET_free(keyfile);
bob_is_setup = GNUNET_YES;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Setting up bob done\n");
if (NULL == nh[2])
{
GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Failed to connect to namestore\n");
- GNUNET_CRYPTO_ecc_key_free (key);
+ GNUNET_free (key);
GNUNET_free (keyfile);
return GNUNET_SYSERR;
}
if (NULL == gh)
{
GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Failed to connect to gns\n");
- GNUNET_CRYPTO_ecc_key_free (key);
+ GNUNET_free (key);
GNUNET_free (keyfile);
return GNUNET_SYSERR;
}
- GNUNET_CRYPTO_ecc_key_free (key);
+ GNUNET_free (key);
GNUNET_free (keyfile);
alice_is_setup = GNUNET_YES;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Setting up alice done\n");
&commence_testing,
NULL);
- GNUNET_CRYPTO_ecc_key_free(alice_key);
- GNUNET_CRYPTO_ecc_key_free(bob_key);
+ GNUNET_free(alice_key);
+ GNUNET_free(bob_key);
GNUNET_free(web);
}
}
if (NULL != alice_key)
{
- GNUNET_CRYPTO_ecc_key_free (alice_key);
+ GNUNET_free (alice_key);
alice_key = NULL;
}
GNUNET_break (0);
}
if (NULL != alice_key)
{
- GNUNET_CRYPTO_ecc_key_free (alice_key);
+ GNUNET_free (alice_key);
alice_key = NULL;
}
GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Shutting down peer!\n");
GNUNET_free ((void**)rd.data);
GNUNET_free (zone_keyfile);
- GNUNET_CRYPTO_ecc_key_free (host_key);
+ GNUNET_free (host_key);
}
int
static void
commence_testing (void *cls, int success)
{
- GNUNET_CRYPTO_ecc_key_free(our_key);
- GNUNET_CRYPTO_ecc_key_free(bob_key);
- GNUNET_CRYPTO_ecc_key_free(alice_key);
+ GNUNET_free(our_key);
+ GNUNET_free(bob_key);
+ GNUNET_free(alice_key);
GNUNET_NAMESTORE_disconnect (namestore_handle);
namestore_handle = NULL;
gns_handle = GNUNET_GNS_connect(cfg);
{
GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Record serialization failed!\n");
ok = 3;
- GNUNET_CRYPTO_ecc_key_free(our_key);
- GNUNET_CRYPTO_ecc_key_free(bob_key);
- GNUNET_CRYPTO_ecc_key_free(alice_key);
+ GNUNET_free(our_key);
+ GNUNET_free(bob_key);
+ GNUNET_free(alice_key);
GNUNET_free(sig);
GNUNET_free (nrb);
end_badly_now ();
{
GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Record serialization failed!\n");
ok = 3;
- GNUNET_CRYPTO_ecc_key_free(our_key);
- GNUNET_CRYPTO_ecc_key_free(bob_key);
- GNUNET_CRYPTO_ecc_key_free(alice_key);
+ GNUNET_free(our_key);
+ GNUNET_free(bob_key);
+ GNUNET_free(alice_key);
GNUNET_free (sig);
GNUNET_free(web);
GNUNET_free (nrb);
GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Record serialization failed!\n");
ok = 3;
- GNUNET_CRYPTO_ecc_key_free (our_key);
- GNUNET_CRYPTO_ecc_key_free (bob_key);
- GNUNET_CRYPTO_ecc_key_free (alice_key);
+ GNUNET_free (our_key);
+ GNUNET_free (bob_key);
+ GNUNET_free (alice_key);
GNUNET_free (sig);
GNUNET_free (nrb);
end_badly_now ();
GNUNET_free (alice_keyfile);
GNUNET_free (web);
GNUNET_free (sig);
- GNUNET_CRYPTO_ecc_key_free (bob_key);
- GNUNET_CRYPTO_ecc_key_free (alice_key);
+ GNUNET_free (bob_key);
+ GNUNET_free (alice_key);
}
NULL);
GNUNET_free (sig);
GNUNET_free (alice_keyfile);
- GNUNET_CRYPTO_ecc_key_free (bob_key);
- GNUNET_CRYPTO_ecc_key_free (alice_key);
+ GNUNET_free (bob_key);
+ GNUNET_free (alice_key);
}
1, &rd,
&commence_testing,
NULL);
- GNUNET_CRYPTO_ecc_key_free (alice_key);
+ GNUNET_free (alice_key);
}
GNUNET_free (mx_record);
GNUNET_free (mail);
GNUNET_free (sig);
- GNUNET_CRYPTO_ecc_key_free (bob_key);
- GNUNET_CRYPTO_ecc_key_free (alice_key);
+ GNUNET_free (bob_key);
+ GNUNET_free (alice_key);
}
NULL);
GNUNET_free(web);
- GNUNET_CRYPTO_ecc_key_free(our_key);
- GNUNET_CRYPTO_ecc_key_free(bob_key);
- GNUNET_CRYPTO_ecc_key_free(alice_key);
- GNUNET_CRYPTO_ecc_key_free(priv_key);
- GNUNET_CRYPTO_ecc_key_free(short_key);
+ GNUNET_free(our_key);
+ GNUNET_free(bob_key);
+ GNUNET_free(alice_key);
+ GNUNET_free(priv_key);
+ GNUNET_free(short_key);
}
GNUNET_free (srv_data);
GNUNET_free (sipserver);
GNUNET_free (sig);
- GNUNET_CRYPTO_ecc_key_free (bob_key);
- GNUNET_CRYPTO_ecc_key_free (alice_key);
+ GNUNET_free (bob_key);
+ GNUNET_free (alice_key);
}
GNUNET_free (alice_keyfile);
GNUNET_free (web);
GNUNET_free (sig);
- GNUNET_CRYPTO_ecc_key_free (bob_key);
- GNUNET_CRYPTO_ecc_key_free (alice_key);
+ GNUNET_free (bob_key);
+ GNUNET_free (alice_key);
}
while (NULL != (e = ego_head))
{
GNUNET_CONTAINER_DLL_remove (ego_head, ego_tail, e);
- GNUNET_CRYPTO_ecc_key_free (e->pk);
+ GNUNET_free (e->pk);
GNUNET_free (e);
}
}
GNUNET_free (ego->identifier);
ego->identifier = NULL;
notify_listeners (ego);
- GNUNET_CRYPTO_ecc_key_free (ego->pk);
+ GNUNET_free (ego->pk);
GNUNET_free (ego);
send_result_code (client, 0, NULL);
GNUNET_SERVER_receive_done (client, GNUNET_OK);
GNUNET_CONTAINER_multihashmap_remove (h->egos,
&ego->id,
ego));
- GNUNET_CRYPTO_ecc_key_free (ego->pk);
+ GNUNET_free (ego->pk);
GNUNET_free (ego->name);
GNUNET_free (ego);
}
if (slen >= GNUNET_SERVER_MAX_MESSAGE_SIZE - sizeof (struct GNUNET_IDENTITY_CreateRequestMessage))
{
GNUNET_break (0);
- GNUNET_CRYPTO_ecc_key_free (pk);
+ GNUNET_free (pk);
return NULL;
}
op = GNUNET_malloc (sizeof (struct GNUNET_IDENTITY_Operation) +
op);
if (NULL == id->th)
transmit_next (id);
- GNUNET_CRYPTO_ecc_key_free (pk);
+ GNUNET_free (pk);
return op;
}
ego,
&ego->ctx,
NULL);
- GNUNET_CRYPTO_ecc_key_free (ego->pk);
+ GNUNET_free (ego->pk);
GNUNET_free (ego->name);
GNUNET_free (ego);
return GNUNET_OK;
const char *emsg);
-/**
- * @ingroup crypto
- * Free memory occupied by ECC key
- *
- * @param priv pointer to the memory to free
- */
-void
-GNUNET_CRYPTO_ecc_key_free (struct GNUNET_CRYPTO_EccPrivateKey *priv);
-
-
/**
* @ingroup crypto
* Extract the public key for the given private key.
*
* @param filename name of file to use to store the key
* @return new private key, NULL on error (for example,
- * permission denied)
+ * permission denied); free using #GNUNET_free
*/
struct GNUNET_CRYPTO_EccPrivateKey *
GNUNET_CRYPTO_ecc_key_create_from_file (const char *filename);
* the file specified in the configuration.
*
* @return new private key, NULL on error (for example,
- * permission denied)
+ * permission denied); free using #GNUNET_free
*/
struct GNUNET_CRYPTO_EccPrivateKey *
GNUNET_CRYPTO_ecc_key_create_from_configuration (const struct GNUNET_CONFIGURATION_Handle *cfg);
* @ingroup crypto
* Create a new private key. Caller must free return value.
*
- * @return fresh private key
+ * @return fresh private key; free using #GNUNET_free
*/
struct GNUNET_CRYPTO_EccPrivateKey *
GNUNET_CRYPTO_ecc_key_create (void);
* @ingroup crypto
* Get the shared private key we use for anonymous users.
*
- * @return "anonymous" private key
+ * @return "anonymous" private key; do not free
*/
const struct GNUNET_CRYPTO_EccPrivateKey *
GNUNET_CRYPTO_ecc_key_get_anonymous (void);
}
if (NULL != fcfs_zone_pkey)
{
- GNUNET_CRYPTO_ecc_key_free (fcfs_zone_pkey);
+ GNUNET_free (fcfs_zone_pkey);
fcfs_zone_pkey = NULL;
}
}
}
if (NULL != privkey)
{
- GNUNET_CRYPTO_ecc_key_free (privkey);
+ GNUNET_free (privkey);
privkey = NULL;
}
GNUNET_SCHEDULER_shutdown ();
GNUNET_NAMESTORE_disconnect (nsh);
nsh = NULL;
if (privkey != NULL)
- GNUNET_CRYPTO_ecc_key_free (privkey);
+ GNUNET_free (privkey);
privkey = NULL;
GNUNET_free_non_null (s_name);
res = 1;
GNUNET_free_non_null (s_second_record);
GNUNET_free_non_null (s_name);
if (privkey != NULL)
- GNUNET_CRYPTO_ecc_key_free (privkey);
+ GNUNET_free (privkey);
privkey = NULL;
if (nsh != NULL)
GNUNET_NAMESTORE_disconnect (nsh);
GNUNET_NAMESTORE_disconnect (nsh);
nsh = NULL;
if (privkey != NULL)
- GNUNET_CRYPTO_ecc_key_free (privkey);
+ GNUNET_free (privkey);
privkey = NULL;
GNUNET_free_non_null (s_name);
res = 1;
GNUNET_free (s_first_record);
GNUNET_free_non_null (s_second_record);
if (privkey != NULL)
- GNUNET_CRYPTO_ecc_key_free (privkey);
+ GNUNET_free (privkey);
privkey = NULL;
if (nsh != NULL)
GNUNET_NAMESTORE_disconnect (nsh);
}
if (NULL != privkey)
{
- GNUNET_CRYPTO_ecc_key_free (privkey);
+ GNUNET_free (privkey);
privkey = NULL;
}
GNUNET_SCHEDULER_shutdown ();
GNUNET_NAMESTORE_disconnect (nsh);
nsh = NULL;
if (privkey != NULL)
- GNUNET_CRYPTO_ecc_key_free (privkey);
+ GNUNET_free (privkey);
privkey = NULL;
GNUNET_free_non_null (s_name);
res = 1;
GNUNET_free (s_rd);
GNUNET_free_non_null (s_name);
if (privkey != NULL)
- GNUNET_CRYPTO_ecc_key_free (privkey);
+ GNUNET_free (privkey);
privkey = NULL;
if (nsh != NULL)
GNUNET_NAMESTORE_disconnect (nsh);
if (NULL != privkey)
{
- GNUNET_CRYPTO_ecc_key_free (privkey);
+ GNUNET_free (privkey);
privkey = NULL;
}
if (NULL != privkey2)
{
- GNUNET_CRYPTO_ecc_key_free (privkey2);
+ GNUNET_free (privkey2);
privkey2 = NULL;
}
}
if (privkey != NULL)
{
- GNUNET_CRYPTO_ecc_key_free (privkey);
+ GNUNET_free (privkey);
privkey = NULL;
}
GNUNET_SCHEDULER_shutdown ();
if (privkey != NULL)
{
- GNUNET_CRYPTO_ecc_key_free (privkey);
+ GNUNET_free (privkey);
privkey = NULL;
}
if (nsh != NULL)
GNUNET_NAMESTORE_disconnect (nsh);
nsh = NULL;
if (privkey != NULL)
- GNUNET_CRYPTO_ecc_key_free (privkey);
+ GNUNET_free (privkey);
privkey = NULL;
GNUNET_free_non_null (s_name);
res = 1;
GNUNET_free_non_null((void *) s_rd[c].data);
GNUNET_free (s_rd);
if (privkey != NULL)
- GNUNET_CRYPTO_ecc_key_free (privkey);
+ GNUNET_free (privkey);
privkey = NULL;
if (nsh != NULL)
GNUNET_NAMESTORE_disconnect (nsh);
GNUNET_NAMESTORE_disconnect (nsh);
nsh = NULL;
if (privkey != NULL)
- GNUNET_CRYPTO_ecc_key_free (privkey);
+ GNUNET_free (privkey);
privkey = NULL;
GNUNET_free_non_null (s_name);
res = 1;
GNUNET_free (s_rd);
if (privkey != NULL)
- GNUNET_CRYPTO_ecc_key_free (privkey);
+ GNUNET_free (privkey);
privkey = NULL;
if (nsh != NULL)
GNUNET_NAMESTORE_disconnect (nsh);
}
if (privkey != NULL)
- GNUNET_CRYPTO_ecc_key_free (privkey);
+ GNUNET_free (privkey);
privkey = NULL;
if (privkey2 != NULL)
- GNUNET_CRYPTO_ecc_key_free (privkey2);
+ GNUNET_free (privkey2);
privkey2 = NULL;
res = 1;
}
}
if (privkey != NULL)
- GNUNET_CRYPTO_ecc_key_free (privkey);
+ GNUNET_free (privkey);
privkey = NULL;
if (privkey2 != NULL)
- GNUNET_CRYPTO_ecc_key_free (privkey2);
+ GNUNET_free (privkey2);
privkey2 = NULL;
GNUNET_free (sig_1);
}
if (privkey != NULL)
- GNUNET_CRYPTO_ecc_key_free (privkey);
+ GNUNET_free (privkey);
privkey = NULL;
if (privkey2 != NULL)
- GNUNET_CRYPTO_ecc_key_free (privkey2);
+ GNUNET_free (privkey2);
privkey2 = NULL;
res = 1;
}
endbadly_task = GNUNET_SCHEDULER_NO_TASK;
}
if (privkey != NULL)
- GNUNET_CRYPTO_ecc_key_free (privkey);
+ GNUNET_free (privkey);
privkey = NULL;
if (privkey2 != NULL)
- GNUNET_CRYPTO_ecc_key_free (privkey2);
+ GNUNET_free (privkey2);
privkey2 = NULL;
GNUNET_free (sig_1);
GNUNET_free (s_rd_3);
}
if (privkey != NULL)
- GNUNET_CRYPTO_ecc_key_free (privkey);
+ GNUNET_free (privkey);
privkey = NULL;
if (privkey2 != NULL)
- GNUNET_CRYPTO_ecc_key_free (privkey2);
+ GNUNET_free (privkey2);
privkey2 = NULL;
res = 1;
}
endbadly_task = GNUNET_SCHEDULER_NO_TASK;
}
if (privkey != NULL)
- GNUNET_CRYPTO_ecc_key_free (privkey);
+ GNUNET_free (privkey);
privkey = NULL;
if (privkey2 != NULL)
- GNUNET_CRYPTO_ecc_key_free (privkey2);
+ GNUNET_free (privkey2);
privkey2 = NULL;
GNUNET_free (sig_1);
GNUNET_NAMESTORE_disconnect (nsh);
nsh = NULL;
if (privkey != NULL)
- GNUNET_CRYPTO_ecc_key_free (privkey);
+ GNUNET_free (privkey);
privkey = NULL;
res = 1;
}
endbadly_task = GNUNET_SCHEDULER_NO_TASK;
}
if (privkey != NULL)
- GNUNET_CRYPTO_ecc_key_free (privkey);
+ GNUNET_free (privkey);
privkey = NULL;
if (nsh != NULL)
GNUNET_NAMESTORE_disconnect (nsh);
}
if (NULL != my_private_key)
{
- GNUNET_CRYPTO_ecc_key_free (my_private_key);
+ GNUNET_free (my_private_key);
my_private_key = NULL;
}
#if ENABLE_NSE_HISTOGRAM
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
_
("NSE service is lacking key configuration settings. Exiting.\n"));
- GNUNET_CRYPTO_ecc_key_free (my_private_key);
+ GNUNET_free (my_private_key);
my_private_key = NULL;
GNUNET_SCHEDULER_shutdown ();
return;
}
GNUNET_free (fn);
GNUNET_CRYPTO_ecc_key_get_public (priv, &my_public_key);
- GNUNET_CRYPTO_ecc_key_free (priv);
+ GNUNET_free (priv);
GNUNET_CRYPTO_hash (&my_public_key, sizeof (my_public_key), &my_peer_identity.hashPubKey);
}
GNUNET_free ((void**)rd.data);
GNUNET_free (rd_string);
GNUNET_free (zone_keyfile);
- GNUNET_CRYPTO_ecc_key_free (host_key);
+ GNUNET_free (host_key);
}
GNUNET_DHT_disconnect (dht_handle);
dht_handle = NULL;
}
- GNUNET_CRYPTO_ecc_key_free (my_private_key);
+ GNUNET_free (my_private_key);
my_private_key = NULL;
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
stats = NULL;
GNUNET_SERVER_notification_context_destroy (nc);
nc = NULL;
- GNUNET_CRYPTO_ecc_key_free (my_private_key);
+ GNUNET_free (my_private_key);
my_private_key = NULL;
}
dht = GNUNET_DHT_connect (cfg, 1024);
if (NULL == dht)
{
- GNUNET_CRYPTO_ecc_key_free (my_private_key);
+ GNUNET_free (my_private_key);
my_private_key = NULL;
GNUNET_SCHEDULER_shutdown ();
return;
GNUNET_assert (GNUNET_OK == GNUNET_DISK_file_close (fd));
GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "transport-testing",
"Wrote hostkey to file: `%s'\n", create_hostkey);
- GNUNET_CRYPTO_ecc_key_free (pk);
+ GNUNET_free (pk);
GNUNET_TESTING_system_destroy (system, GNUNET_YES);
return 0;
}
goto err_ret;
}
if (NULL != pk)
- GNUNET_CRYPTO_ecc_key_free (pk);
+ GNUNET_free (pk);
if (GNUNET_NO ==
GNUNET_CONFIGURATION_have_value (cfg, "PEER", "PRIVATE_KEY"))
{
return;
}
peer->id = GNUNET_malloc (sizeof (struct GNUNET_PeerIdentity));
- GNUNET_CRYPTO_ecc_key_free (GNUNET_TESTING_hostkey_get (peer->system,
+ GNUNET_free (GNUNET_TESTING_hostkey_get (peer->system,
peer->key_number,
peer->id));
memcpy (id, peer->id, sizeof (struct GNUNET_PeerIdentity));
}
if (NULL != GST_my_private_key)
{
- GNUNET_CRYPTO_ecc_key_free (GST_my_private_key);
+ GNUNET_free (GST_my_private_key);
GST_my_private_key = NULL;
}
GST_server = NULL;
#define LOG_GCRY(level, cmd, rc) do { LOG(level, _("`%s' failed at %s:%d with error: %s\n"), cmd, __FILE__, __LINE__, gcry_strerror(rc)); } while(0);
-/**
- * Free memory occupied by ECC key
- *
- * @param priv pointer to the memory to free
- */
-void
-GNUNET_CRYPTO_ecc_key_free (struct GNUNET_CRYPTO_EccPrivateKey *priv)
-{
- GNUNET_free (priv);
-}
-
-
/**
* Extract values from an S-expression.
*
(void) GNUNET_CONFIGURATION_load (cfg, cfg_name);
priv = GNUNET_CRYPTO_ecc_key_create_from_configuration (cfg);
if (NULL != priv)
- GNUNET_CRYPTO_ecc_key_free (priv);
+ GNUNET_free (priv);
GNUNET_CONFIGURATION_destroy (cfg);
}
return GNUNET_SYSERR;
}
GNUNET_CRYPTO_ecc_key_get_public (priv, &pub);
- GNUNET_CRYPTO_ecc_key_free (priv);
+ GNUNET_free (priv);
GNUNET_CRYPTO_hash (&pub, sizeof (pub), &dst->hashPubKey);
return GNUNET_OK;
}
_("\nFailed to write to `%s': %s\n"),
fn,
STRERROR (errno));
- GNUNET_CRYPTO_ecc_key_free (pk);
+ GNUNET_free (pk);
break;
}
- GNUNET_CRYPTO_ecc_key_free (pk);
+ GNUNET_free (pk);
}
if (UINT_MAX == make_keys)
fprintf (stderr,
GNUNET_CRYPTO_hash_to_enc (&pid.hashPubKey, &enc);
fprintf (stdout, "%s\n", enc.encoding);
}
- GNUNET_CRYPTO_ecc_key_free (pk);
+ GNUNET_free (pk);
}
if (GNUNET_SYSERR == GNUNET_CRYPTO_ecc_sign (dpriv, &purp, &sig))
{
FPRINTF (stderr, "%s", "GNUNET_CRYPTO_ecc_sign returned SYSERR\n");
- GNUNET_CRYPTO_ecc_key_free (dpriv);
+ GNUNET_free (dpriv);
return GNUNET_SYSERR;
}
if (GNUNET_SYSERR ==
&dpub))
{
printf ("GNUNET_CRYPTO_ecc_verify failed!\n");
- GNUNET_CRYPTO_ecc_key_free (dpriv);
+ GNUNET_free (dpriv);
return GNUNET_SYSERR;
}
if (GNUNET_SYSERR !=
&pkey))
{
printf ("GNUNET_CRYPTO_ecc_verify failed to fail!\n");
- GNUNET_CRYPTO_ecc_key_free (dpriv);
+ GNUNET_free (dpriv);
return GNUNET_SYSERR;
}
if (GNUNET_SYSERR !=
&purp, &sig, &dpub))
{
printf ("GNUNET_CRYPTO_ecc_verify failed to fail!\n");
- GNUNET_CRYPTO_ecc_key_free (dpriv);
+ GNUNET_free (dpriv);
return GNUNET_SYSERR;
}
- GNUNET_CRYPTO_ecc_key_free (dpriv);
+ GNUNET_free (dpriv);
return GNUNET_OK;
}
key = GNUNET_CRYPTO_ecc_key_create_from_file (KEYFILE);
GNUNET_assert (NULL != key);
GNUNET_CRYPTO_ecc_key_get_public (key, &p1);
- GNUNET_CRYPTO_ecc_key_free (key);
+ GNUNET_free (key);
key = GNUNET_CRYPTO_ecc_key_create_from_file (KEYFILE);
GNUNET_assert (NULL != key);
GNUNET_CRYPTO_ecc_key_get_public (key, &p2);
GNUNET_assert (0 == memcmp (&p1, &p2, sizeof (p1)));
- GNUNET_CRYPTO_ecc_key_free (key);
+ GNUNET_free (key);
GNUNET_assert (0 == UNLINK (KEYFILE));
key = GNUNET_CRYPTO_ecc_key_create_from_file (KEYFILE);
GNUNET_assert (NULL != key);
GNUNET_CRYPTO_ecc_key_get_public (key, &p2);
GNUNET_assert (0 != memcmp (&p1, &p2, sizeof (p1)));
- GNUNET_CRYPTO_ecc_key_free (key);
+ GNUNET_free (key);
return GNUNET_OK;
}
GNUNET_CRYPTO_ecc_ecdh (priv2, &pub1, &ecdh2);
GNUNET_assert (0 == memcmp (&ecdh1, &ecdh2,
sizeof (struct GNUNET_HashCode)));
- GNUNET_CRYPTO_ecc_key_free (priv1);
- GNUNET_CRYPTO_ecc_key_free (priv2);
+ GNUNET_free (priv1);
+ GNUNET_free (priv2);
}
{
fprintf (stderr, ".");
pk = GNUNET_CRYPTO_ecc_key_create ();
- GNUNET_CRYPTO_ecc_key_free (pk);
+ GNUNET_free (pk);
}
fprintf (stderr, "\n");
printf ("Creating 10 ECC keys took %s\n",
#endif
if (GNUNET_OK != testSignVerify ())
failure_count++;
- GNUNET_CRYPTO_ecc_key_free (key);
+ GNUNET_free (key);
if (GNUNET_OK != testCreateFromFile ())
failure_count++;
GNUNET_assert (0 == UNLINK (KEYFILE));