summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-04-05 17:16:04 +0200
committerChristian Grothoff <christian@grothoff.org>2022-04-05 17:16:04 +0200
commit71f889186973ef26e8ae684ec47fd570138bc4e5 (patch)
tree02898d03575384c26b5399d28d702d97f4683403 /src/lib
parent452aa5391b75ab6637b62398f9b0627593570d5d (diff)
downloadanastasis-71f889186973ef26e8ae684ec47fd570138bc4e5.tar.gz
anastasis-71f889186973ef26e8ae684ec47fd570138bc4e5.tar.bz2
anastasis-71f889186973ef26e8ae684ec47fd570138bc4e5.zip
adapt to latest GNUnet API: GNUNET_JSON_spec_mark_optional() changed
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/anastasis_backup.c3
-rw-r--r--src/lib/anastasis_recovery.c26
2 files changed, 14 insertions, 15 deletions
diff --git a/src/lib/anastasis_backup.c b/src/lib/anastasis_backup.c
index 0cb60dc..466dbe8 100644
--- a/src/lib/anastasis_backup.c
+++ b/src/lib/anastasis_backup.c
@@ -97,7 +97,8 @@ ANASTASIS_truth_from_json (const json_t *json)
&instructions),
GNUNET_JSON_spec_mark_optional (
GNUNET_JSON_spec_string ("mime_type",
- &mime_type)),
+ &mime_type),
+ NULL),
GNUNET_JSON_spec_fixed_auto ("uuid",
&t->uuid),
GNUNET_JSON_spec_fixed_auto ("nonce",
diff --git a/src/lib/anastasis_recovery.c b/src/lib/anastasis_recovery.c
index a450392..b70061d 100644
--- a/src/lib/anastasis_recovery.c
+++ b/src/lib/anastasis_recovery.c
@@ -758,7 +758,8 @@ policy_lookup_cb (void *cls,
&esc_methods),
GNUNET_JSON_spec_mark_optional (
GNUNET_JSON_spec_string ("secret_name",
- &secret_name)),
+ &secret_name),
+ NULL),
GNUNET_JSON_spec_varsize ("encrypted_core_secret",
&r->enc_core_secret,
&r->enc_core_secret_size),
@@ -1145,6 +1146,7 @@ parse_cs_array (struct ANASTASIS_Recovery *r,
const char *instructions;
const char *url;
const char *escrow_type;
+ bool no_key_share;
struct GNUNET_JSON_Specification spec[] = {
GNUNET_JSON_spec_fixed_auto ("uuid",
&c->ci.uuid),
@@ -1162,10 +1164,12 @@ parse_cs_array (struct ANASTASIS_Recovery *r,
&escrow_type),
GNUNET_JSON_spec_mark_optional (
GNUNET_JSON_spec_bool ("async",
- &c->ci.async)),
+ &c->ci.async),
+ NULL),
GNUNET_JSON_spec_mark_optional (
GNUNET_JSON_spec_fixed_auto ("key_share",
- &c->key_share)),
+ &c->key_share),
+ &no_key_share),
GNUNET_JSON_spec_end ()
};
@@ -1185,17 +1189,10 @@ parse_cs_array (struct ANASTASIS_Recovery *r,
c->instructions = GNUNET_strdup (instructions);
c->ci.instructions = c->instructions;
c->ci.provider_url = c->url;
+ if (! no_key_share)
{
- json_t *ks;
-
- ks = json_object_get (cs,
- "key_share");
- if ( (NULL != ks) &&
- (! json_is_null (ks)) )
- {
- c->ci.solved = true;
- r->solved_challenges[r->solved_challenge_pos++] = c;
- }
+ c->ci.solved = true;
+ r->solved_challenges[r->solved_challenge_pos++] = c;
}
}
return GNUNET_OK;
@@ -1368,7 +1365,8 @@ ANASTASIS_recovery_deserialize (struct GNUNET_CURL_Context *ctx,
&provider_url),
GNUNET_JSON_spec_mark_optional (
GNUNET_JSON_spec_string ("secret_name",
- &secret_name)),
+ &secret_name),
+ NULL),
GNUNET_JSON_spec_uint32 ("version",
&version),
GNUNET_JSON_spec_json ("dps",