From 53b50fbb42d20b5ed780f9779bcd934276fa3cf8 Mon Sep 17 00:00:00 2001 From: gregor Date: Tue, 1 Feb 2005 17:57:09 +0000 Subject: *** empty log message *** git-svn-id: https://joinup.ec.europa.eu/svn/moa-idspss/trunk@268 d688527b-c9ab-4aba-bd8d-4036d912da1d --- spss.slinterface/.classpath | 37 +++++++++++---------- .../moa/spss/slinterface/beans/DataInfoBean.java | 26 +++++++++++---- .../moa/spss/slinterface/filters/SL2MOAFilter.java | 17 ++++++++-- spss.slinterface/moa-spss-sl.war | Bin 8110512 -> 0 bytes .../res/resources/properties/init.properties | 2 +- .../res/resources/schemas/xmldsig-core-schema.xsd | 6 +++- 6 files changed, 60 insertions(+), 28 deletions(-) delete mode 100644 spss.slinterface/moa-spss-sl.war (limited to 'spss.slinterface') diff --git a/spss.slinterface/.classpath b/spss.slinterface/.classpath index 99f657d27..b38aab79c 100644 --- a/spss.slinterface/.classpath +++ b/spss.slinterface/.classpath @@ -1,21 +1,22 @@ - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + diff --git a/spss.slinterface/WEB-INF/src/at/gv/egovernment/moa/spss/slinterface/beans/DataInfoBean.java b/spss.slinterface/WEB-INF/src/at/gv/egovernment/moa/spss/slinterface/beans/DataInfoBean.java index 94e3dac22..76b06605b 100644 --- a/spss.slinterface/WEB-INF/src/at/gv/egovernment/moa/spss/slinterface/beans/DataInfoBean.java +++ b/spss.slinterface/WEB-INF/src/at/gv/egovernment/moa/spss/slinterface/beans/DataInfoBean.java @@ -25,7 +25,6 @@ import java.util.Set; import java.util.StringTokenizer; import javax.servlet.ServletContext; -import javax.servlet.http.HttpSession; import javax.servlet.http.HttpSessionBindingEvent; import javax.servlet.http.HttpSessionBindingListener; @@ -40,6 +39,7 @@ import org.xml.sax.InputSource; import at.gv.egovernment.moa.spss.slinterface.Constants; import at.gv.egovernment.moa.spss.slinterface.DOMUtils; +import at.gv.egovernment.moa.spss.slinterface.URLRewriter; import at.gv.egovernment.moa.spss.slinterface.XPathUtils; import at.gv.egovernment.moa.spss.slinterface.moainvoker.MOAInvoker; @@ -79,8 +79,10 @@ public class DataInfoBean implements HttpSessionBindingListener private static final String SLMANIFEST_TYPE_ = "http://www.buergerkarte.at/specifications/Securitylayer/20020225#SignatureManifest"; - ServletContext context_; + String contextPath_; + String sessionId_; + Properties initProps_; /** @@ -92,10 +94,12 @@ public class DataInfoBean implements HttpSessionBindingListener /* ---------------------------------------------------------------------------------------------------- */ - public DataInfoBean(Document moaRequestDoc, Document moaResponseDoc, ServletContext context, - HttpSession session) throws Exception + public DataInfoBean(Document moaRequestDoc, Document moaResponseDoc, String contextPath, String sessionId, + ServletContext context) throws Exception { context_ = context; + contextPath_ = contextPath; + sessionId_ = sessionId; initProps_ = (Properties) context_.getAttribute(Constants.WSCP_INIT_PROPS_); hashInputDataInfos_ = new ArrayList(); @@ -116,7 +120,7 @@ public class DataInfoBean implements HttpSessionBindingListener for (int i = 0; i < hidElems.size(); i++) { // Open file for current hash input data - String currHidFileNameStr = tempDir + session.getId() + "_" + System.currentTimeMillis() + "_" + + String currHidFileNameStr = tempDir + sessionId_ + "_" + System.currentTimeMillis() + "_" + random.nextLong(); currHidFileNameStr = context_.getRealPath(currHidFileNameStr); FileOutputStream currHidFOS; @@ -162,6 +166,7 @@ public class DataInfoBean implements HttpSessionBindingListener hashInputDataInfos_.add(new HashInputDataInfo(currHidFileNameStr)); } + logger_.debug("Finnished writing hash input data to files."); // Check if hids are slxhtml documents; mark them appropriately try @@ -180,6 +185,7 @@ public class DataInfoBean implements HttpSessionBindingListener logger_.error(message, e); throw new Exception(message, e); } + logger_.debug("Finnished checking hash input data for slxhtml conformity."); } /* ---------------------------------------------------------------------------------------------------- */ @@ -320,9 +326,17 @@ public class DataInfoBean implements HttpSessionBindingListener Attr srcAttr = currImgElem.getAttributeNode(SRC_ATTR_); int slashPos = currHidi.filename_.lastIndexOf('\\'); + +// Properties initProps = (Properties) context_.getAttribute(Constants.WSCP_INIT_PROPS_); +// String tempDir = initProps.getProperty(Constants.IP_TEMP_DIR_); +// String newSrcAttrValue = "." + tempDir + currHidi.filename_.substring(slashPos + 1); + Properties initProps = (Properties) context_.getAttribute(Constants.WSCP_INIT_PROPS_); String tempDir = initProps.getProperty(Constants.IP_TEMP_DIR_); - String newSrcAttrValue = "." + tempDir + currHidi.filename_.substring(slashPos + 1); + URLRewriter urlRewriter = (URLRewriter) context_.getAttribute(Constants.WSCP_URL_REWRITER_); + String newSrcAttrValue = urlRewriter.rewrite( + contextPath_ + tempDir + currHidi.filename_.substring(slashPos + 1), sessionId_); + srcAttr.setNodeValue(newSrcAttrValue); } diff --git a/spss.slinterface/WEB-INF/src/at/gv/egovernment/moa/spss/slinterface/filters/SL2MOAFilter.java b/spss.slinterface/WEB-INF/src/at/gv/egovernment/moa/spss/slinterface/filters/SL2MOAFilter.java index b67d978ad..28ceb7ac6 100644 --- a/spss.slinterface/WEB-INF/src/at/gv/egovernment/moa/spss/slinterface/filters/SL2MOAFilter.java +++ b/spss.slinterface/WEB-INF/src/at/gv/egovernment/moa/spss/slinterface/filters/SL2MOAFilter.java @@ -94,6 +94,7 @@ public class SL2MOAFilter implements Filter // Schema validate SL request CharArrayReader slXmlRequestCAR = new CharArrayReader(slRequest.xmlRequest_.toCharArray()); Document slXMLRequestDoc = parseSlXmlRequest(slXmlRequestCAR); + logger_.debug("Finnished schema validating SL request."); // Transform SL request into a MOA SPSS request Properties initProps = (Properties)config_.getServletContext().getAttribute(Constants.WSCP_INIT_PROPS_); @@ -103,11 +104,13 @@ public class SL2MOAFilter implements Filter MOAInvoker.serializeDocument(moaXMLRequestDoc, moaRequestBOS); logger_.debug("SL request transformed into MOA request:\n" + moaRequestBOS); ByteArrayInputStream moaRequestIS = new ByteArrayInputStream(moaRequestBOS.toByteArray()); + logger_.debug("Finnished transforming SL request into a MOA SP request."); // Invoke MOA SPSS RequestWrapper requestWrapper = new RequestWrapper((HttpServletRequest) request, moaRequestIS); ResponseWrapper responseWrapper = new ResponseWrapper((HttpServletResponse) response); chain.doFilter(requestWrapper, responseWrapper); + logger_.debug("Finnished invoking MOA SP service."); // Parse MOA response DOMParser xmlParser = (DOMParser) config_.getServletContext().getAttribute(Constants.WSCP_XMLPARSER_); @@ -126,12 +129,17 @@ public class SL2MOAFilter implements Filter logger_.error(message, e); throw new ServletException(message, e); } + logger_.debug("Finnished parsing MOA SP response."); // Create bean with info about signed data try { - DataInfoBean dataInfo = new DataInfoBean( - moaXMLRequestDoc, moaResponseDoc, config_.getServletContext(), session); + DataInfoBean dataInfo = new DataInfoBean( + moaXMLRequestDoc, + moaResponseDoc, + ((HttpServletRequest) request).getContextPath(), + session.getId(), + config_.getServletContext()); session.setAttribute("dataInfo", dataInfo); } catch (Exception e) @@ -140,19 +148,23 @@ public class SL2MOAFilter implements Filter logger_.error(message, e); throw new ServletException(message, e); } + logger_.debug("Finnished creating bean with info about signed data."); // Transform MOA response into a SL response Document slResponseDoc; slResponseDoc = MOA2SL.toSlVerifyXMLSignatureResponse(moaResponseDoc); session.setAttribute("slResponseDoc", slResponseDoc); + logger_.debug("Finnished transforming MOA SP response into a SL response."); // Create bean with info about signer SignerInfoBean signerInfo = new SignerInfoBean(slResponseDoc); request.setAttribute("signerInfo", signerInfo); + logger_.debug("Finnished creating bean with info about signer."); // Create bean with info about checks ChecksInfoBean checksInfo = new ChecksInfoBean(slResponseDoc); request.setAttribute("checksInfo", checksInfo); + logger_.debug("Finnished creating bean with info about checks."); // Include jsp page, which writes the overview information about the verified signature response.setContentType("text/html"); @@ -167,6 +179,7 @@ public class SL2MOAFilter implements Filter logger_.error(message, e); throw new ServletException(message, e); } + logger_.debug("Finnished SL2MOAFilter."); } /* ---------------------------------------------------------------------------------------------------- */ diff --git a/spss.slinterface/moa-spss-sl.war b/spss.slinterface/moa-spss-sl.war deleted file mode 100644 index 5c49c230e..000000000 Binary files a/spss.slinterface/moa-spss-sl.war and /dev/null differ diff --git a/spss.slinterface/res/resources/properties/init.properties b/spss.slinterface/res/resources/properties/init.properties index 634fff872..a2361840c 100644 --- a/spss.slinterface/res/resources/properties/init.properties +++ b/spss.slinterface/res/resources/properties/init.properties @@ -8,7 +8,7 @@ location.schema.slxhtml = /WEB-INF/classes/resources/schemas/slxhtml-1.0/slxhtml location.tempdir = /workDir/temp/ service.sp.endpoint = http://localhost:8080/moa-spss/services/SignatureVerification -service.sp.trustProfileId = TrustProfile1 +service.sp.trustProfileId = E-Recht result.showetsi = false result.showslmanifest = false diff --git a/spss.slinterface/res/resources/schemas/xmldsig-core-schema.xsd b/spss.slinterface/res/resources/schemas/xmldsig-core-schema.xsd index df126b30e..801b01416 100644 --- a/spss.slinterface/res/resources/schemas/xmldsig-core-schema.xsd +++ b/spss.slinterface/res/resources/schemas/xmldsig-core-schema.xsd @@ -115,7 +115,11 @@ - + + + + -- cgit v1.2.3