diff options
Diffstat (limited to 'src/fs/gnunet-fs-gtk_advertise-pseudonym.c')
-rw-r--r-- | src/fs/gnunet-fs-gtk_advertise-pseudonym.c | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/src/fs/gnunet-fs-gtk_advertise-pseudonym.c b/src/fs/gnunet-fs-gtk_advertise-pseudonym.c index 811551b8..388aa22b 100644 --- a/src/fs/gnunet-fs-gtk_advertise-pseudonym.c +++ b/src/fs/gnunet-fs-gtk_advertise-pseudonym.c | |||
@@ -1,10 +1,10 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet | 2 | This file is part of GNUnet |
3 | (C) 2005, 2006, 2010, 2012 Christian Grothoff (and other contributing authors) | 3 | (C) 2005-2013 Christian Grothoff (and other contributing authors) |
4 | 4 | ||
5 | GNUnet is free software; you can redistribute it and/or modify | 5 | GNUnet is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published | 6 | it under the terms of the GNU General Public License as published |
7 | by the Free Software Foundation; either version 2, or (at your | 7 | by the Free Software Foundation; either version 3, or (at your |
8 | option) any later version. | 8 | option) any later version. |
9 | 9 | ||
10 | GNUnet is distributed in the hope that it will be useful, but | 10 | GNUnet is distributed in the hope that it will be useful, but |
@@ -59,7 +59,7 @@ struct NamespaceAdvertisementContext | |||
59 | /** | 59 | /** |
60 | * Handle to the namespace to advertise. | 60 | * Handle to the namespace to advertise. |
61 | */ | 61 | */ |
62 | struct GNUNET_FS_Namespace *ns; | 62 | struct GNUNET_CRYPTO_EccPrivateKey ns; |
63 | 63 | ||
64 | /** | 64 | /** |
65 | * Root of the namespace is stored here temporarily. | 65 | * Root of the namespace is stored here temporarily. |
@@ -98,14 +98,14 @@ advertise_namespace (void *cls, | |||
98 | { | 98 | { |
99 | struct NamespaceAdvertisementContext *nds = cls; | 99 | struct NamespaceAdvertisementContext *nds = cls; |
100 | struct GNUNET_FS_Uri *sks_uri; | 100 | struct GNUNET_FS_Uri *sks_uri; |
101 | char *emsg; | 101 | struct GNUNET_CRYPTO_EccPublicKey pub; |
102 | 102 | ||
103 | emsg = NULL; | 103 | GNUNET_CRYPTO_ecc_key_get_public (&nds->ns, &pub); |
104 | sks_uri = GNUNET_FS_uri_sks_create (nds->ns, nds->root, &emsg); | 104 | sks_uri = GNUNET_FS_uri_sks_create (&pub, nds->root); |
105 | GNUNET_assert (NULL == emsg); | ||
106 | GNUNET_FS_publish_ksk (GNUNET_FS_GTK_get_fs_handle (), | 105 | GNUNET_FS_publish_ksk (GNUNET_FS_GTK_get_fs_handle (), |
107 | *uri, meta, sks_uri, | 106 | *uri, meta, sks_uri, |
108 | bo, GNUNET_FS_PUBLISH_OPTION_NONE, NULL, NULL); | 107 | bo, GNUNET_FS_PUBLISH_OPTION_NONE, |
108 | NULL, NULL); | ||
109 | GNUNET_FS_uri_destroy (sks_uri); | 109 | GNUNET_FS_uri_destroy (sks_uri); |
110 | return GNUNET_SYSERR; | 110 | return GNUNET_SYSERR; |
111 | } | 111 | } |
@@ -132,29 +132,28 @@ adv_pseudonym_edit_publish_dialog_cb (gpointer cls, | |||
132 | GNUNET_FS_file_information_inspect (nds->fip, &advertise_namespace, nds); | 132 | GNUNET_FS_file_information_inspect (nds->fip, &advertise_namespace, nds); |
133 | nds->root = NULL; | 133 | nds->root = NULL; |
134 | } | 134 | } |
135 | GNUNET_FS_namespace_delete (nds->ns, GNUNET_NO); | ||
136 | GNUNET_FS_file_information_destroy (nds->fip, NULL, NULL); | 135 | GNUNET_FS_file_information_destroy (nds->fip, NULL, NULL); |
137 | GNUNET_free (nds); | 136 | GNUNET_free (nds); |
138 | } | 137 | } |
139 | 138 | ||
140 | 139 | ||
141 | |||
142 | /** | 140 | /** |
143 | * Call the publication editor dialog in namespace advertising mode, | 141 | * Call the publication editor dialog in namespace advertising mode, |
144 | * and publish the namespace when it's OK'ed. | 142 | * and publish the namespace when it's OK'ed. |
145 | * | 143 | * |
146 | * @param ns namespace to advertise (takes ownership of it) | 144 | * @param ns namespace to advertise |
147 | * @param transient_for parent window for the dialog | 145 | * @param transient_for parent window for the dialog |
148 | */ | 146 | */ |
149 | void | 147 | void |
150 | GNUNET_FS_GTK_advertise_namespace (struct GNUNET_FS_Namespace *ns, GtkWindow *transient_for) | 148 | GNUNET_FS_GTK_advertise_namespace (const struct GNUNET_CRYPTO_EccPrivateKey *ns, |
149 | GtkWindow *transient_for) | ||
151 | { | 150 | { |
152 | struct NamespaceAdvertisementContext *nds; | 151 | struct NamespaceAdvertisementContext *nds; |
153 | struct GNUNET_FS_BlockOptions bo; | 152 | struct GNUNET_FS_BlockOptions bo; |
154 | struct GNUNET_CONTAINER_MetaData *meta; | 153 | struct GNUNET_CONTAINER_MetaData *meta; |
155 | 154 | ||
156 | nds = GNUNET_malloc (sizeof (struct NamespaceAdvertisementContext)); | 155 | nds = GNUNET_new (struct NamespaceAdvertisementContext); |
157 | nds->ns = ns; | 156 | nds->ns = *ns; |
158 | memset (&bo, 0, sizeof (struct GNUNET_FS_BlockOptions)); | 157 | memset (&bo, 0, sizeof (struct GNUNET_FS_BlockOptions)); |
159 | bo.expiration_time = GNUNET_FS_year_to_time (GNUNET_FS_get_current_year () + 2); | 158 | bo.expiration_time = GNUNET_FS_year_to_time (GNUNET_FS_get_current_year () + 2); |
160 | bo.anonymity_level = 1; | 159 | bo.anonymity_level = 1; |