summaryrefslogtreecommitdiff
path: root/src/lib/anastasis_backup.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/anastasis_backup.c')
-rw-r--r--src/lib/anastasis_backup.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/lib/anastasis_backup.c b/src/lib/anastasis_backup.c
index f5b91fb..20c77e4 100644
--- a/src/lib/anastasis_backup.c
+++ b/src/lib/anastasis_backup.c
@@ -895,6 +895,8 @@ ANASTASIS_secret_share (struct GNUNET_CURL_Context *ctx,
void *recovery_data;
size_t recovery_data_size;
struct ANASTASIS_CRYPTO_AccountPrivateKeyP anastasis_priv;
+ size_t enc_meta_size = 0;
+ void *enc_meta = NULL;
pss->ss = ss;
pss->anastasis_url = GNUNET_strdup (providers[l].provider_url);
@@ -903,6 +905,12 @@ ANASTASIS_secret_share (struct GNUNET_CURL_Context *ctx,
ANASTASIS_CRYPTO_user_identifier_derive (id_data,
&pss->server_salt,
&pss->id);
+ if (NULL != secret_name)
+ ANASTASIS_CRYPTO_recovery_metadata_encrypt (&pss->id,
+ secret_name,
+ strlen (secret_name),
+ &enc_meta,
+ &enc_meta_size);
ANASTASIS_CRYPTO_account_private_key_derive (&pss->id,
&anastasis_priv);
ANASTASIS_CRYPTO_recovery_document_encrypt (&pss->id,
@@ -919,7 +927,8 @@ ANASTASIS_secret_share (struct GNUNET_CURL_Context *ctx,
&anastasis_priv,
recovery_data,
recovery_data_size,
- NULL, 0, /* FIXME: meta-data! */
+ enc_meta,
+ enc_meta_size,
payment_years_requested,
(! GNUNET_is_zero (&pss->payment_secret))
? &pss->payment_secret
@@ -928,6 +937,7 @@ ANASTASIS_secret_share (struct GNUNET_CURL_Context *ctx,
&policy_store_cb,
pss);
GNUNET_free (recovery_data);
+ GNUNET_free (enc_meta);
if (NULL == pss->pso)
{
GNUNET_break (0);