diff options
author | gregor <gregor@d688527b-c9ab-4aba-bd8d-4036d912da1d> | 2005-02-01 17:57:09 +0000 |
---|---|---|
committer | gregor <gregor@d688527b-c9ab-4aba-bd8d-4036d912da1d> | 2005-02-01 17:57:09 +0000 |
commit | 53b50fbb42d20b5ed780f9779bcd934276fa3cf8 (patch) | |
tree | 05ae9a1c6c5a3961c3140e6a5b91d4a5fd39212d /spss.slinterface | |
parent | 71876f10c811565e4f041333d91d83b65866dd48 (diff) | |
download | moa-id-spss-53b50fbb42d20b5ed780f9779bcd934276fa3cf8.tar.gz moa-id-spss-53b50fbb42d20b5ed780f9779bcd934276fa3cf8.tar.bz2 moa-id-spss-53b50fbb42d20b5ed780f9779bcd934276fa3cf8.zip |
*** empty log message ***
git-svn-id: https://joinup.ec.europa.eu/svn/moa-idspss/trunk@268 d688527b-c9ab-4aba-bd8d-4036d912da1d
Diffstat (limited to 'spss.slinterface')
-rw-r--r-- | spss.slinterface/.classpath | 37 | ||||
-rw-r--r-- | spss.slinterface/WEB-INF/src/at/gv/egovernment/moa/spss/slinterface/beans/DataInfoBean.java | 26 | ||||
-rw-r--r-- | spss.slinterface/WEB-INF/src/at/gv/egovernment/moa/spss/slinterface/filters/SL2MOAFilter.java | 17 | ||||
-rw-r--r-- | spss.slinterface/moa-spss-sl.war | bin | 8110512 -> 0 bytes | |||
-rw-r--r-- | spss.slinterface/res/resources/properties/init.properties | 2 | ||||
-rw-r--r-- | spss.slinterface/res/resources/schemas/xmldsig-core-schema.xsd | 6 |
6 files changed, 60 insertions, 28 deletions
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 @@ <?xml version="1.0" encoding="UTF-8"?> <classpath> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> - <classpathentry kind="var" path="TOMCAT_HOME/common/lib/servlet.jar"/> - <classpathentry kind="var" path="TOMCAT_HOME/common/lib/jasper-runtime.jar"/> - <classpathentry kind="src" path="WEB-INF/src"/> - <classpathentry kind="src" path="res"/> - <classpathentry kind="lib" path="WEB-INF/lib/log4j-1.2.7.jar"/> - <classpathentry kind="lib" path="WEB-INF/lib/xalan-2.5.1.jar"/> - <classpathentry kind="lib" path="WEB-INF/lib/commons-fileupload-1.0.jar"/> - <classpathentry kind="lib" path="WEB-INF/lib/axis.jar"/> - <classpathentry kind="lib" path="WEB-INF/lib/axis-ant.jar"/> - <classpathentry kind="lib" path="WEB-INF/lib/commons-discovery.jar"/> - <classpathentry kind="lib" path="WEB-INF/lib/commons-logging.jar"/> - <classpathentry kind="lib" path="WEB-INF/lib/jaxrpc.jar"/> - <classpathentry kind="lib" path="WEB-INF/lib/saaj.jar"/> - <classpathentry kind="lib" path="WEB-INF/lib/wsdl4j.jar"/> - <classpathentry kind="lib" path="WEB-INF/lib/xerces-2.6.0exBug24783/xercesImpl.jar"/> - <classpathentry kind="lib" path="WEB-INF/lib/xerces-2.6.0exBug24783/xmlParserAPIs.jar"/> - <classpathentry kind="output" path="WEB-INF/classes"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="src" path="WEB-INF/src"/> + <classpathentry kind="src" path="res"/> + <classpathentry kind="lib" path="WEB-INF/lib/log4j-1.2.7.jar"/> + <classpathentry kind="lib" path="WEB-INF/lib/xalan-2.5.1.jar"/> + <classpathentry kind="lib" path="WEB-INF/lib/commons-fileupload-1.0.jar"/> + <classpathentry kind="lib" path="WEB-INF/lib/axis.jar"/> + <classpathentry kind="lib" path="WEB-INF/lib/axis-ant.jar"/> + <classpathentry kind="lib" path="WEB-INF/lib/commons-discovery.jar"/> + <classpathentry kind="lib" path="WEB-INF/lib/commons-logging.jar"/> + <classpathentry kind="lib" path="WEB-INF/lib/jaxrpc.jar"/> + <classpathentry kind="lib" path="WEB-INF/lib/saaj.jar"/> + <classpathentry kind="lib" path="WEB-INF/lib/wsdl4j.jar"/> + <classpathentry kind="lib" path="WEB-INF/lib/xerces-2.6.0exBug24783/xercesImpl.jar"/> + <classpathentry kind="lib" path="WEB-INF/lib/xerces-2.6.0exBug24783/xmlParserAPIs.jar"/> + <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/IAIK JCE 3.0.3 signiert"/> + <classpathentry kind="var" path="TOMCAT_HOME/common/lib/servlet.jar"/> + <classpathentry kind="var" path="TOMCAT_HOME/common/lib/jasper-runtime.jar"/> + <classpathentry kind="output" path="WEB-INF/classes"/> </classpath> 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 Binary files differdeleted file mode 100644 index 5c49c230e..000000000 --- a/spss.slinterface/moa-spss-sl.war +++ /dev/null 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 @@ <element name="Transform" type="ds:TransformType"/> <complexType name="TransformType" mixed="true"> <choice minOccurs="0" maxOccurs="unbounded"> - <any namespace="##other" processContents="lax"/> + + <!--<any namespace="##other" processContents="lax"/> + Changed GK 20040621: Avoid parsing errors when parsing html/stylesheet markup --> + <any namespace="##other" processContents="skip"/> + <!-- (1,1) elements from (0,unbounded) namespaces --> <element name="XPath" type="string"/> </choice> |