[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnunet-gtk] branch master updated: fix key usage
From: |
gnunet |
Subject: |
[gnunet-gtk] branch master updated: fix key usage |
Date: |
Tue, 20 Oct 2020 13:20:10 +0200 |
This is an automated email from the git hooks/post-receive script.
dennis-neufeld pushed a commit to branch master
in repository gnunet-gtk.
The following commit(s) were added to refs/heads/master by this push:
new 62cfdab1 fix key usage
62cfdab1 is described below
commit 62cfdab1c0e5849b2bf4ca3c3f05afe27a5cc9de
Author: Dennis Neufeld <dennis.neufeld@students.bfh.ch>
AuthorDate: Tue Oct 20 13:05:33 2020 +0200
fix key usage
---
.../gnunet-conversation-gtk_contacts.c | 4 ++--
src/conversation/gnunet-conversation-gtk_egos.c | 6 ++---
.../gnunet-conversation-gtk_get_label.c | 4 ++--
src/conversation/gnunet-conversation-gtk_import.c | 12 +++++-----
src/conversation/gnunet-conversation-gtk_phone.c | 6 ++---
src/fs/gnunet-fs-gtk.c | 4 ++--
src/fs/gnunet-fs-gtk.h | 4 ++--
src/fs/gnunet-fs-gtk_common.c | 2 +-
src/fs/gnunet-fs-gtk_main-window-search.c | 12 +++++-----
src/fs/gnunet-fs-gtk_publish-dialog.c | 2 +-
src/namestore/gnunet-namestore-gtk.c | 27 +++++++++++++---------
src/namestore/plugin_gtk_namestore_phone.c | 2 +-
src/namestore/plugin_gtk_namestore_pkey.c | 2 +-
13 files changed, 46 insertions(+), 41 deletions(-)
diff --git a/src/conversation/gnunet-conversation-gtk_contacts.c
b/src/conversation/gnunet-conversation-gtk_contacts.c
index 28951dcb..c823373d 100644
--- a/src/conversation/gnunet-conversation-gtk_contacts.c
+++ b/src/conversation/gnunet-conversation-gtk_contacts.c
@@ -156,7 +156,7 @@
gnunet_conversation_gtk_contact_list_treeview_row_activated_cb (
*/
static void
display_record (void *cls,
- const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone_key,
+ const struct GNUNET_IDENTITY_PrivateKey *zone_key,
const char *rname,
unsigned int rd_len,
const struct GNUNET_GNSRECORD_Data *rd)
@@ -311,7 +311,7 @@ gnunet_conversation_gtk_contacts_zone_combobox_changed_cb
(GtkComboBox *widget,
gpointer user_data)
{
struct GNUNET_IDENTITY_Ego *ego;
- const struct GNUNET_CRYPTO_EcdsaPrivateKey *temp_zone_pkey;
+ const struct GNUNET_IDENTITY_PrivateKey *temp_zone_pkey;
const char *tld;
if (NULL != zone_mon)
diff --git a/src/conversation/gnunet-conversation-gtk_egos.c
b/src/conversation/gnunet-conversation-gtk_egos.c
index 08801ced..91ed2de7 100644
--- a/src/conversation/gnunet-conversation-gtk_egos.c
+++ b/src/conversation/gnunet-conversation-gtk_egos.c
@@ -171,8 +171,8 @@ gnunet_conversation_gtk_ego_copy_button_clicked_cb
(GtkButton *button,
{
struct GNUNET_IDENTITY_Ego *ego;
const gchar *label;
- const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv;
- struct GNUNET_CRYPTO_EcdsaPublicKey pub;
+ const struct GNUNET_IDENTITY_PrivateKey *priv;
+ struct GNUNET_IDENTITY_PublicKey pub;
const char *zkey;
char *uri;
GtkClipboard *cb;
@@ -183,7 +183,7 @@ gnunet_conversation_gtk_ego_copy_button_clicked_cb
(GtkButton *button,
ego = GCG_EGOS_get_selected_ego ();
GNUNET_break (NULL != ego);
priv = GNUNET_IDENTITY_ego_get_private_key (ego);
- GNUNET_CRYPTO_ecdsa_key_get_public (priv, &pub);
+ GNUNET_IDENTITY_ego_get_public_key (priv, &pub);
zkey = GNUNET_GNSRECORD_pkey_to_zkey (&pub);
GNUNET_asprintf (&uri, "gnunet://gns/%s.%s/", label, zkey);
cb = gtk_clipboard_get (GDK_SELECTION_CLIPBOARD);
diff --git a/src/conversation/gnunet-conversation-gtk_get_label.c
b/src/conversation/gnunet-conversation-gtk_get_label.c
index 0a2baea0..05825a5c 100644
--- a/src/conversation/gnunet-conversation-gtk_get_label.c
+++ b/src/conversation/gnunet-conversation-gtk_get_label.c
@@ -66,7 +66,7 @@ handle_error (void *cls)
*/
static void
handle_existing_records (void *cls,
- const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone,
+ const struct GNUNET_IDENTITY_PrivateKey *zone,
const char *label,
unsigned int rd_count,
const struct GNUNET_GNSRECORD_Data *rd)
@@ -104,7 +104,7 @@ gnunet_conversation_gtk_enter_label_entry_changed_cb
(GtkEditable *editable,
const gchar *label;
GtkWidget *b_add;
struct GNUNET_IDENTITY_Ego *ego;
- const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey;
+ const struct GNUNET_IDENTITY_PrivateKey *pkey;
const char *tld;
if (NULL != qe)
diff --git a/src/conversation/gnunet-conversation-gtk_import.c
b/src/conversation/gnunet-conversation-gtk_import.c
index 63e735eb..5f72df04 100644
--- a/src/conversation/gnunet-conversation-gtk_import.c
+++ b/src/conversation/gnunet-conversation-gtk_import.c
@@ -71,7 +71,7 @@ static char *phone_label;
/**
* Current private key for the phone entry's zone.
*/
-static struct GNUNET_CRYPTO_EcdsaPrivateKey zone_pkey;
+static struct GNUNET_IDENTITY_PrivateKey zone_pkey;
/**
* Our current phone record.
@@ -124,11 +124,11 @@ void
GSC_add_contact (const gchar *name, const gchar *address)
{
struct GNUNET_GNSRECORD_Data rd;
- struct GNUNET_CRYPTO_EcdsaPublicKey rvalue;
+ struct GNUNET_IDENTITY_PublicKey rvalue;
const void *value;
struct GNUNET_IDENTITY_Ego *ego;
size_t value_size;
- const struct GNUNET_CRYPTO_EcdsaPrivateKey *zkey;
+ const struct GNUNET_IDENTITY_PrivateKey *zkey;
uint32_t type;
char cname[256];
const char *tld;
@@ -154,7 +154,7 @@ GSC_add_contact (const gchar *name, const gchar *address)
{
type = GNUNET_GNSRECORD_TYPE_PKEY;
value = &rvalue;
- value_size = sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey);
+ value_size = sizeof (struct GNUNET_IDENTITY_PublicKey);
}
else
{
@@ -225,7 +225,7 @@ add_phone_continuation (void *cls, int32_t success, const
char *emsg)
static void
add_phone_handle_existing_records (
void *cls,
- const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone,
+ const struct GNUNET_IDENTITY_PrivateKey *zone,
const char *label,
unsigned int rd_count,
const struct GNUNET_GNSRECORD_Data *rd)
@@ -385,7 +385,7 @@ remove_phone_continuation (void *cls, int32_t success,
const char *emsg)
static void
remove_phone_handle_existing_records (
void *cls,
- const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone,
+ const struct GNUNET_IDENTITY_PrivateKey *zone,
const char *label,
unsigned int rd_count,
const struct GNUNET_GNSRECORD_Data *rd)
diff --git a/src/conversation/gnunet-conversation-gtk_phone.c
b/src/conversation/gnunet-conversation-gtk_phone.c
index d3097cd1..552acc55 100644
--- a/src/conversation/gnunet-conversation-gtk_phone.c
+++ b/src/conversation/gnunet-conversation-gtk_phone.c
@@ -199,7 +199,7 @@ struct IncomingCall
/**
* Public key identifying the caller.
*/
- struct GNUNET_CRYPTO_EcdsaPublicKey caller_id;
+ struct GNUNET_IDENTITY_PublicKey caller_id;
/**
* Caller ID as human-readable string.
@@ -849,7 +849,7 @@ set_incoming_call_state (struct IncomingCall *ic, enum
InCallState state)
*/
static void
handle_reverse_lookup_result (void *cls,
- const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone,
+ const struct GNUNET_IDENTITY_PrivateKey *zone,
const char *label,
unsigned int rd_count,
const struct GNUNET_GNSRECORD_Data *rd)
@@ -887,7 +887,7 @@ static void
phone_event_handler (void *cls,
enum GNUNET_CONVERSATION_PhoneEventCode code,
struct GNUNET_CONVERSATION_Caller *caller,
- const struct GNUNET_CRYPTO_EcdsaPublicKey *caller_id)
+ const struct GNUNET_IDENTITY_PublicKey *caller_id)
{
GtkTreeIter iter;
gboolean valid;
diff --git a/src/fs/gnunet-fs-gtk.c b/src/fs/gnunet-fs-gtk.c
index fecb84e1..c4cf18af 100644
--- a/src/fs/gnunet-fs-gtk.c
+++ b/src/fs/gnunet-fs-gtk.c
@@ -596,7 +596,7 @@ monitor_zone_sync (void *cls)
*/
static void
monitor_zone_records (void *cls,
- const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone,
+ const struct GNUNET_IDENTITY_PrivateKey *zone,
const char *label,
unsigned int rd_count,
const struct GNUNET_GNSRECORD_Data *rd)
@@ -663,7 +663,7 @@ handle_sks_zone_identity (void *cls,
"No default ego specified for `fs-sks` service, will not enable
namespace search.\n"));
return;
}
- main_context.sks_zone = GNUNET_new (struct GNUNET_CRYPTO_EcdsaPrivateKey);
+ main_context.sks_zone = GNUNET_new (struct GNUNET_IDENTITY_PrivateKey);
*main_context.sks_zone = *GNUNET_IDENTITY_ego_get_private_key (ego);
gtk_widget_show (GTK_WIDGET (GNUNET_FS_GTK_get_main_window_object (
"main_window_search_namespace_label")));
diff --git a/src/fs/gnunet-fs-gtk.h b/src/fs/gnunet-fs-gtk.h
index e968efc7..690e36e6 100644
--- a/src/fs/gnunet-fs-gtk.h
+++ b/src/fs/gnunet-fs-gtk.h
@@ -133,7 +133,7 @@ struct PseuLookupContext
/**
* Public key of the namespace we are trying to save.
*/
- struct GNUNET_CRYPTO_EcdsaPublicKey pkey;
+ struct GNUNET_IDENTITY_PublicKey pkey;
/**
* Nickname we're saving under.
@@ -253,7 +253,7 @@ struct GNUNET_GTK_MainWindowContext
/**
* Our zone for SKS operations. Can be NULL.
*/
- struct GNUNET_CRYPTO_EcdsaPrivateKey *sks_zone;
+ struct GNUNET_IDENTITY_PrivateKey *sks_zone;
};
diff --git a/src/fs/gnunet-fs-gtk_common.c b/src/fs/gnunet-fs-gtk_common.c
index 743456e9..ebfccab0 100644
--- a/src/fs/gnunet-fs-gtk_common.c
+++ b/src/fs/gnunet-fs-gtk_common.c
@@ -294,7 +294,7 @@ GNUNET_FS_GTK_handle_uri (const struct GNUNET_FS_Uri *uri,
GtkEntry *query_entry;
GtkComboBox *ns_cb;
GtkEntry *ns_entry;
- struct GNUNET_CRYPTO_EcdsaPublicKey want;
+ struct GNUNET_IDENTITY_PublicKey want;
if (GNUNET_FS_uri_test_chk (uri) || GNUNET_FS_uri_test_loc (uri))
diff --git a/src/fs/gnunet-fs-gtk_main-window-search.c
b/src/fs/gnunet-fs-gtk_main-window-search.c
index 98db564d..10209a3d 100644
--- a/src/fs/gnunet-fs-gtk_main-window-search.c
+++ b/src/fs/gnunet-fs-gtk_main-window-search.c
@@ -133,7 +133,7 @@ handle_gns_result (void *cls,
{
if (GNUNET_GNSRECORD_TYPE_PKEY != rd[i].record_type)
continue;
- if (sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey) != rd[i].data_size)
+ if (sizeof (struct GNUNET_IDENTITY_PublicKey) != rd[i].data_size)
{
GNUNET_break_op (0);
continue;
@@ -162,7 +162,7 @@ start_search (struct GNUNET_GTK_MainWindowContext *main_ctx)
gchar *mime_keyword;
const char *nsid;
struct GNUNET_FS_Uri *uri;
- struct GNUNET_CRYPTO_EcdsaPublicKey pub_sks_zone;
+ struct GNUNET_IDENTITY_PublicKey pub_sks_zone;
struct SearchLookup *sl;
char *emsg;
@@ -235,7 +235,7 @@ start_search (struct GNUNET_GTK_MainWindowContext *main_ctx)
sl->anonymity_level = anonymity_level;
sl->timeout_task =
GNUNET_SCHEDULER_add_delayed (LOOKUP_TIMEOUT, &timeout_search_lookup,
sl);
- GNUNET_CRYPTO_ecdsa_key_get_public (main_ctx->sks_zone, &pub_sks_zone);
+ GNUNET_IDENTITY_ego_get_public_key (main_ctx->sks_zone, &pub_sks_zone);
sl->gns = GNUNET_GNS_lookup (main_ctx->gns,
nsid,
&pub_sks_zone,
@@ -413,7 +413,7 @@ save_pseudonym_with_nick (struct PseuLookupContext *lctx,
const char *nick)
/* show the window */
gtk_window_present (GTK_WINDOW (lctx->progress_dialog));
memset (&rd, 0, sizeof (rd));
- rd.data_size = sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey);
+ rd.data_size = sizeof (struct GNUNET_IDENTITY_PublicKey);
rd.data = &lctx->pkey;
rd.flags = GNUNET_GNSRECORD_RF_PRIVATE;
rd.expiration_time = GNUNET_TIME_UNIT_FOREVER_ABS.abs_value_us;
@@ -652,7 +652,7 @@ GNUNET_FS_GTK_save_button_clicked_cb (GtkButton *button,
gpointer user_data)
struct GNUNET_GTK_MainWindowContext *main_ctx = user_data;
GtkComboBox *widget;
const gchar *text;
- struct GNUNET_CRYPTO_EcdsaPublicKey pkey;
+ struct GNUNET_IDENTITY_PublicKey pkey;
int ret;
struct PseuLookupContext *lctx;
guint anonymity_level;
@@ -728,7 +728,7 @@ main_window_search_namespace_combobox_changed_cb
(GtkComboBox *widget,
{
GtkButton *button;
const gchar *text;
- struct GNUNET_CRYPTO_EcdsaPublicKey pkey;
+ struct GNUNET_IDENTITY_PublicKey pkey;
int ret;
text = gtk_entry_get_text (GTK_ENTRY (gtk_bin_get_child (GTK_BIN (widget))));
diff --git a/src/fs/gnunet-fs-gtk_publish-dialog.c
b/src/fs/gnunet-fs-gtk_publish-dialog.c
index aafcce9b..1e1ec7fa 100644
--- a/src/fs/gnunet-fs-gtk_publish-dialog.c
+++ b/src/fs/gnunet-fs-gtk_publish-dialog.c
@@ -2196,7 +2196,7 @@ insert_advertisement (void *cls,
void **client_info)
{
struct MainPublishingDialogContext *ctx = cls;
- struct GNUNET_CRYPTO_EcdsaPublicKey pub;
+ struct GNUNET_IDENTITY_PublicKey pub;
struct GNUNET_FS_Uri *sks_uri;
char *sks_uri_string;
diff --git a/src/namestore/gnunet-namestore-gtk.c
b/src/namestore/gnunet-namestore-gtk.c
index 9e900f62..aad4bbd2 100644
--- a/src/namestore/gnunet-namestore-gtk.c
+++ b/src/namestore/gnunet-namestore-gtk.c
@@ -267,7 +267,7 @@ struct MoveOperationContext
/**
* Private key of target zone.
*/
- struct GNUNET_CRYPTO_EcdsaPrivateKey pk;
+ struct GNUNET_IDENTITY_PrivateKey pk;
/**
@@ -416,12 +416,12 @@ static GtkTreeView *tv;
/**
* Private key of the zone we are currently editing.
*/
-static struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey;
+static struct GNUNET_IDENTITY_PrivateKey *pkey;
/**
* Public key of the zone we are currently editing.
*/
-static struct GNUNET_CRYPTO_EcdsaPublicKey pubkey;
+static struct GNUNET_IDENTITY_PublicKey pubkey;
/**
* Pseudonym of the current zone we are editing.
@@ -939,7 +939,7 @@ merge_with_existing_records (void *cls,
*/
static void
handle_records_for_merge (void *cls,
- const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone,
+ const struct GNUNET_IDENTITY_PrivateKey *zone,
const char *label,
unsigned int rd_count,
const struct GNUNET_GNSRECORD_Data *rd)
@@ -1129,7 +1129,7 @@ edit_dialog_continuation (struct
GNUNET_GTK_NAMESTORE_PluginEnvironment *edc,
}
else
{
- const struct GNUNET_CRYPTO_EcdsaPrivateKey *pk;
+ const struct GNUNET_IDENTITY_PrivateKey *pk;
struct MoveOperationContext *moc;
struct GNUNET_HashCode query;
@@ -2367,7 +2367,7 @@ free_ri (struct RecordInfo *ri)
*/
static void
zone_iteration_proc (void *cls,
- const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone_key,
+ const struct GNUNET_IDENTITY_PrivateKey *zone_key,
const char *name,
unsigned int rd_count,
const struct GNUNET_GNSRECORD_Data *rd)
@@ -2391,7 +2391,7 @@ zone_iteration_proc (void *cls,
(void) cls;
if (0 !=
- memcmp (zone_key, pkey, sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey)))
+ memcmp (zone_key, pkey, sizeof (struct GNUNET_IDENTITY_PrivateKey)))
{
GNUNET_break (0);
return;
@@ -2608,9 +2608,9 @@ load_zone (const char *name, struct GNUNET_IDENTITY_Ego
*ego)
if (NULL == name)
return; /* empty zone */
current_pseudonym = GNUNET_strdup (name);
- pkey = GNUNET_new (struct GNUNET_CRYPTO_EcdsaPrivateKey);
+ pkey = GNUNET_new (struct GNUNET_IDENTITY_PrivateKey);
*pkey = *GNUNET_IDENTITY_ego_get_private_key (ego);
- GNUNET_CRYPTO_ecdsa_key_get_public (pkey, &pubkey);
+ GNUNET_IDENTITY_ego_get_public_key (pkey, &pubkey);
label = g_markup_printf_escaped ("<b>%s</b>", GNUNET_GNSRECORD_z2s
(&pubkey));
gtk_label_set_markup (GTK_LABEL (
get_object ("gnunet_namestore_gtk_zone_label")),
@@ -2707,7 +2707,7 @@ fresh_label (const char *label)
*/
static void
iop_create_cont (void *cls,
- const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv,
+ const struct GNUNET_IDENTITY_PrivateKey *priv,
const char *emsg)
{
GtkEntry *entry;
@@ -3126,7 +3126,12 @@ gnunet_namestore_gtk_zone_add_button_clicked_cb
(GtkButton *button,
label = gtk_entry_get_text (entry);
gtk_label_set_markup (status_label, _ ("Creating zone"));
gtk_widget_set_sensitive (main_window, FALSE);
- iop = GNUNET_IDENTITY_create (identity, label, NULL, &iop_create_cont, NULL);
+ iop = GNUNET_IDENTITY_create (identity,
+ label,
+ NULL,
+ GNUNET_IDENTITY_TYPE_ECDSA,
+ &iop_create_cont,
+ NULL);
gtk_entry_set_text (entry, "");
}
diff --git a/src/namestore/plugin_gtk_namestore_phone.c
b/src/namestore/plugin_gtk_namestore_phone.c
index 42582fd9..9d1576eb 100644
--- a/src/namestore/plugin_gtk_namestore_phone.c
+++ b/src/namestore/plugin_gtk_namestore_phone.c
@@ -124,7 +124,7 @@ phone_validate (void *cls, GtkBuilder *builder)
{
GtkEditable *entry;
const gchar *preedit;
- struct GNUNET_CRYPTO_EcdsaPublicKey pub;
+ struct GNUNET_IDENTITY_PublicKey pub;
entry = GTK_EDITABLE (
gtk_builder_get_object (builder, "edit_dialog_phone_peer_entry"));
diff --git a/src/namestore/plugin_gtk_namestore_pkey.c
b/src/namestore/plugin_gtk_namestore_pkey.c
index 428fa422..c31ca79b 100644
--- a/src/namestore/plugin_gtk_namestore_pkey.c
+++ b/src/namestore/plugin_gtk_namestore_pkey.c
@@ -99,7 +99,7 @@ pkey_validate (void *cls, GtkBuilder *builder)
{
GtkEditable *entry;
const gchar *preedit;
- struct GNUNET_CRYPTO_EcdsaPublicKey pub;
+ struct GNUNET_IDENTITY_PublicKey pub;
entry =
GTK_EDITABLE (gtk_builder_get_object (builder, "edit_dialog_pkey_entry")),
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnunet-gtk] branch master updated: fix key usage,
gnunet <=