diff options
Diffstat (limited to 'src/escrow/plugin_escrow_anastasis.c')
-rw-r--r-- | src/escrow/plugin_escrow_anastasis.c | 63 |
1 files changed, 52 insertions, 11 deletions
diff --git a/src/escrow/plugin_escrow_anastasis.c b/src/escrow/plugin_escrow_anastasis.c index 0c657de4d..3f70a4aaf 100644 --- a/src/escrow/plugin_escrow_anastasis.c +++ b/src/escrow/plugin_escrow_anastasis.c | |||
@@ -39,7 +39,7 @@ static struct GNUNET_IDENTITY_Handle *identity_handle; | |||
39 | /** | 39 | /** |
40 | * Handle for the plugin instance | 40 | * Handle for the plugin instance |
41 | */ | 41 | */ |
42 | struct EscrowPluginHandle ph; | 42 | struct ESCROW_PluginHandle ph; |
43 | 43 | ||
44 | 44 | ||
45 | /** | 45 | /** |
@@ -48,14 +48,23 @@ struct EscrowPluginHandle ph; | |||
48 | * @param h the handle for the escrow component | 48 | * @param h the handle for the escrow component |
49 | * @param ego the identity ego containing the private key | 49 | * @param ego the identity ego containing the private key |
50 | * @param cb the function called upon completion | 50 | * @param cb the function called upon completion |
51 | * | ||
52 | * @return plugin operation wrapper | ||
51 | */ | 53 | */ |
52 | void | 54 | struct ESCROW_PluginOperationWrapper * |
53 | start_anastasis_key_escrow (struct GNUNET_ESCROW_Handle *h, | 55 | start_anastasis_key_escrow (struct GNUNET_ESCROW_Handle *h, |
54 | const struct GNUNET_IDENTITY_Ego *ego, | 56 | const struct GNUNET_IDENTITY_Ego *ego, |
55 | GNUNET_ESCROW_AnchorContinuation cb) | 57 | GNUNET_SCHEDULER_TaskCallback cb) |
56 | { | 58 | { |
59 | struct GNUNET_ESCROW_Plugin_AnchorContinuationWrapper *w; | ||
60 | |||
61 | w = GNUNET_new (struct GNUNET_ESCROW_Plugin_AnchorContinuationWrapper); | ||
62 | w->h = h; | ||
63 | |||
57 | // TODO: implement | 64 | // TODO: implement |
58 | cb (h, NULL); | 65 | w->escrowAnchor = NULL; |
66 | GNUNET_SCHEDULER_add_now (cb, w); | ||
67 | return NULL; | ||
59 | } | 68 | } |
60 | 69 | ||
61 | 70 | ||
@@ -70,7 +79,7 @@ renew_anastasis_key_escrow (struct GNUNET_ESCROW_Operation *op, | |||
70 | struct GNUNET_ESCROW_Anchor *escrowAnchor) | 79 | struct GNUNET_ESCROW_Anchor *escrowAnchor) |
71 | { | 80 | { |
72 | // TODO: implement | 81 | // TODO: implement |
73 | op->cb_renew (op->cb_cls, NULL); | 82 | op->cb_renew (NULL); |
74 | } | 83 | } |
75 | 84 | ||
76 | 85 | ||
@@ -81,15 +90,24 @@ renew_anastasis_key_escrow (struct GNUNET_ESCROW_Operation *op, | |||
81 | * @param ego the identity ego containing the private key | 90 | * @param ego the identity ego containing the private key |
82 | * @param escrowAnchor the escrow anchor needed to restore the key | 91 | * @param escrowAnchor the escrow anchor needed to restore the key |
83 | * @param cb the function called upon completion | 92 | * @param cb the function called upon completion |
93 | * | ||
94 | * @return plugin operation wrapper | ||
84 | */ | 95 | */ |
85 | void | 96 | struct ESCROW_PluginOperationWrapper * |
86 | verify_anastasis_key_escrow (struct GNUNET_ESCROW_Handle *h, | 97 | verify_anastasis_key_escrow (struct GNUNET_ESCROW_Handle *h, |
87 | const struct GNUNET_IDENTITY_Ego *ego, | 98 | const struct GNUNET_IDENTITY_Ego *ego, |
88 | struct GNUNET_ESCROW_Anchor *escrowAnchor, | 99 | struct GNUNET_ESCROW_Anchor *escrowAnchor, |
89 | GNUNET_ESCROW_VerifyContinuation cb) | 100 | GNUNET_SCHEDULER_TaskCallback cb) |
90 | { | 101 | { |
102 | struct GNUNET_ESCROW_Plugin_VerifyContinuationWrapper *w; | ||
103 | |||
104 | w = GNUNET_new (struct GNUNET_ESCROW_Plugin_VerifyContinuationWrapper); | ||
105 | w->h = h; | ||
106 | |||
91 | // TODO: implement | 107 | // TODO: implement |
92 | cb (h, GNUNET_ESCROW_INVALID); | 108 | w->verificationResult = GNUNET_ESCROW_INVALID; |
109 | GNUNET_SCHEDULER_add_now (cb, w); | ||
110 | return NULL; | ||
93 | } | 111 | } |
94 | 112 | ||
95 | 113 | ||
@@ -100,15 +118,24 @@ verify_anastasis_key_escrow (struct GNUNET_ESCROW_Handle *h, | |||
100 | * @param escrowAnchor the escrow anchor needed to restore the key | 118 | * @param escrowAnchor the escrow anchor needed to restore the key |
101 | * @param egoName the name of the ego to restore | 119 | * @param egoName the name of the ego to restore |
102 | * @param cb the function called upon completion | 120 | * @param cb the function called upon completion |
121 | * | ||
122 | * @return plugin operation wrapper | ||
103 | */ | 123 | */ |
104 | void | 124 | struct ESCROW_PluginOperationWrapper * |
105 | restore_anastasis_key_escrow (struct GNUNET_ESCROW_Handle *h, | 125 | restore_anastasis_key_escrow (struct GNUNET_ESCROW_Handle *h, |
106 | struct GNUNET_ESCROW_Anchor *escrowAnchor, | 126 | struct GNUNET_ESCROW_Anchor *escrowAnchor, |
107 | char *egoName, | 127 | char *egoName, |
108 | GNUNET_ESCROW_EgoContinuation cb) | 128 | GNUNET_SCHEDULER_TaskCallback cb) |
109 | { | 129 | { |
130 | struct GNUNET_ESCROW_Plugin_EgoContinuationWrapper *w; | ||
131 | |||
132 | w = GNUNET_new (struct GNUNET_ESCROW_Plugin_EgoContinuationWrapper); | ||
133 | w->h = h; | ||
134 | |||
110 | // TODO: implement | 135 | // TODO: implement |
111 | cb (h, NULL); | 136 | w->ego = NULL; |
137 | GNUNET_SCHEDULER_add_now (cb, w); | ||
138 | return NULL; | ||
112 | } | 139 | } |
113 | 140 | ||
114 | 141 | ||
@@ -155,6 +182,19 @@ anastasis_anchor_data_to_string (struct GNUNET_ESCROW_Handle *h, | |||
155 | 182 | ||
156 | 183 | ||
157 | /** | 184 | /** |
185 | * Cancel an Anastasis plugin operation. | ||
186 | * | ||
187 | * @param plugin_op_wrap the plugin operation wrapper containing the operation | ||
188 | */ | ||
189 | void | ||
190 | cancel_anastasis_operation (struct ESCROW_PluginOperationWrapper *plugin_op_wrap) | ||
191 | { | ||
192 | // TODO: implement | ||
193 | return; | ||
194 | } | ||
195 | |||
196 | |||
197 | /** | ||
158 | * IdentityInitContinuation for the Anastasis plugin | 198 | * IdentityInitContinuation for the Anastasis plugin |
159 | */ | 199 | */ |
160 | void | 200 | void |
@@ -183,6 +223,7 @@ libgnunet_plugin_escrow_anastasis_init (void *cls) | |||
183 | api->verify_key_escrow = &verify_anastasis_key_escrow; | 223 | api->verify_key_escrow = &verify_anastasis_key_escrow; |
184 | api->restore_key = &restore_anastasis_key_escrow; | 224 | api->restore_key = &restore_anastasis_key_escrow; |
185 | api->anchor_string_to_data = &anastasis_anchor_string_to_data; | 225 | api->anchor_string_to_data = &anastasis_anchor_string_to_data; |
226 | api->cancel_plugin_operation = &cancel_anastasis_operation; | ||
186 | 227 | ||
187 | ph.id_init_cont = &anastasis_cont_init; | 228 | ph.id_init_cont = &anastasis_cont_init; |
188 | 229 | ||