aboutsummaryrefslogtreecommitdiff
path: root/id
diff options
context:
space:
mode:
authorThomas Lenz <tlenz@iaik.tugraz.at>2015-02-19 14:46:06 +0100
committerThomas Lenz <tlenz@iaik.tugraz.at>2015-02-19 14:46:06 +0100
commit1679466b77e29ff8181b1b01a320c3548e28a349 (patch)
tree8b9cd65d06d8c38398e35dee70e1d9c9791aab6a /id
parent299c1b3679abecdae88d71002acb626661616b0d (diff)
downloadmoa-id-spss-1679466b77e29ff8181b1b01a320c3548e28a349.tar.gz
moa-id-spss-1679466b77e29ff8181b1b01a320c3548e28a349.tar.bz2
moa-id-spss-1679466b77e29ff8181b1b01a320c3548e28a349.zip
fix some possible problems
Diffstat (limited to 'id')
-rw-r--r--id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/auth/pvp2/servlets/Authenticate.java52
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/MOAIDAuthInitializer.java3
-rw-r--r--id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/utils/ssl/SSLUtils.java1
3 files changed, 31 insertions, 25 deletions
diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/auth/pvp2/servlets/Authenticate.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/auth/pvp2/servlets/Authenticate.java
index f7406c42e..a511a3c88 100644
--- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/auth/pvp2/servlets/Authenticate.java
+++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/auth/pvp2/servlets/Authenticate.java
@@ -75,34 +75,42 @@ public class Authenticate extends HttpServlet {
private static final long serialVersionUID = 1L;
private static final Logger log = LoggerFactory
- .getLogger(Authenticate.class);
- /**
- * @see HttpServlet#HttpServlet()
- */
- public Authenticate() {
- super();
- DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+ .getLogger(Authenticate.class);
+
+ private static DocumentBuilderFactory factory = null;
+
+ static {
+ initialDocumentBuilderFactory();
+ }
+
+ synchronized private static void initialDocumentBuilderFactory() {
+ factory = DocumentBuilderFactory.newInstance();
factory.setNamespaceAware(true);
+
+ }
+
+ public Document asDOMDocument(XMLObject object) throws IOException,
+ MarshallingException, TransformerException, ParserConfigurationException {
try {
- // FIXME[tlenz]: Neither DocumentBuilderFactory nor DocumentBuilder is guaranteed to be thread-safe!
- builder = factory.newDocumentBuilder();
+ DocumentBuilder builder = null;
+ synchronized (factory) {
+ builder = factory.newDocumentBuilder();
+
+ }
+
+ Document document = builder.newDocument();
+ Marshaller out = Configuration.getMarshallerFactory().getMarshaller(
+ object);
+ out.marshall(object, document);
+ return document;
+
} catch (ParserConfigurationException e) {
log.warn("PVP2 AuthenticationServlet can not be initialized.", e);
-
+ throw e;
}
+
}
-
- DocumentBuilder builder;
-
- public Document asDOMDocument(XMLObject object) throws IOException,
- MarshallingException, TransformerException {
- Document document = builder.newDocument();
- Marshaller out = Configuration.getMarshallerFactory().getMarshaller(
- object);
- out.marshall(object, document);
- return document;
- }
-
+
protected void process(HttpServletRequest request,
HttpServletResponse response, Map<String,String> legacyParameter) throws ServletException, IOException {
try {
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/MOAIDAuthInitializer.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/MOAIDAuthInitializer.java
index d4ce8670e..025c4c652 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/MOAIDAuthInitializer.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/MOAIDAuthInitializer.java
@@ -147,8 +147,7 @@ public class MOAIDAuthInitializer {
.toString() }, ex);
}
}
-
- // FIXME[@tlenz]: iaik.prod:iaik_X509TrustManager requires iaik.IAIKRuntimeException which might have been moved to iaik.server.modules (iaik.prod:iaik_moa:1.51))
+
// Initializes IAIKX509TrustManager logging
/*
String log4jConfigURL = System.getProperty("log4j.configuration");
diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/utils/ssl/SSLUtils.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/utils/ssl/SSLUtils.java
index dfd549b6a..68437a04d 100644
--- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/utils/ssl/SSLUtils.java
+++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/utils/ssl/SSLUtils.java
@@ -177,7 +177,6 @@ public class SSLUtils {
// This call fixes a bug occuring when PKIConfiguration is
// initialized by the MOA-SP initialization code, in case
// MOA-SP is called by API
- // FIXME[tlenz]: Requires IAIKX509TrustManager (iaik.prod:iaik_X509TrustManager requires iaik.IAIKRuntimeException which might have been moved to iaik.server.modules (iaik.prod:iaik_moa:1.51)))
MOAIDTrustManager.initializeLoggingContext();
IAIKX509TrustManager tm = new MOAIDTrustManager(acceptedServerCertURL);
tm.init(cfg, profile);