gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [libfints] branch master updated (1d61b42 -> cf04ea2)


From: gnunet
Subject: [GNUnet-SVN] [libfints] branch master updated (1d61b42 -> cf04ea2)
Date: Fri, 12 Oct 2018 09:55:32 +0200

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

marcello pushed a change to branch master
in repository libfints.

    from 1d61b42  Cosmetics.
     new 719d7d8  init method takes key dir in args.
     new 5294287  Make test keys.
     new cf04ea2  Tests.

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 contrib/Makefile.am                                  |  5 +----
 src/libebics.c                                       | 20 +++++++++++++-------
 src/libebics.h                                       |  4 +++-
 .../bankAuthKey.pem => src/test_keys/testAuthKey.pem |  0
 .../bankEncKey.pem => src/test_keys/testEncKey.pem   |  0
 .../bankSigKey.pem => src/test_keys/testSigKey.pem   |  0
 src/tests.c                                          | 12 +++++++++++-
 7 files changed, 28 insertions(+), 13 deletions(-)
 rename contrib/bankAuthKey.pem => src/test_keys/testAuthKey.pem (100%)
 rename contrib/bankEncKey.pem => src/test_keys/testEncKey.pem (100%)
 rename contrib/bankSigKey.pem => src/test_keys/testSigKey.pem (100%)

diff --git a/contrib/Makefile.am b/contrib/Makefile.am
index d24f5a3..8a803c4 100644
--- a/contrib/Makefile.am
+++ b/contrib/Makefile.am
@@ -10,10 +10,7 @@ xml_templates = \
 key_files = \
   userAuthKey.pem \
   userSigKey.pem \
-  userEncKey.pem \
-  bankAuthKey.pem \
-  bankSigKey.pem \
-  bankEncKey.pem
+  userEncKey.pem
 
 $(xml_templates):
        ./genex.py ebics_schema/ebics_request_H004.xsd \
diff --git a/src/libebics.c b/src/libebics.c
index ee145fb..3af8d4c 100644
--- a/src/libebics.c
+++ b/src/libebics.c
@@ -271,10 +271,10 @@ free_zlib ()
  *          EBICS_ERROR on non critical errors
  *          and EBICS_FATAL else.
  */
-int
-EBICS_init_keymaterial (struct EBICS_Key keyList[],
-                        char *keyDir,
-                        const char *keyFiles[])
+static int
+init_keymaterial (struct EBICS_Key keyList[],
+                  const char *keyDir,
+                  const char *keyFiles[])
 {
   int retv;
   int result = EBICS_SUCCESS;
@@ -514,12 +514,18 @@ free_genex_documents (struct EBICS_genex_document 
genexList[])
  * as well as it allocates the "genex" templates to
  * be copied and instantiated during the library life.
  *
+ * @param key_dir directory where keys to be imported
+ *        are located.
  * @return EBICS_SUCCESS or EBICS_ERROR.
  */
 int
-EBICS_init_library ()
+EBICS_init_library (const char *key_dir)
 {
   int retv;
+
+  /**
+   * Directory where XML templates are stored.
+   */
   char *data_dir;
 
   const char *genexFilenames[EBICS_GENEX_MAX_ENTRIES] = {
@@ -571,9 +577,9 @@ EBICS_init_library ()
     return EBICS_ERROR;
   }
 
-  if (EBICS_SUCCESS != EBICS_init_keymaterial
+  if (EBICS_SUCCESS != init_keymaterial
       (keyList,
-       data_dir,
+       key_dir,
        keyFilenames))
   {
     GNUNET_break (0);
diff --git a/src/libebics.h b/src/libebics.h
index 50eb167..57cce3a 100644
--- a/src/libebics.h
+++ b/src/libebics.h
@@ -52,10 +52,12 @@
  * as well as it allocates the "genex" templates to
  * be copied and instantiated during the library life.
  *
+ * @param key_dir directory where keys to be imported
+ *        are located.
  * @return EBICS_SUCCESS or EBICS_ERROR.
  */
 int
-EBICS_init_library ();
+EBICS_init_library (const char *key_dir);
 
 
 /**
diff --git a/contrib/bankAuthKey.pem b/src/test_keys/testAuthKey.pem
similarity index 100%
rename from contrib/bankAuthKey.pem
rename to src/test_keys/testAuthKey.pem
diff --git a/contrib/bankEncKey.pem b/src/test_keys/testEncKey.pem
similarity index 100%
rename from contrib/bankEncKey.pem
rename to src/test_keys/testEncKey.pem
diff --git a/contrib/bankSigKey.pem b/src/test_keys/testSigKey.pem
similarity index 100%
rename from contrib/bankSigKey.pem
rename to src/test_keys/testSigKey.pem
diff --git a/src/tests.c b/src/tests.c
index 5a839e2..64a63b5 100644
--- a/src/tests.c
+++ b/src/tests.c
@@ -54,10 +54,20 @@ struct EBICS_ARGS_build_content_ini ini_args = {
 int
 main (int argc, char **argv)
 {
+  #define KEYS_DIR "./test_keys"
+
   unsetenv ("XDG_DATA_HOME");
   unsetenv ("XDG_CONFIG_HOME");
 
-  if (EBICS_SUCCESS != EBICS_init_library ()) 
+  const char *key_filenames[] = {
+    "testAuthKey",
+    "testEncKey",
+    "testSigKey",
+    NULL
+  };
+
+  if (EBICS_SUCCESS != EBICS_init_library (KEYS_DIR,
+                                           key_filenames)) 
   {
     LOG (EBICS_FATAL,
          "no init lib");

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



reply via email to

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