diff options
author | jospaeth <spaethj@in.tum.de> | 2020-07-22 17:23:53 +0200 |
---|---|---|
committer | jospaeth <spaethj@in.tum.de> | 2020-07-22 17:23:53 +0200 |
commit | 7694804564e41a04e9d6e0909a59ee7ec3b7e627 (patch) | |
tree | e4d0a539e0eec95677f94dba281f5d071d0ff292 /src/escrow/plugin_escrow_gns.c | |
parent | 0c87a350df02b1dcaffe615f31a63e92be63aef1 (diff) | |
download | gnunet-7694804564e41a04e9d6e0909a59ee7ec3b7e627.tar.gz gnunet-7694804564e41a04e9d6e0909a59ee7ec3b7e627.zip |
handle escrow operations as dll, clean them up
(not yet finished)
Diffstat (limited to 'src/escrow/plugin_escrow_gns.c')
-rw-r--r-- | src/escrow/plugin_escrow_gns.c | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/src/escrow/plugin_escrow_gns.c b/src/escrow/plugin_escrow_gns.c index 93d68f4d3..f77ef30d6 100644 --- a/src/escrow/plugin_escrow_gns.c +++ b/src/escrow/plugin_escrow_gns.c | |||
@@ -50,12 +50,14 @@ struct EscrowPluginHandle ph; | |||
50 | /** | 50 | /** |
51 | * Start the GNS escrow of the key | 51 | * Start the GNS escrow of the key |
52 | * | 52 | * |
53 | * @param op the escrow operation | 53 | * @param h the handle for the escrow component |
54 | * @param ego the identity ego containing the private key | 54 | * @param ego the identity ego containing the private key |
55 | * @param cb the function called upon completion | ||
55 | */ | 56 | */ |
56 | void | 57 | void |
57 | start_gns_key_escrow (struct GNUNET_ESCROW_Operation *op, | 58 | start_gns_key_escrow (struct GNUNET_ESCROW_Handle *h, |
58 | const struct GNUNET_IDENTITY_Ego *ego) | 59 | const struct GNUNET_IDENTITY_Ego *ego, |
60 | GNUNET_ESCROW_AnchorContinuation cb) | ||
59 | { | 61 | { |
60 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *pk; | 62 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *pk; |
61 | sss_Keyshare keyshares; | 63 | sss_Keyshare keyshares; |
@@ -64,7 +66,7 @@ start_gns_key_escrow (struct GNUNET_ESCROW_Operation *op, | |||
64 | 66 | ||
65 | if (NULL == ego) | 67 | if (NULL == ego) |
66 | { | 68 | { |
67 | op->cb_put (op->cb_cls, NULL); | 69 | cb (h, NULL); |
68 | return; | 70 | return; |
69 | } | 71 | } |
70 | pk = GNUNET_IDENTITY_ego_get_private_key (ego); | 72 | pk = GNUNET_IDENTITY_ego_get_private_key (ego); |
@@ -83,7 +85,7 @@ start_gns_key_escrow (struct GNUNET_ESCROW_Operation *op, | |||
83 | // TODO: implement | 85 | // TODO: implement |
84 | anchorDataSize = 0; // TODO! | 86 | anchorDataSize = 0; // TODO! |
85 | anchor = GNUNET_malloc (sizeof (struct GNUNET_ESCROW_Anchor) + anchorDataSize); | 87 | anchor = GNUNET_malloc (sizeof (struct GNUNET_ESCROW_Anchor) + anchorDataSize); |
86 | op->cb_put (op->cb_cls, anchor); | 88 | cb (h, anchor); |
87 | } | 89 | } |
88 | 90 | ||
89 | 91 | ||
@@ -105,34 +107,38 @@ renew_gns_key_escrow (struct GNUNET_ESCROW_Operation *op, | |||
105 | /** | 107 | /** |
106 | * Verify the GNS escrow of the key | 108 | * Verify the GNS escrow of the key |
107 | * | 109 | * |
108 | * @param op the escrow operation | 110 | * @param h the handle for the escrow component |
109 | * @param ego the identity ego containing the private key | 111 | * @param ego the identity ego containing the private key |
110 | * @param escrowAnchor the escrow anchor needed to restore the key | 112 | * @param escrowAnchor the escrow anchor needed to restore the key |
113 | * @param cb the function called upon completion | ||
111 | */ | 114 | */ |
112 | void | 115 | void |
113 | verify_gns_key_escrow (struct GNUNET_ESCROW_Operation *op, | 116 | verify_gns_key_escrow (struct GNUNET_ESCROW_Handle *h, |
114 | const struct GNUNET_IDENTITY_Ego *ego, | 117 | const struct GNUNET_IDENTITY_Ego *ego, |
115 | struct GNUNET_ESCROW_Anchor *escrowAnchor) | 118 | struct GNUNET_ESCROW_Anchor *escrowAnchor, |
119 | GNUNET_ESCROW_VerifyContinuation cb) | ||
116 | { | 120 | { |
117 | // TODO: implement | 121 | // TODO: implement |
118 | op->cb_verify (op->cb_cls, GNUNET_ESCROW_INVALID); | 122 | cb (h, GNUNET_ESCROW_INVALID); |
119 | } | 123 | } |
120 | 124 | ||
121 | 125 | ||
122 | /** | 126 | /** |
123 | * Restore the key from GNS escrow | 127 | * Restore the key from GNS escrow |
124 | * | 128 | * |
125 | * @param op the escrow operation | 129 | * @param h the handle for the escrow component |
126 | * @param escrowAnchor the escrow anchor needed to restore the key | 130 | * @param escrowAnchor the escrow anchor needed to restore the key |
127 | * @param egoName the name of the ego to restore | 131 | * @param egoName the name of the ego to restore |
132 | * @param cb the function called upon completion | ||
128 | */ | 133 | */ |
129 | void | 134 | void |
130 | restore_gns_key_escrow (struct GNUNET_ESCROW_Operation *op, | 135 | restore_gns_key_escrow (struct GNUNET_ESCROW_Handle *h, |
131 | struct GNUNET_ESCROW_Anchor *escrowAnchor, | 136 | struct GNUNET_ESCROW_Anchor *escrowAnchor, |
132 | char *egoName) | 137 | char *egoName, |
138 | GNUNET_ESCROW_EgoContinuation cb) | ||
133 | { | 139 | { |
134 | // TODO: implement | 140 | // TODO: implement |
135 | op->cb_get (op->cb_cls, NULL); | 141 | cb (h, NULL); |
136 | } | 142 | } |
137 | 143 | ||
138 | 144 | ||