Rasika Perera 7 years ago
parent 9b10c347ed
commit ad36ac48df

@ -66,10 +66,9 @@ public class MobileDeviceManagementUtil {
public static Document convertToDocument(File file) throws DeviceManagementException { public static Document convertToDocument(File file) throws DeviceManagementException {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setNamespaceAware(true); factory.setNamespaceAware(true);
factory.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, "");
factory.setAttribute(XMLConstants.ACCESS_EXTERNAL_SCHEMA, "");
try { try {
factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
factory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
DocumentBuilder docBuilder = factory.newDocumentBuilder(); DocumentBuilder docBuilder = factory.newDocumentBuilder();
return docBuilder.parse(file); return docBuilder.parse(file);
} catch (Exception e) { } catch (Exception e) {

@ -231,8 +231,7 @@ public class EnrollmentServiceImpl implements EnrollmentService {
DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance(); DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
domFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); domFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
domFactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, ""); domFactory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
domFactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_SCHEMA, "");
DocumentBuilder builder; DocumentBuilder builder;
builder = domFactory.newDocumentBuilder(); builder = domFactory.newDocumentBuilder();

@ -239,8 +239,7 @@ public class CertificateEnrollmentServiceImpl implements CertificateEnrollmentSe
DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance(); DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
domFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); domFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
domFactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, ""); domFactory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
domFactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_SCHEMA, "");
DocumentBuilder builder = domFactory.newDocumentBuilder(); DocumentBuilder builder = domFactory.newDocumentBuilder();
Document document = builder.parse(wapProvisioningFilePath); Document document = builder.parse(wapProvisioningFilePath);

@ -68,6 +68,7 @@ public class MobileDeviceManagementUtil {
factory.setNamespaceAware(true); factory.setNamespaceAware(true);
try { try {
factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
factory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
DocumentBuilder docBuilder = factory.newDocumentBuilder(); DocumentBuilder docBuilder = factory.newDocumentBuilder();
return docBuilder.parse(file); return docBuilder.parse(file);
} catch (Exception e) { } catch (Exception e) {

Loading…
Cancel
Save