diff options
Diffstat (limited to 'src/restclient/anastasis_api_policy_store.c')
-rw-r--r-- | src/restclient/anastasis_api_policy_store.c | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/src/restclient/anastasis_api_policy_store.c b/src/restclient/anastasis_api_policy_store.c index b709472..2432079 100644 --- a/src/restclient/anastasis_api_policy_store.c +++ b/src/restclient/anastasis_api_policy_store.c @@ -1,6 +1,6 @@ /* This file is part of ANASTASIS - Copyright (C) 2014-2021 Anastasis SARL + Copyright (C) 2014-2022 Anastasis SARL ANASTASIS is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as @@ -356,6 +356,8 @@ ANASTASIS_policy_store ( const struct ANASTASIS_CRYPTO_AccountPrivateKeyP *anastasis_priv, const void *recovery_data, size_t recovery_data_size, + const void *recovery_meta_data, + size_t recovery_meta_data_size, uint32_t payment_years_requested, const struct ANASTASIS_PaymentSecretP *payment_secret, struct GNUNET_TIME_Relative payment_timeout, @@ -425,6 +427,31 @@ ANASTASIS_policy_store ( } job_headers = ext; + /* Setup meta-data header */ + if (NULL != recovery_meta_data) + { + char *meta_val; + + meta_val = GNUNET_STRINGS_data_to_string_alloc ( + recovery_meta_data, + recovery_meta_data_size); + GNUNET_asprintf (&hdr, + "%s: %s", + ANASTASIS_HTTP_HEADER_POLICY_META_DATA, + meta_val); + GNUNET_free (meta_val); + ext = curl_slist_append (job_headers, + hdr); + GNUNET_free (hdr); + if (NULL == ext) + { + GNUNET_break (0); + curl_slist_free_all (job_headers); + return NULL; + } + job_headers = ext; + } + /* Setup Payment-Identifier header */ if (NULL != payment_secret) { |