[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-anastasis] branch master updated: Initial testing of crypto
From: |
gnunet |
Subject: |
[taler-anastasis] branch master updated: Initial testing of crypto |
Date: |
Tue, 24 Mar 2020 16:48:12 +0100 |
This is an automated email from the git hooks/post-receive script.
dennis-neufeld pushed a commit to branch master
in repository anastasis.
The following commit(s) were added to refs/heads/master by this push:
new fb7e249 Initial testing of crypto
fb7e249 is described below
commit fb7e2491088c22d3533c37cead5c09ec75112914
Author: Dennis Neufeld <address@hidden>
AuthorDate: Tue Mar 24 15:47:01 2020 +0000
Initial testing of crypto
---
src/lib/test_anastasis_api.c | 2 +-
src/util/Makefile.am | 14 ++++++++-
src/util/anastasis_crypto.c | 1 -
src/util/test_anastasis_crypto.c | 65 ++++++++++++++++++++++++++++++++++++++++
4 files changed, 79 insertions(+), 3 deletions(-)
diff --git a/src/lib/test_anastasis_api.c b/src/lib/test_anastasis_api.c
index 09bd8f3..97c4c4a 100644
--- a/src/lib/test_anastasis_api.c
+++ b/src/lib/test_anastasis_api.c
@@ -345,4 +345,4 @@ main (int argc,
}
-/* end of test_merchant_api.c */
+/* end of test_anastasis_api.c */
diff --git a/src/util/Makefile.am b/src/util/Makefile.am
index f06178f..e625442 100644
--- a/src/util/Makefile.am
+++ b/src/util/Makefile.am
@@ -26,4 +26,16 @@ libanastasisutil_la_LIBADD = \
$(XLIB)
libanastasisutil_la_LDFLAGS = \
-version-info 0:0:0 \
- -export-dynamic -no-undefined
\ No newline at end of file
+ -export-dynamic -no-undefined
+
+check_PROGRAMS = \
+ test_anastasis_crypto
+
+TESTS = \
+ $(check_PROGRAMS)
+
+test_anastasis_crypto_SOURCES = \
+ test_anastasis_crypto.c
+test_anastasis_crypto_LDADD = \
+ -lgnunetutil \
+ libanastasisutil.la
\ No newline at end of file
diff --git a/src/util/anastasis_crypto.c b/src/util/anastasis_crypto.c
index 5ab0e1b..2352cda 100644
--- a/src/util/anastasis_crypto.c
+++ b/src/util/anastasis_crypto.c
@@ -158,7 +158,6 @@ ANASTASIS_CRYPTO_recovery_document_encrypt (
&nonce,
sizeof (nonce));
get_iv_key (id, &nonce, "erd", sym_key, iv);
-
gcry_cipher_open (&cipher,
GCRY_CIPHER_AES256,
GCRY_CIPHER_MODE_GCM,
diff --git a/src/util/test_anastasis_crypto.c b/src/util/test_anastasis_crypto.c
new file mode 100644
index 0000000..3e1f224
--- /dev/null
+++ b/src/util/test_anastasis_crypto.c
@@ -0,0 +1,65 @@
+/*
+ This file is part of TALER
+ Copyright (C) 2014-2020 Taler Systems SA
+
+ TALER is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 3, or
+ (at your option) any later version.
+
+ TALER is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public
+ License along with TALER; see the file COPYING. If not, see
+ <http://www.gnu.org/licenses/>
+*/
+
+/**
+ * @file lib/test_anastasis_api.c
+ * @brief testcase to test anastasis' HTTP API interface
+ * @author Christian Grothoff
+ * @author Dennis Neufeld
+ * @author Dominik Meister
+ */
+#include "platform.h"
+#include "anastasis_crypto_lib.h"
+
+static int test_recovery_document ()
+{
+ void *ciphertext;
+ size_t size_ciphertext;
+ void *plaintext;
+ size_t size_plaintext;
+ const struct ANASTASIS_CRYPTO_UserIdentifier *id;
+ GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_NONCE,
+ &id,
+ sizeof (id));
+
+ ANASTASIS_CRYPTO_recovery_document_encrypt (id,
+ "Test",
+ strlen ("Test"),
+ &ciphertext,
+ &size_ciphertext);
+
+ /*ANASTASIS_CRYPTO_recovery_document_decrypt (id,
+ ciphertext,
+ size_ciphertext,
+ &plaintext,
+ &size_plaintext);*/
+ return 1;
+}
+
+int
+main (int argc,
+ const char *const argv[])
+{
+ if (0 != test_recovery_document ())
+ return 1;
+
+ return 0;
+}
+
+/* end of test_anastasis_crypto.c */
--
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: Initial testing of crypto,
gnunet <=