From 137658e3a41c09b4aa7b9125e4d9f65f16e2facc Mon Sep 17 00:00:00 2001 From: tknall Date: Fri, 13 Jun 2008 11:45:39 +0000 Subject: Detection of incremental updates updated. Bug fixed. There was an error concerning empty HashInputData parsing a MOA CreateXMLSignatureResponse. Demo source for API usage created. Issue resolved: Prevent signature of empty document which leads to a meaningless error message from the bku. git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@284 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c --- src/main/java/at/knowcenter/wag/egov/egiz/PdfAS.java | 2 +- .../at/knowcenter/wag/egov/egiz/sig/connectors/bku/BKUHelper.java | 5 ++--- .../java/at/knowcenter/wag/egov/egiz/web/servlets/SignServlet.java | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) (limited to 'src/main/java/at/knowcenter/wag') diff --git a/src/main/java/at/knowcenter/wag/egov/egiz/PdfAS.java b/src/main/java/at/knowcenter/wag/egov/egiz/PdfAS.java index 1b4a210..7a15893 100644 --- a/src/main/java/at/knowcenter/wag/egov/egiz/PdfAS.java +++ b/src/main/java/at/knowcenter/wag/egov/egiz/PdfAS.java @@ -96,7 +96,7 @@ public abstract class PdfAS * The current version of the pdf-as library. This version string is logged on every invocation * of the api or the web application. */ - public static final String PDFAS_VERSION = "3.0.5-20080612"; + public static final String PDFAS_VERSION = "3.0.5-20080613"; /** * The key of the strict mode setting. diff --git a/src/main/java/at/knowcenter/wag/egov/egiz/sig/connectors/bku/BKUHelper.java b/src/main/java/at/knowcenter/wag/egov/egiz/sig/connectors/bku/BKUHelper.java index 1ddd327..68fcad4 100644 --- a/src/main/java/at/knowcenter/wag/egov/egiz/sig/connectors/bku/BKUHelper.java +++ b/src/main/java/at/knowcenter/wag/egov/egiz/sig/connectors/bku/BKUHelper.java @@ -447,10 +447,9 @@ public final class BKUHelper Matcher b64_m_s = b64_p_s.matcher(hashInputData); Matcher b64_m_e = b64_p_e.matcher(hashInputData); - b64_m_s.find(); - b64_m_e.find(); + boolean hashInputDataFound = b64_m_s.find() && b64_m_e.find(); - String b64 = hashInputData.substring(b64_m_s.end(), b64_m_e.start()); + String b64 = hashInputDataFound ? hashInputData.substring(b64_m_s.end(), b64_m_e.start()) : ""; sig_res.setHashInputData(b64); } diff --git a/src/main/java/at/knowcenter/wag/egov/egiz/web/servlets/SignServlet.java b/src/main/java/at/knowcenter/wag/egov/egiz/web/servlets/SignServlet.java index a608b74..9b340e6 100644 --- a/src/main/java/at/knowcenter/wag/egov/egiz/web/servlets/SignServlet.java +++ b/src/main/java/at/knowcenter/wag/egov/egiz/web/servlets/SignServlet.java @@ -293,7 +293,7 @@ public class SignServlet extends HttpServlet return; } - + SignServletHelper.finishSign(si, request, response, getServletContext()); // for performance measurement -- cgit v1.2.3