Merge remote-tracking branch 'upstream/master'

merge-requests/1/head
Megala 8 years ago
commit fecf343a89

@ -140,9 +140,7 @@
org.wso2.carbon.event.stream.core, org.wso2.carbon.event.stream.core,
org.wso2.carbon.event.stream.core.exception, org.wso2.carbon.event.stream.core.exception,
org.wso2.carbon.utils, org.wso2.carbon.utils,
javax.xml.bind, javax.xml.*,
javax.xml.bind.annotation,
javax.xml.parsers; version=0.0.0,
org.w3c.dom, org.w3c.dom,
org.wso2.carbon.identity.oauth2.stub, org.wso2.carbon.identity.oauth2.stub,
org.wso2.carbon.identity.oauth2.stub.dto, org.wso2.carbon.identity.oauth2.stub.dto,

@ -21,6 +21,7 @@ package org.wso2.carbon.device.mgt.iot.output.adapter.ui.util;
import org.w3c.dom.Document; import org.w3c.dom.Document;
import org.wso2.carbon.device.mgt.iot.output.adapter.ui.config.WebsocketValidationConfigurationFailedException; import org.wso2.carbon.device.mgt.iot.output.adapter.ui.config.WebsocketValidationConfigurationFailedException;
import javax.xml.XMLConstants;
import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.DocumentBuilderFactory;
import java.io.File; import java.io.File;
@ -34,7 +35,9 @@ public class WebsocketUtils {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setNamespaceAware(true); factory.setNamespaceAware(true);
try { try {
DocumentBuilder docBuilder = factory.newDocumentBuilder(); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
DocumentBuilder docBuilder = dbf.newDocumentBuilder();
return docBuilder.parse(file); return docBuilder.parse(file);
} catch (Exception e) { } catch (Exception e) {
throw new WebsocketValidationConfigurationFailedException("Error occurred while parsing file, while converting " + throw new WebsocketValidationConfigurationFailedException("Error occurred while parsing file, while converting " +

@ -70,9 +70,7 @@
org.wso2.carbon.core, org.wso2.carbon.core,
org.wso2.carbon.device.mgt.common, org.wso2.carbon.device.mgt.common,
org.wso2.carbon.utils, org.wso2.carbon.utils,
javax.xml.bind, javax.xml.*,
javax.xml.bind.annotation,
javax.xml.parsers; version="${javax.xml.parsers.import.pkg.version}",
org.w3c.dom org.w3c.dom
</Import-Package> </Import-Package>
<Export-Package> <Export-Package>

@ -22,6 +22,7 @@ import org.w3c.dom.Document;
import org.wso2.carbon.device.mgt.iot.devicetype.config.DeviceManagementConfiguration; import org.wso2.carbon.device.mgt.iot.devicetype.config.DeviceManagementConfiguration;
import org.wso2.carbon.device.mgt.iot.devicetype.config.exception.DeviceTypeConfigurationException; import org.wso2.carbon.device.mgt.iot.devicetype.config.exception.DeviceTypeConfigurationException;
import javax.xml.XMLConstants;
import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException; import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller; import javax.xml.bind.Unmarshaller;
@ -38,7 +39,9 @@ public class DeviceTypeConfigUtil {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setNamespaceAware(true); factory.setNamespaceAware(true);
try { try {
DocumentBuilder docBuilder = factory.newDocumentBuilder(); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
DocumentBuilder docBuilder = dbf.newDocumentBuilder();
return docBuilder.parse(file); return docBuilder.parse(file);
} catch (Exception e) { } catch (Exception e) {
throw new DeviceTypeConfigurationException("Error occurred while parsing file, while converting " + throw new DeviceTypeConfigurationException("Error occurred while parsing file, while converting " +
@ -46,7 +49,4 @@ public class DeviceTypeConfigUtil {
} }
} }
} }

@ -55,10 +55,9 @@
org.osgi.framework, org.osgi.framework,
org.osgi.service.component, org.osgi.service.component,
org.apache.commons.logging, org.apache.commons.logging,
javax.xml.bind.*, javax.xml.*,
javax.naming, javax.naming,
javax.sql, javax.sql,
javax.xml.parsers; version=0.0.0,
org.w3c.dom, org.w3c.dom,
org.wso2.carbon.context, org.wso2.carbon.context,
org.wso2.carbon.utils.*, org.wso2.carbon.utils.*,

@ -35,6 +35,7 @@ import org.wso2.carbon.registry.api.RegistryException;
import org.wso2.carbon.registry.api.Resource; import org.wso2.carbon.registry.api.Resource;
import org.wso2.carbon.registry.core.Registry; import org.wso2.carbon.registry.core.Registry;
import javax.xml.XMLConstants;
import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.DocumentBuilderFactory;
import java.io.File; import java.io.File;
@ -63,7 +64,9 @@ public class MobileDeviceManagementUtil {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setNamespaceAware(true); factory.setNamespaceAware(true);
try { try {
DocumentBuilder docBuilder = factory.newDocumentBuilder(); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
DocumentBuilder docBuilder = dbf.newDocumentBuilder();
return docBuilder.parse(file); return docBuilder.parse(file);
} catch (Exception e) { } catch (Exception e) {
throw new DeviceManagementException( throw new DeviceManagementException(

@ -51,6 +51,7 @@ import org.xml.sax.SAXException;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.jws.WebService; import javax.jws.WebService;
import javax.servlet.ServletContext; import javax.servlet.ServletContext;
import javax.xml.XMLConstants;
import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException; import javax.xml.parsers.ParserConfigurationException;
@ -233,9 +234,8 @@ public class CertificateEnrollmentServiceImpl implements CertificateEnrollmentSe
signedCertEncodedString = base64Encoder.encodeAsString(signedCertificate.getEncoded()); signedCertEncodedString = base64Encoder.encodeAsString(signedCertificate.getEncoded());
DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance(); DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder; domFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
DocumentBuilder builder = domFactory.newDocumentBuilder();
builder = domFactory.newDocumentBuilder();
Document document = builder.parse(wapProvisioningFilePath); Document document = builder.parse(wapProvisioningFilePath);
NodeList wapParm = document.getElementsByTagName(PluginConstants.CertificateEnrolment.PARM); NodeList wapParm = document.getElementsByTagName(PluginConstants.CertificateEnrolment.PARM);
Node caCertificatePosition = wapParm.item(PluginConstants.CertificateEnrolment.CA_CERTIFICATE_POSITION); Node caCertificatePosition = wapParm.item(PluginConstants.CertificateEnrolment.CA_CERTIFICATE_POSITION);

Loading…
Cancel
Save