gnunet-svn
[Top][All Lists]
Advanced

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

[libeufin] branch master updated: nexus validates documents before sendi


From: gnunet
Subject: [libeufin] branch master updated: nexus validates documents before sending them
Date: Tue, 07 Jul 2020 18:34:16 +0200

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

ms pushed a commit to branch master
in repository libeufin.

The following commit(s) were added to refs/heads/master by this push:
     new 0548af5  nexus validates documents before sending them
0548af5 is described below

commit 0548af54868dc13014332f0656c6b7aac1881b1f
Author: MS <ms@taler.net>
AuthorDate: Tue Jul 7 18:33:53 2020 +0200

    nexus validates documents before sending them
---
 nexus/src/main/kotlin/tech/libeufin/nexus/ebics/EbicsClient.kt | 3 +++
 nexus/src/main/kotlin/tech/libeufin/nexus/ebics/EbicsNexus.kt  | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/ebics/EbicsClient.kt 
b/nexus/src/main/kotlin/tech/libeufin/nexus/ebics/EbicsClient.kt
index e15bc0f..b059b2d 100644
--- a/nexus/src/main/kotlin/tech/libeufin/nexus/ebics/EbicsClient.kt
+++ b/nexus/src/main/kotlin/tech/libeufin/nexus/ebics/EbicsClient.kt
@@ -31,6 +31,9 @@ import java.util.*
 
 private suspend inline fun HttpClient.postToBank(url: String, body: String): 
String {
     logger.debug("Posting: $body")
+    if (!XMLUtil.validateFromString(body)) throw NexusError(
+        HttpStatusCode.InternalServerError, "EBICS (outgoing) document is 
invalid"
+    )
     val response: String = try {
         this.post<String>(
             urlString = url,
diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/ebics/EbicsNexus.kt 
b/nexus/src/main/kotlin/tech/libeufin/nexus/ebics/EbicsNexus.kt
index 92c119f..9affd67 100644
--- a/nexus/src/main/kotlin/tech/libeufin/nexus/ebics/EbicsNexus.kt
+++ b/nexus/src/main/kotlin/tech/libeufin/nexus/ebics/EbicsNexus.kt
@@ -763,6 +763,9 @@ suspend fun submitEbicsPaymentInitiation(httpClient: 
HttpClient, paymentInitiati
                 endToEndId = paymentInitiation.endToEndId
             )
         )
+        if (!XMLUtil.validateFromString(painMessage)) throw NexusError(
+            HttpStatusCode.InternalServerError, "Pain.001 message is invalid."
+        )
         object {
             val subscriberDetails = subscriberDetails
             val painMessage = painMessage

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

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