From a67ed8406bb7f9d4bca48891308e7bfead90efe4 Mon Sep 17 00:00:00 2001 From: gregor Date: Thu, 11 Aug 2005 13:22:41 +0000 Subject: =?UTF-8?q?Bug=20271:=20Adpation=20auf=20neue=20Struktur=20des=20K?= =?UTF-8?q?onfigurationsfiles=20abgeschlossen.=20Modultests=20durchgef?= =?UTF-8?q?=C3=BChrt.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://joinup.ec.europa.eu/svn/moa-idspss/trunk@436 d688527b-c9ab-4aba-bd8d-4036d912da1d --- .../server/config/ConfigurationPartsBuilder.java | 41 ++++++++++++++-------- .../spss/server/config/ConfigurationProvider.java | 2 +- 2 files changed, 27 insertions(+), 16 deletions(-) (limited to 'spss.server/src/at/gv/egovernment') diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/config/ConfigurationPartsBuilder.java b/spss.server/src/at/gv/egovernment/moa/spss/server/config/ConfigurationPartsBuilder.java index e1681690f..d61b995dc 100644 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/config/ConfigurationPartsBuilder.java +++ b/spss.server/src/at/gv/egovernment/moa/spss/server/config/ConfigurationPartsBuilder.java @@ -99,8 +99,8 @@ public class ConfigurationPartsBuilder { ROOT + CONF + "SignatureVerification/" + CONF + "CertificateValidation/" + CONF + "PathConstruction/" - + CONF + "CertificateStore" - + CONF + "DirectoryStore" + + CONF + "CertificateStore/" + + CONF + "DirectoryStore/" + CONF + "Location"; private static final String AUTO_ADD_CERTIFICATES_XPATH_ = ROOT + CONF + "SignatureVerification/" @@ -118,10 +118,10 @@ public class ConfigurationPartsBuilder { + CONF + "PathValidation/" + CONF + "ChainingMode"; private static final String CHAINING_MODES_DEFAULT_XPATH = - CHAINING_MODES_XPATH - + CONF + "/DefaultMode"; + CHAINING_MODES_XPATH + "/" + + CONF + "DefaultMode"; private static final String TRUST_ANCHOR_XPATH = - CHAINING_MODES_XPATH + CHAINING_MODES_XPATH + "/" + CONF + "TrustAnchor"; private static final String TRUST_PROFILE_XPATH = ROOT + CONF + "SignatureVerification/" @@ -132,7 +132,7 @@ public class ConfigurationPartsBuilder { ROOT + CONF + "SignatureVerification/" + CONF + "CertificateValidation/" + CONF + "RevocationChecking/" - + CONF + "DistributionPoints"; + + CONF + "DistributionPoint"; private static final String ENABLE_REVOCATION_CHECKING_XPATH_ = ROOT + CONF + "SignatureVerification/" + CONF + "CertificateValidation/" @@ -147,7 +147,7 @@ public class ConfigurationPartsBuilder { ROOT + CONF + "SignatureVerification/" + CONF + "CertificateValidation/" + CONF + "RevocationChecking/" - + CONF + "ServiceOrder" + + CONF + "ServiceOrder/" + CONF + "Service"; private static final String ENABLE_ARCHIVING_XPATH = ROOT + CONF + "SignatureVerification/" @@ -167,7 +167,7 @@ public class ConfigurationPartsBuilder { + CONF + "RevocationChecking/" + CONF + "Archiving/" + CONF + "Archive/" - + CONF + "DatabaseArchive" + + CONF + "DatabaseArchive/" + CONF + "JDBCURL"; private static final String ACHIVE_JDBC_DRIVER_CLASS_ = ROOT + CONF + "SignatureVerification/" @@ -175,7 +175,7 @@ public class ConfigurationPartsBuilder { + CONF + "RevocationChecking/" + CONF + "Archiving/" + CONF + "Archive/" - + CONF + "DatabaseArchive" + + CONF + "DatabaseArchive/" + CONF + "JDBCDriverClassName"; private static final String CREATE_TRANSFORMS_INFO_PROFILE_XPATH = ROOT + CONF + "SignatureCreation/" @@ -396,7 +396,7 @@ public class ConfigurationPartsBuilder { while ((keyElem = (Element) skIter.nextNode()) != null) { String id = getElementValue(keyElem, CONF + "Id", null); - String fileName = getElementValue(keyElem, CONF + "Filename", null); + String fileName = getElementValue(keyElem, CONF + "FileName", null); String passWord = getElementValue(keyElem, CONF + "Password", null); if (existingIds.contains(id)) @@ -510,7 +510,7 @@ public class ConfigurationPartsBuilder { while ((keyEntryElem = (Element) keyEntryIter.nextNode()) != null) { String keyModuleId = getElementValue(keyEntryElem, CONF + "KeyModuleId", ""); - Element keyCertElem = (Element) XPathUtils.selectSingleNode(keyEntryElem, CONF + "KeyCertIsuerSerial"); + Element keyCertElem = (Element) XPathUtils.selectSingleNode(keyEntryElem, CONF + "KeyCertIssuerSerial"); IssuerAndSerial issuerSerial = buildIssuerAndSerial(keyCertElem); if (!keyModuleIds.contains(keyModuleId)) { @@ -601,7 +601,7 @@ public class ConfigurationPartsBuilder { String defaultChaining = getElementValue( getConfigElem(), CHAINING_MODES_DEFAULT_XPATH, - CM_CHAINING); + CM_PKIX); return translateChainingMode(defaultChaining); @@ -726,7 +726,7 @@ public class ConfigurationPartsBuilder { Element oCSPPElem; while ((oCSPPElem = (Element) oCSPDPPIter.nextNode()) != null) { - OCSPDistributionPoint oCSPDP = (OCSPDistributionPoint) buildDistributionPoint(cRLDPElem, null); + OCSPDistributionPoint oCSPDP = (OCSPDistributionPoint) buildDistributionPoint(oCSPPElem, null); dPsForCA.add(oCSPDP); } } @@ -764,7 +764,7 @@ public class ConfigurationPartsBuilder { if (reasonCodesSB.length() > 0) reasonCodesSB.append(" "); reasonCodesSB.append(getElementValue(reasonCodeElem, ".", "").trim()); } - return new CRLDistributionPoint(uri, reasonCodesSB.toString(), issuerName); + return new CRLDistributionPoint(issuerName, uri, reasonCodesSB.toString()); } else { @@ -995,6 +995,10 @@ public class ConfigurationPartsBuilder { String certStoreLocStr = getElementValue(getConfigElem(), CERTSTORE_LOCATION_XPATH, null); File certStoreLocFile; + // No value specified in configuration file: Set it to a reasonable (absolute) default + if (certStoreLocStr == null) + return new File(configRoot_, "certstore").getAbsolutePath(); + // Make cert store location an absolute value certStoreLocFile = new File(certStoreLocStr); if (!certStoreLocFile.isAbsolute()) @@ -1170,6 +1174,7 @@ public class ConfigurationPartsBuilder { public long getMaxRevocationAge() { String maxRevocationAge = getElementValue(getConfigElem(), MAX_REVOCATION_AGE_XPATH_, null); + if (maxRevocationAge == null) return 0; return Long.valueOf(maxRevocationAge).longValue(); } @@ -1190,7 +1195,13 @@ public class ConfigurationPartsBuilder { { list.add(getElementValue(currentServiceNode, ".", null)); } - return (String[])list.toArray(); + Object[] serviceOrder = list.toArray(); + String[] returnValue = new String[serviceOrder.length]; + for (int i = 0; i < serviceOrder.length; i++) + { + returnValue[i] = (String)serviceOrder[i]; + } + return returnValue; } /** diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/config/ConfigurationProvider.java b/spss.server/src/at/gv/egovernment/moa/spss/server/config/ConfigurationProvider.java index a6cbcc159..e48835286 100644 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/config/ConfigurationProvider.java +++ b/spss.server/src/at/gv/egovernment/moa/spss/server/config/ConfigurationProvider.java @@ -304,6 +304,7 @@ public class ConfigurationProvider chainingModes = builder.buildChainingModes(); useAuthorityInfoAccess_ = builder.getUseAuthorityInfoAccess(); autoAddCertificates_ = builder.getAutoAddCertificates(); + trustProfiles = builder.buildTrustProfiles(); distributionPoints = builder.buildDistributionPoints(); enableRevocationChecking_ = builder.getEnableRevocationChecking(); maxRevocationAge_ = builder.getMaxRevocationAge(); @@ -317,7 +318,6 @@ public class ConfigurationProvider createSignatureEnvironmentProfiles = builder.buildCreateSignatureEnvironmentProfiles(); verifyTransformsInfoProfiles = builder.buildVerifyTransformsInfoProfiles(); supplementProfiles = builder.buildSupplementProfiles(); - trustProfiles = builder.buildTrustProfiles(); warnings = new ArrayList(builder.getWarnings()); } catch (Throwable t) { throw new ConfigurationException("config.11", null, t); -- cgit v1.2.3