gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-anastasis] branch master updated: hdr


From: gnunet
Subject: [taler-anastasis] branch master updated: hdr
Date: Thu, 05 Dec 2019 09:55:13 +0100

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository anastasis.

The following commit(s) were added to refs/heads/master by this push:
     new 37a59e3  hdr
37a59e3 is described below

commit 37a59e32e972dbb2a321e7178759d0b22bb66afa
Author: Christian Grothoff <address@hidden>
AuthorDate: Thu Dec 5 09:55:07 2019 +0100

    hdr
---
 src/include/anastasis.h            | 55 ++++++++++++++++++++++++++++
 src/include/anastasis_crypto_lib.h | 75 ++++++++++++++++++++++++++++++++++++++
 src/lib/Makefile.am                | 56 ++++++++++++++++------------
 src/lib/anastasis.c                |  4 ++
 4 files changed, 166 insertions(+), 24 deletions(-)

diff --git a/src/include/anastasis.h b/src/include/anastasis.h
new file mode 100644
index 0000000..dbf4951
--- /dev/null
+++ b/src/include/anastasis.h
@@ -0,0 +1,55 @@
+/* libanastasis */
+#include <anastasis_crypto_lib.h>
+
+typedef void
+(*ANASTASIS_EscrowProviderInformation*)(void *cls,
+                                        const char *policy,
+                                        const struct TALER_Amount *cost);
+
+struct ANASTASIS_EscrowProviderInspection *
+ANASTASIS_escrow_provider_inspect (const char *base_url,
+                                   ANASTASIS_EscrowProviderInformation cb,
+                                   void *cb_cls);
+
+void
+ANASTASIS_escrow_provider_inspect_cancel (struct
+                                          ANASTASIS_EscrowProviderInspection *
+                                          epi);
+
+
+typedef void
+(*ANASTASIS_PolicyInformation*)(void *cls,
+                                struct ANASTASIS_CRYPTO_Policy *policy);
+
+
+struct ANASTASIS_PolicyFetch *
+ANASTASIS_get_policy (const char *base_url,
+                      const struct ANASTASIS_CRYPTO_UserIdentifier *id,
+                      ANASTASIS_PolicyInformation cb,
+                      void *cb_cls);
+
+void
+ANASTASIS_get_policy_cancel (struct ANASTASIS_PolicyFetch *pf);
+
+struct ANASTASIS_RecoveryDocumentUpload;
+
+
+typedef void
+(*ANASTASIS_RecoverUploadResult)(void *cls,
+                                 ...);
+
+// last_etag can be NULL (if not known)
+struct ANASTASIS_RecoveryDocumentUpload *
+ANASTASIS_escrow_provider_recovery_document_upload (const char *base_url,
+                                                    const struct
+                                                    
ANASTASIS_CRYPTO_UserIdentifier
+                                                    *id,
+                                                    const struct
+                                                    GNUNET_HashCode *last_etag,
+                                                    const struct
+                                                    
ANASTASIS_CRYPTO_RecoveryDocument
+                                                    *p,
+                                                    
ANASTASIS_RecoverUploadResult
+                                                    cb,
+                                                    void *cb_cls);
+// ... cancel
diff --git a/src/include/anastasis_crypto_lib.h 
b/src/include/anastasis_crypto_lib.h
new file mode 100644
index 0000000..4b3cf01
--- /dev/null
+++ b/src/include/anastasis_crypto_lib.h
@@ -0,0 +1,75 @@
+/* libanastasisutil */
+
+struct ANASTASIS_CRYPTO_RecoveryDocument;
+
+struct ANASTASIS_CYRPTO_EscrowProvider;
+
+struct ANASTASIS_CRYPTO_UserIdentifier
+{
+  uint32_t hash[32];
+};
+
+struct ANASTASIS_CRYPTO_EscrowUuid
+{
+  uint32_t uuid[32];
+};
+
+
+void
+ANASTASIS_CRYPTO_uid_hash (const json_t *id_data,
+                           struct ANASTASIS_CRYPTO_UserIdentifier *id);
+
+
+
+struct ANASTASIS_EscrowProvider *
+ANASTASIS_CRYPTO_escrow_provider_create (const char *base_url,
+                                         const char *method);
+
+
+struct ANASTASIS_CRYPTO_RecoveryDocument *
+ANASTASIS_CRYPTO_recovery_document_create (const struct
+                                           ANASTASIS_CRYPTO_MasterKeyP *
+                                           master_key);
+
+
+// uuid is RETURNED / set!
+int
+ANASTASIS_CRYPTO_recovery_document_add_escrow (struct
+                                               
ANASTASIS_CRYPTO_RecoveryDocument
+                                               *p,
+                                               struct ANASTASIS_EscrowProvider 
*
+                                               ep,
+                                               struct
+                                               ANASTASIS_CRYPTO_EscrowUuid *
+                                               uuid);
+
+
+// uuids == array!
+int
+ANASTASIS_CRYPTO_recovery_document_add_policy (struct
+                                               
ANASTASIS_CRYPTO_RecoveryDocument
+                                               *p,
+                                               unsigned int uuids_length,
+                                               const struct
+                                               ANASTASIS_CRYPTO_EscrowUuid *
+                                               uuids);
+
+int
+ANASTASIS_CRYPTO_recovery_document_encrypt (const struct
+                                            ANASTASIS_CRYPTO_RecoveryDocument 
*p,
+                                            const struct
+                                            ANASTASIS_CRYPTO_UserIdentifier 
*id,
+                                            void **res,
+                                            size_t *res_size);
+
+
+struct ANASTASIS_RecoveryDocument *
+ANASTASIS_CRYPTO_recovery_document_decrypt (const struct
+                                            ANASTASIS_CRYPTO_UserIdentifier 
*id,
+                                            const void *data,
+                                            size_t data_size);
+
+
+void
+ANASTASIS_CRYPTO_recovery_document_destroy (struct
+                                            ANASTASIS_CRYPTO_RecoveryDocument 
*p);
diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am
index 9f3f37a..22eca7e 100644
--- a/src/lib/Makefile.am
+++ b/src/lib/Makefile.am
@@ -8,37 +8,52 @@ endif
 
 lib_LTLIBRARIES = \
   libanastasis.la \
+  libanastasisrest.la \
   libanastasistesting.la
 
-libanastasis_la_LDFLAGS = \
-  -version-info 0:0:0 \
-  -no-undefined
-
-libanastasistesting_la_LDFLAGS = \
+libanastasisrest_la_LDFLAGS = \
   -version-info 0:0:0 \
   -no-undefined
-
-libanastasis_la_SOURCES = \
+libanastasisrest_la_SOURCES = \
   anastasis_api_salt.c \
   anastasis_api_policy_store.c \
   anastasis_api_policy_lookup.c
+libanastasisrest_la_LIBADD = \
+  -lgnunetutil \
+  -ljansson \
+  -ltalerutil \
+  $(XLIB)
+
+if HAVE_LIBCURL
+libanastasisrest_la_LIBADD += -lcurl
+else
+if HAVE_LIBGNURL
+libanastasisrest_la_LIBADD += -lgnurl
+endif
+endif
+
 
+libanastasis_la_LDFLAGS = \
+  -version-info 0:0:0 \
+  -no-undefined
+libanastasis_la_SOURCES = \
+  anastasis.c 
 libanastasis_la_LIBADD = \
-  -lmicrohttpd \
-  -lgnunetcurl \
-  -lgnunetjson \
+  libanastasisrest.la \
   -lgnunetutil \
   -ljansson \
-  -ltalerutil
+  -ltalerutil \
   $(XLIB)
 
+libanastasistesting_la_LDFLAGS = \
+  -version-info 0:0:0 \
+  -no-undefined
 libanastasistesting_la_SOURCES = \
   testing_api_cmd_policy_store.c \
   testing_api_cmd_policy_lookup.c \
   testing_api_helpers.c 
-
 libanastasistesting_la_LIBADD = \
-  libanastasis.la \
+  libanastasisrest.la \
   -ltalerexchange \
   -ltalerjson \
   -ltalerutil \
@@ -49,23 +64,16 @@ libanastasistesting_la_LIBADD = \
   -ltalertesting \
   $(XLIB)
 
-if HAVE_LIBCURL
-libanastasis_la_LIBADD += -lcurl
-else
-if HAVE_LIBGNURL
-libanastasis_la_LIBADD += -lgnurl
-endif
-endif
   
 check_PROGRAMS = \
-  test_anastasis_api
+  test_anastasisrest_api
 
 TESTS = \
   $(check_PROGRAMS)
 
-test_anastasis_api_SOURCES = \
+test_anastasisrest_api_SOURCES = \
   test_anastasis_api.c
-test_anastasis_api_LDADD = \
+test_anastasisrest_api_LDADD = \
   $(top_srcdir)/src/stasis/libanastasisdb.la \
   libanastasis.la \
   $(LIBGCRYPT_LIBS) \
@@ -88,4 +96,4 @@ EXTRA_DIST = \
   test_anastasis_api_home/.local/share/taler/exchange/offline-keys/master.priv 
\
   test_anastasis_api_home/.config/taler/merchant/wire/test.json \
   test_anastasis_api_home/.config/taler/test.json \
-  test_merchant.priv
\ No newline at end of file
+  test_merchant.priv
diff --git a/src/lib/anastasis.c b/src/lib/anastasis.c
new file mode 100644
index 0000000..54cca83
--- /dev/null
+++ b/src/lib/anastasis.c
@@ -0,0 +1,4 @@
+struct ANASTASIS_Policy *
+ANASTASIS_polcy_create ()
+{
+}

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]