diff options
Diffstat (limited to 'src/lib/anastasis_recovery.c')
-rw-r--r-- | src/lib/anastasis_recovery.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/src/lib/anastasis_recovery.c b/src/lib/anastasis_recovery.c index 95c131d..a9b8b31 100644 --- a/src/lib/anastasis_recovery.c +++ b/src/lib/anastasis_recovery.c | |||
@@ -1045,7 +1045,7 @@ ANASTASIS_recovery_serialize (const struct ANASTASIS_Recovery *r) | |||
1045 | } | 1045 | } |
1046 | GNUNET_assert (NULL != dp->emk); | 1046 | GNUNET_assert (NULL != dp->emk); |
1047 | dps = GNUNET_JSON_PACK ( | 1047 | dps = GNUNET_JSON_PACK ( |
1048 | GNUNET_JSON_pack_data_varsize ("emk", | 1048 | GNUNET_JSON_pack_data_varsize ("encrypted_master_key", |
1049 | dp->emk, | 1049 | dp->emk, |
1050 | dp->emk_size), | 1050 | dp->emk_size), |
1051 | GNUNET_JSON_pack_data_auto ("master_salt", | 1051 | GNUNET_JSON_pack_data_auto ("master_salt", |
@@ -1098,9 +1098,9 @@ ANASTASIS_recovery_serialize (const struct ANASTASIS_Recovery *r) | |||
1098 | return GNUNET_JSON_PACK ( | 1098 | return GNUNET_JSON_PACK ( |
1099 | GNUNET_JSON_pack_data_auto ("id", | 1099 | GNUNET_JSON_pack_data_auto ("id", |
1100 | &r->id), | 1100 | &r->id), |
1101 | GNUNET_JSON_pack_array_steal ("dps", | 1101 | GNUNET_JSON_pack_array_steal ("decryption_policies", |
1102 | dps_arr), | 1102 | dps_arr), |
1103 | GNUNET_JSON_pack_array_steal ("cs", | 1103 | GNUNET_JSON_pack_array_steal ("challenges", |
1104 | cs_arr), | 1104 | cs_arr), |
1105 | GNUNET_JSON_pack_uint64 ("version", | 1105 | GNUNET_JSON_pack_uint64 ("version", |
1106 | r->ri.version), | 1106 | r->ri.version), |
@@ -1111,14 +1111,16 @@ ANASTASIS_recovery_serialize (const struct ANASTASIS_Recovery *r) | |||
1111 | GNUNET_JSON_pack_allow_null ( | 1111 | GNUNET_JSON_pack_allow_null ( |
1112 | GNUNET_JSON_pack_string ("secret_name", | 1112 | GNUNET_JSON_pack_string ("secret_name", |
1113 | r->secret_name)), | 1113 | r->secret_name)), |
1114 | GNUNET_JSON_pack_data_varsize ("core_secret", | 1114 | GNUNET_JSON_pack_data_varsize ("encrypted_core_secret", |
1115 | r->enc_core_secret, | 1115 | r->enc_core_secret, |
1116 | r->enc_core_secret_size)); | 1116 | r->enc_core_secret_size)); |
1117 | } | 1117 | } |
1118 | 1118 | ||
1119 | 1119 | ||
1120 | /** | 1120 | /** |
1121 | * Parse the @a cs_array and update @a r accordingly | 1121 | * Parse the @a cs_array with information about |
1122 | * the various challenges and their solution state | ||
1123 | * and update @a r accordingly | ||
1122 | * | 1124 | * |
1123 | * @param[in,out] r recovery information to update | 1125 | * @param[in,out] r recovery information to update |
1124 | * @param cs_arr serialized data to parse | 1126 | * @param cs_arr serialized data to parse |
@@ -1203,7 +1205,8 @@ parse_cs_array (struct ANASTASIS_Recovery *r, | |||
1203 | 1205 | ||
1204 | 1206 | ||
1205 | /** | 1207 | /** |
1206 | * Parse the @a dps_array and update @a r accordingly | 1208 | * Parse the @a dps_array with our decryption policies |
1209 | * and update @a r accordingly | ||
1207 | * | 1210 | * |
1208 | * @param[in,out] r recovery information to update | 1211 | * @param[in,out] r recovery information to update |
1209 | * @param dps_arr serialized data to parse | 1212 | * @param dps_arr serialized data to parse |
@@ -1232,7 +1235,7 @@ parse_dps_array (struct ANASTASIS_Recovery *r, | |||
1232 | struct DecryptionPolicy *dp = &r->dps[n_index]; | 1235 | struct DecryptionPolicy *dp = &r->dps[n_index]; |
1233 | json_t *challenges; | 1236 | json_t *challenges; |
1234 | struct GNUNET_JSON_Specification spec[] = { | 1237 | struct GNUNET_JSON_Specification spec[] = { |
1235 | GNUNET_JSON_spec_varsize ("emk", | 1238 | GNUNET_JSON_spec_varsize ("encrypted_master_key", |
1236 | &dp->emk, | 1239 | &dp->emk, |
1237 | &dp->emk_size), | 1240 | &dp->emk_size), |
1238 | GNUNET_JSON_spec_fixed_auto ("master_salt", | 1241 | GNUNET_JSON_spec_fixed_auto ("master_salt", |
@@ -1372,13 +1375,13 @@ ANASTASIS_recovery_deserialize (struct GNUNET_CURL_Context *ctx, | |||
1372 | NULL), | 1375 | NULL), |
1373 | GNUNET_JSON_spec_uint32 ("version", | 1376 | GNUNET_JSON_spec_uint32 ("version", |
1374 | &version), | 1377 | &version), |
1375 | GNUNET_JSON_spec_json ("dps", | 1378 | GNUNET_JSON_spec_json ("decryption_policies", |
1376 | &dps_arr), | 1379 | &dps_arr), |
1377 | GNUNET_JSON_spec_json ("cs", | 1380 | GNUNET_JSON_spec_json ("challenges", |
1378 | &cs_arr), | 1381 | &cs_arr), |
1379 | GNUNET_JSON_spec_json ("id_data", | 1382 | GNUNET_JSON_spec_json ("id_data", |
1380 | &id_data), | 1383 | &id_data), |
1381 | GNUNET_JSON_spec_varsize ("core_secret", | 1384 | GNUNET_JSON_spec_varsize ("encrypted_core_secret", |
1382 | &ecs, | 1385 | &ecs, |
1383 | &ecs_size), | 1386 | &ecs_size), |
1384 | GNUNET_JSON_spec_end () | 1387 | GNUNET_JSON_spec_end () |