gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [libebics] 01/03: Fix Revision and Version attributes for H


From: gnunet
Subject: [GNUnet-SVN] [libebics] 01/03: Fix Revision and Version attributes for HPBs.
Date: Fri, 26 Oct 2018 11:51:03 +0200

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

marcello pushed a commit to branch master
in repository libebics.

commit a99ffe5bcf02ca00f8e148a3d04983209be439d3
Author: Marcello Stanisci <address@hidden>
AuthorDate: Fri Oct 26 08:55:57 2018 +0200

    Fix Revision and Version attributes for HPBs.
---
 src/libebics.c      |  6 ++++--
 src/sandbox_tests.c | 25 +++++++++++++++++++++++++
 src/xmlmessages.c   | 21 ++++++++++++++++-----
 src/xmlmessages.h   | 23 +++++++++++++----------
 4 files changed, 58 insertions(+), 17 deletions(-)

diff --git a/src/libebics.c b/src/libebics.c
index e025c6a..a915766 100644
--- a/src/libebics.c
+++ b/src/libebics.c
@@ -966,10 +966,12 @@ EBICS_generate_message_hia
  *
  * @param header_args TODO
  * @param auth_args TODO
- * @return pointer to a freshly allocated document, NULL upon errors.
+ * @return pointer to a freshly allocated document,
+ *         NULL upon errors.
  */
 struct EBICS_genex_document *
-EBICS_generate_message_hpb (struct EBICS_ARGS_build_header *header_args)
+EBICS_generate_message_hpb
+  (struct EBICS_ARGS_build_header *header_args)
 {
 
   struct EBICS_genex_document *instance;
diff --git a/src/sandbox_tests.c b/src/sandbox_tests.c
index 5b14ded..d33e7dd 100644
--- a/src/sandbox_tests.c
+++ b/src/sandbox_tests.c
@@ -211,6 +211,31 @@ run ()
   #endif
   GNUNET_free (msg);
 
+  /**
+   * HPB
+   */
+  if (NULL == (msg = EBICS_generate_message_hpb
+      (&header_args)))
+  {
+    LOG (EBICS_LOGLEVEL_ERROR,
+        "Failed to instantiate HPB message\n");
+    return;
+  }
+
+  #ifdef ONLINE_SANDBOX
+  if (EBICS_SUCCESS != EBICS_send_message (msg,
+                                           BANK_URL,
+                                           cb))
+  {
+    LOG (EBICS_LOGLEVEL_ERROR,
+         "Could not POST the HIA message\n");
+    return;
+  }
+  #else
+  write_xml_file ("HPB.xml",
+                  msg);
+  #endif
+  GNUNET_free (msg);
 
   result = EBICS_SUCCESS;
 }
diff --git a/src/xmlmessages.c b/src/xmlmessages.c
index bc8512a..f83d2e3 100644
--- a/src/xmlmessages.c
+++ b/src/xmlmessages.c
@@ -252,16 +252,15 @@ EBICS_build_header_ebicsUnsecuredRequest
    struct EBICS_genex_document *document)
 {
   struct EBICS_MSG_Spec header[] = {
+
     EBICS_MSG_op_subcommand (EBICS_build_header_generic,
                              cls),
     EBICS_MSG_op_set_string
       ("ebics:ebicsUnsecuredRequest/@Version",
        EBICS_MSG_VERSION),
-
     EBICS_MSG_op_set_uint
       ("ebics:ebicsUnsecuredRequest/@Revision",
        EBICS_REVISION),
-
     EBICS_MSG_op_set_string
       ("//ebics:OrderDetails/ebics:OrderAttribute",
        "DZNNN"),
@@ -270,7 +269,7 @@ EBICS_build_header_ebicsUnsecuredRequest
   };
 
   EBICS_MSG_parse_spec (header,
-                      document);
+                        document);
 }
 
 
@@ -291,8 +290,20 @@ EBICS_build_header_ebicsNoPubKeyDigestsRequest
 
   struct EBICS_MSG_Spec header[] = {
 
-    EBICS_MSG_op_subcommand (EBICS_build_header_generic,
-                             cls),
+    EBICS_MSG_op_subcommand
+      (EBICS_build_header_generic,
+       cls),
+    EBICS_MSG_op_set_string
+      ("ebics:ebicsNoPubKeyDigestsRequest/@Version",
+       EBICS_MSG_VERSION),
+    EBICS_MSG_op_set_uint
+      ("ebics:ebicsNoPubKeyDigestsRequest/@Revision",
+       EBICS_REVISION),
+
+    EBICS_MSG_op_set_string
+      ("//ebics:OrderDetails/ebics:OrderAttribute",
+       "DZHNN"),
+
     EBICS_MSG_op_set_string ("//ebics:static//ebics:Nonce",
                              tools_get_nonce (nonce)),
     EBICS_MSG_op_set_string ("//ebics:static//ebics:Timestamp",
diff --git a/src/xmlmessages.h b/src/xmlmessages.h
index 4d6efd0..30191d8 100644
--- a/src/xmlmessages.h
+++ b/src/xmlmessages.h
@@ -1,16 +1,19 @@
 /*
   This file is part of libfints
 
-  libfints 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.
-
-  libfints 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
-  libfints; see the file COPYING.  If not, If not, see 
<http://www.gnu.org/license>
+  libfints 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.
+
+  Libfints 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 libfints; see the file COPYING.  If not,
+  see <http://www.gnu.org/license>
 */
 
 #ifndef EBICS_XML_MESSAGES_H

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



reply via email to

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