[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-anastasis] branch master updated: small commit for anastasis.h an
From: |
gnunet |
Subject: |
[taler-anastasis] branch master updated: small commit for anastasis.h and c |
Date: |
Tue, 31 Mar 2020 18:26:07 +0200 |
This is an automated email from the git hooks/post-receive script.
ds-meister pushed a commit to branch master
in repository anastasis.
The following commit(s) were added to refs/heads/master by this push:
new 4495d50 small commit for anastasis.h and c
4495d50 is described below
commit 4495d500d1af13dccb7fcf0e3ddcd47224cda6bf
Author: Dominik Meister <address@hidden>
AuthorDate: Tue Mar 31 18:25:59 2020 +0200
small commit for anastasis.h and c
---
src/include/anastasis.h | 2 ++
src/include/anastasis_service.h | 36 +++++++++++++++++++++++++++++++++
src/lib/anastasis.c | 44 +++++++++++++++++++++++++++++++++++------
src/util/anastasis_crypto.c | 3 +++
4 files changed, 79 insertions(+), 6 deletions(-)
diff --git a/src/include/anastasis.h b/src/include/anastasis.h
index aa96bd9..9e05965 100644
--- a/src/include/anastasis.h
+++ b/src/include/anastasis.h
@@ -203,6 +203,7 @@ struct ANASTASIS_Recovery; //
* @param id_data contains the users identity, (user account on providers)
* @param version defines the version which will be downloaded NULL for latest
version
* @param anastasis_provider_url_candidates NULL terminated list of possible
provider urls
+* @param provider_candidates_length length of the provider list
* @param pc opens the policy call back which holds the downloaded version and
the policies
* @param pc_cls closure for callback
* @param csc core secret callback is opened, with this the core secert is
passed to the client after the authentication
@@ -212,6 +213,7 @@ struct ANASTASIS_Recovery *
ANASTASIS_recovery_begin (const json_t *id_data,
unsigned int version,
const char *anastasis_provider_url_candidates[],
+ unsigned int provider_candidates_length,
ANASTASIS_PolicyCallback pc,
void *pc_cls,
ANASTASIS_CoreSecretCallback csc,
diff --git a/src/include/anastasis_service.h b/src/include/anastasis_service.h
index 4aa0d63..9bd101b 100644
--- a/src/include/anastasis_service.h
+++ b/src/include/anastasis_service.h
@@ -497,5 +497,41 @@ void
ANASTASIS_truth_store_cancel (struct
ANASTASIS_TruthStoreOperation *tso);
+// FIXME IMPLEMENTATION
+
+/**
+ * Defines a Callback for a Escrow Provider Inspection, simply passes back the
terms
+ * of the provider (price, supported methods .... )
+ *
+ * @param cls closure for the callback
+ * @param policy 0 terminated string which contains the terms of service
+ * @param cost defines the pricing of the provider
+ */
+typedef void
+(*ANASTASIS_EscrowProviderInformation)(void *cls,
+ const char *policy,
+ const struct TALER_Amount *cost);
+/**
+ * Does an EscrowProviderInspection GET /terms
+ * Receives an EscrowProviderInformation Callback
+ *
+ * @param base_url url of the provider to inspect
+ * @param cb callback for the request
+ * @param cb_cls callback closure
+ */
+struct ANASTASIS_EscrowProviderInspection *
+ANASTASIS_escrow_provider_inspect (const char *base_url,
+ ANASTASIS_EscrowProviderInformation cb,
+ void *cb_cls);
+/**
+ * Cancels an EscrowProviderInspection
+ * @param epi reference to the request
+ */
+void
+ANASTASIS_escrow_provider_inspect_cancel (struct
+ ANASTASIS_EscrowProviderInspection *
+ epi);
+
+
#endif /* _ANASTASIS_SERVICE_H */
diff --git a/src/lib/anastasis.c b/src/lib/anastasis.c
index fd54cf3..2a3fd55 100644
--- a/src/lib/anastasis.c
+++ b/src/lib/anastasis.c
@@ -25,6 +25,10 @@
#include <gnunet/gnunet_util_lib.h>
#include "anastasis_service.h"
+
+
+
+
/**
* Challenge struct contains the UUID's needed for the recovery process and a
reference to
* ANASTASIS_Recovery.
@@ -96,6 +100,7 @@ struct ANASTASIS_Recovery;
* @param id_data contains the users identity, (user account on providers)
* @param version defines the version which will be downloaded NULL for latest
version
* @param anastasis_provider_url_candidates NULL terminated list of possible
provider urls
+* @param provider_candidates_length length of the provider list
* @param pc opens the policy call back which holds the downloaded version and
the policies
* @param pc_cls closure for callback
* @param csc core secret callback is opened, with this the core secert is
passed to the client after the authentication
@@ -105,6 +110,7 @@ struct ANASTASIS_Recovery *
ANASTASIS_recovery_begin (const json_t *id_data,
unsigned int version,
const char *anastasis_provider_url_candidates[],
+ unsigned int provider_candidates_length,
ANASTASIS_PolicyCallback pc,
void *pc_cls,
ANASTASIS_CoreSecretCallback csc,
@@ -113,16 +119,42 @@ ANASTASIS_recovery_begin (const json_t *id_data,
// Derivation of user input into the account public key and user identifier
for the encryption
struct ANASTASIS_CRYPTO_UserIdentifier id;
struct ANASTASIS_CRYPTO_AccountPublicKey pub_key;
+ // Callbacks and context for lookup function
+ ANASTASIS_PolicyLookupCallback plc;
+ struct GNUNET_CURL_Context *ctx;
+ // iterator used to process the url's
+ unsigned int i = 0;
+ void *plc_cls;
ANASTASIS_CRYPTO_user_identifier_derive (id_data, &id);
ANASTASIS_CRYPTO_account_public_key_derive (&id, &pub_key);
-
-
-
-
-
-
+/*
+ if (version == 0)
+ {
+ while (pc.http_status != 200 || i < provider_candidates_length)
+ {
+ ANASTASIS_policy_lookup(ctx,
+ anastasis_provider_url_candidates[i],
+ &pub_key,
+ plc,
+ plc_cls);
+ i++;
+ }
+ }else
+ {
+ while (pc.http_status != 200 || i < provider_candidates_length)
+ {
+ ANASTASIS_policy_lookup_version(ctx,
+ anastasis_provider_url_candidates[i],
+ &pub_key,
+ plc,
+ plc_cls,
+ &version);
+ i++;
+ }
+ }
+*/
}
/**
diff --git a/src/util/anastasis_crypto.c b/src/util/anastasis_crypto.c
index 353e7f5..e6cb0c6 100644
--- a/src/util/anastasis_crypto.c
+++ b/src/util/anastasis_crypto.c
@@ -105,6 +105,9 @@ anastasis_encrypt (const void *msec,
struct ANASTASIS_CRYPTO_AesTag *tag;
char *ciphertext;
+ res_size = data_size + sizeof(struct ANASTASIS_CRYPTO_Nonce)
+ + GCM_TAG_SIZE;
+ res = GNUNET_malloc (res_size);
GNUNET_assert (res_size == data_size + sizeof (*nonce) + sizeof (*tag));
nonce = (struct ANASTASIS_CRYPTO_Nonce*) res;
tag = (struct ANASTASIS_CRYPTO_AesTag *) &nonce[1];
--
To stop receiving notification emails like this one, please contact
address@hidden.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-anastasis] branch master updated: small commit for anastasis.h and c,
gnunet <=