[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [libebics] 01/02: Testing and message generation.
From: |
gnunet |
Subject: |
[GNUnet-SVN] [libebics] 01/02: Testing and message generation. |
Date: |
Mon, 29 Oct 2018 12:54:21 +0100 |
This is an automated email from the git hooks/post-receive script.
marcello pushed a commit to branch master
in repository libebics.
commit c0363b00d49fab41130dd3586a6872e2163ca0a0
Author: Marcello Stanisci <address@hidden>
AuthorDate: Mon Oct 29 12:47:06 2018 +0100
Testing and message generation.
Add a shell script that checks the validity of messages,
and remove the 'Product' optional node.
---
src/Makefile.am | 3 +++
src/xmllint.sh | 13 +++++++++++++
src/xmlmessages.c | 19 ++++++++-----------
3 files changed, 24 insertions(+), 11 deletions(-)
diff --git a/src/Makefile.am b/src/Makefile.am
index bb01775..9f255b8 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -35,6 +35,9 @@ libebics_CPPFLAGS = \
AM_TESTS_ENVIRONMENT = \
export EBICS_PREFIX=$(prefix);
+TESTS = \
+ xmllint.sh
+
check_PROGRAMS = \
sandbox_tests
diff --git a/src/xmllint.sh b/src/xmllint.sh
new file mode 100755
index 0000000..a1ca2d8
--- /dev/null
+++ b/src/xmllint.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+xmllint --noout \
+ --schema ../contrib/ebics_schema/ebics_keymgmt_request_H004.xsd \
+ INI.xml
+
+xmllint --noout \
+ --schema ../contrib/ebics_schema/ebics_keymgmt_request_H004.xsd \
+ HIA.xml
+
+xmllint --noout \
+ --schema ../contrib/ebics_schema/ebics_keymgmt_request_H004.xsd \
+ HPB.xml
diff --git a/src/xmlmessages.c b/src/xmlmessages.c
index 3e60884..96033f9 100644
--- a/src/xmlmessages.c
+++ b/src/xmlmessages.c
@@ -203,14 +203,9 @@ EBICS_build_header_generic (void *cls,
data->partnerID),
EBICS_MSG_op_set_string ("//ebics:static//ebics:UserID",
data->userID),
- EBICS_MSG_op_set_string ("//ebics:static//ebics:Product",
- data->productName),
EBICS_MSG_op_set_string
("//ebics:static//ebics:SecurityMedium",
"0000"),
- EBICS_MSG_op_set_attribute
- ("//ebics:static//ebics:Product/@Language",
- data->languageCode),
EBICS_MSG_op_unique_choice ("//ebics:OrderDetails"),
EBICS_MSG_op_end ()
};
@@ -772,9 +767,10 @@ EBICS_sign_message (const struct EBICS_Key
*userAuthentication,
nodeset = xpathObjPtr->nodesetval;
node = nodeset->nodeTab[0];
xmlXPathFreeObject (xpathObjPtr);
- ns = xmlSearchNsByHref (document->document,
- node,
- BAD_CAST "http://www.w3.org/2000/09/xmldsig#");
+ ns = xmlSearchNsByHref
+ (document->document,
+ node,
+ BAD_CAST "http://www.w3.org/2000/09/xmldsig#");
xmlNodeSetName (node,
BAD_CAST "Signature");
node->ns = ns;
@@ -784,9 +780,10 @@ EBICS_sign_message (const struct EBICS_Key
*userAuthentication,
dsigCtx = NULL;
res = -1;
- node = xmlSecFindNode (xmlDocGetRootElement (document->document),
- xmlSecNodeSignature,
- BAD_CAST "http://www.w3.org/2000/09/xmldsig#");
+ node = xmlSecFindNode
+ (xmlDocGetRootElement (document->document),
+ xmlSecNodeSignature,
+ BAD_CAST "http://www.w3.org/2000/09/xmldsig#");
if (NULL == node)
{
--
To stop receiving notification emails like this one, please contact
address@hidden