diff options
author | Christian Grothoff <grothoff@gnunet.org> | 2023-07-31 18:32:20 +0200 |
---|---|---|
committer | Christian Grothoff <grothoff@gnunet.org> | 2023-07-31 18:32:20 +0200 |
commit | 661bd552f0c2f6ba77860dae633322ddaf19bd6d (patch) | |
tree | 2d606f9a8f951dc39284c58e762315d3d2c4b3de /src/lib | |
parent | 1b36d79083247a1750e42e43b485f0581057b3a7 (diff) | |
download | anastasis-661bd552f0c2f6ba77860dae633322ddaf19bd6d.tar.gz anastasis-661bd552f0c2f6ba77860dae633322ddaf19bd6d.tar.bz2 anastasis-661bd552f0c2f6ba77860dae633322ddaf19bd6d.zip |
future-proof API
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/anastasis_meta.c | 10 | ||||
-rw-r--r-- | src/lib/anastasis_recovery.c | 14 |
2 files changed, 10 insertions, 14 deletions
diff --git a/src/lib/anastasis_meta.c b/src/lib/anastasis_meta.c index 7812f6b..ae20db5 100644 --- a/src/lib/anastasis_meta.c +++ b/src/lib/anastasis_meta.c @@ -55,20 +55,17 @@ struct ANASTASIS_VersionCheck * Function called with results from a GET /policy/$POL/meta request * * @param cls closure with the `struct ANASTASIS_VersionCheck *` - * @param http_status HTTP status code for this request * @param dd the response details */ static void meta_cb ( void *cls, - unsigned int http_status, const struct ANASTASIS_MetaDownloadDetails *dd) { struct ANASTASIS_VersionCheck *vc = cls; vc->plm = NULL; - if ( (MHD_HTTP_OK != http_status) || - (NULL == dd) ) + if (MHD_HTTP_OK != dd->http_status) { vc->mpc (vc->mpc_cls, 0, @@ -78,9 +75,10 @@ meta_cb ( ANASTASIS_recovery_get_versions_cancel (vc); return; } - for (size_t i = 0; i<dd->metas_length; i++) + for (size_t i = 0; i<dd->details.ok.metas_length; i++) { - const struct ANASTASIS_MetaDataEntry *meta = &dd->metas[i]; + const struct ANASTASIS_MetaDataEntry *meta + = &dd->details.ok.metas[i]; const char *secret_name = NULL; const struct GNUNET_HashCode *eph; void *dec; diff --git a/src/lib/anastasis_recovery.c b/src/lib/anastasis_recovery.c index f94e946..0364b5a 100644 --- a/src/lib/anastasis_recovery.c +++ b/src/lib/anastasis_recovery.c @@ -612,12 +612,10 @@ ANASTASIS_challenge_abort (struct ANASTASIS_Challenge *c) * Function called with the results of a #ANASTASIS_policy_lookup() * * @param cls closure - * @param http_status HTTp status code. * @param dd details about the lookup operation */ static void policy_lookup_cb (void *cls, - unsigned int http_status, const struct ANASTASIS_DownloadDetails *dd) { struct ANASTASIS_Recovery *r = cls; @@ -629,7 +627,7 @@ policy_lookup_cb (void *cls, json_t *recovery_document; r->plo = NULL; - switch (http_status) + switch (dd->http_status) { case MHD_HTTP_OK: break; @@ -661,7 +659,7 @@ policy_lookup_cb (void *cls, default: GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Unexpected response code %u in %s:%u\n", - http_status, + dd->http_status, __FILE__, __LINE__); r->csc (r->csc_cls, @@ -671,7 +669,7 @@ policy_lookup_cb (void *cls, ANASTASIS_recovery_abort (r); return; } - if (NULL == dd->policy) + if (NULL == dd->details.ok.policy) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "No recovery data available"); @@ -683,8 +681,8 @@ policy_lookup_cb (void *cls, return; } ANASTASIS_CRYPTO_recovery_document_decrypt (&r->id, - dd->policy, - dd->policy_size, + dd->details.ok.policy, + dd->details.ok.policy_size, &plaintext, &size_plaintext); if (size_plaintext < sizeof (uint32_t)) @@ -801,7 +799,7 @@ policy_lookup_cb (void *cls, } } - r->ri.version = dd->version; + r->ri.version = dd->details.ok.version; r->ri.cs_len = json_array_size (esc_methods); r->ri.dps_len = json_array_size (dec_policies); r->ri.dps = GNUNET_new_array (r->ri.dps_len, |