syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject [2/3] syncope git commit: [SYNCOPE-1041] Enable secure XML processing - thanks Colm for suggestion
Date Fri, 31 Mar 2017 14:43:43 GMT
[SYNCOPE-1041] Enable secure XML processing - thanks Colm for suggestion


Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/2f7952b5
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/2f7952b5
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/2f7952b5

Branch: refs/heads/master
Commit: 2f7952b59cf8afe8418c58580e8ccd44e5f47b46
Parents: 5411181
Author: Francesco Chicchiriccò <ilgrosso@apache.org>
Authored: Fri Mar 31 16:32:45 2017 +0200
Committer: Francesco Chicchiriccò <ilgrosso@apache.org>
Committed: Fri Mar 31 16:32:58 2017 +0200

----------------------------------------------------------------------
 .../syncope/core/logic/saml2/SAML2ReaderWriter.java     | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/2f7952b5/ext/saml2sp/logic/src/main/java/org/apache/syncope/core/logic/saml2/SAML2ReaderWriter.java
----------------------------------------------------------------------
diff --git a/ext/saml2sp/logic/src/main/java/org/apache/syncope/core/logic/saml2/SAML2ReaderWriter.java
b/ext/saml2sp/logic/src/main/java/org/apache/syncope/core/logic/saml2/SAML2ReaderWriter.java
index 964759a..baa3882 100644
--- a/ext/saml2sp/logic/src/main/java/org/apache/syncope/core/logic/saml2/SAML2ReaderWriter.java
+++ b/ext/saml2sp/logic/src/main/java/org/apache/syncope/core/logic/saml2/SAML2ReaderWriter.java
@@ -28,6 +28,7 @@ import java.net.URLDecoder;
 import java.nio.charset.StandardCharsets;
 import java.security.KeyStore;
 import java.util.zip.DataFormatException;
+import javax.xml.XMLConstants;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.transform.Transformer;
 import javax.xml.transform.TransformerConfigurationException;
@@ -56,7 +57,16 @@ public class SAML2ReaderWriter {
 
     private static final Logger LOG = LoggerFactory.getLogger(SAML2ReaderWriter.class);
 
-    private static final TransformerFactory TRANSFORMER_FACTORY = TransformerFactory.newInstance();
+    private static final TransformerFactory TRANSFORMER_FACTORY;
+
+    static {
+        TRANSFORMER_FACTORY = TransformerFactory.newInstance();
+        try {
+            TRANSFORMER_FACTORY.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
+        } catch (TransformerConfigurationException e) {
+            LOG.error("Could not enable secure XML processing", e);
+        }
+    }
 
     @Autowired
     private SAML2SPLoader loader;


Mime
View raw message