Rasika Perera 7 years ago
parent 9b10c347ed
commit ad36ac48df

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

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

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

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

Loading…
Cancel
Save