aboutsummaryrefslogtreecommitdiff
path: root/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa
diff options
context:
space:
mode:
authortlenz <thomas.lenz@egiz.gv.at>2017-03-01 13:35:23 +0100
committertlenz <thomas.lenz@egiz.gv.at>2017-03-01 13:35:23 +0100
commitb0980a0e0fc69ff9f1faff0153e1bd0c5ccc3b98 (patch)
tree31ee7561b5d3af73d43e2b91e27efecf1f6689d1 /moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa
parent0defe2a024c95922610549f8475c614dec0eadb4 (diff)
downloadmoa-sig-b0980a0e0fc69ff9f1faff0153e1bd0c5ccc3b98.tar.gz
moa-sig-b0980a0e0fc69ff9f1faff0153e1bd0c5ccc3b98.tar.bz2
moa-sig-b0980a0e0fc69ff9f1faff0153e1bd0c5ccc3b98.zip
fix possible nullpointer exception if trustprofile needs TSL support but the TSL client is not initialized
Diffstat (limited to 'moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa')
-rw-r--r--moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/pki/PKIProfileImpl.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/pki/PKIProfileImpl.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/pki/PKIProfileImpl.java
index b776255..f79cf7a 100644
--- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/pki/PKIProfileImpl.java
+++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/pki/PKIProfileImpl.java
@@ -31,6 +31,7 @@ import iaik.pki.store.truststore.TrustStoreTypes;
import java.util.Arrays;
+import at.gv.egovernment.moa.sig.tsl.api.ITslService;
import at.gv.egovernment.moa.sig.tsl.exception.TslPKIException;
import at.gv.egovernment.moa.sig.tsl.pki.TslTrustStoreProfile;
import at.gv.egovernment.moa.sig.tsl.pki.chaining.ChainingTrustStoreProfile;
@@ -95,9 +96,16 @@ public class PKIProfileImpl implements PKIProfile {
if (tp.isTSLEnabled()) {
- //build TSL truststore if enabled
TslTrustStoreProfile tslTrustStore;
try {
+ if (!TSLServiceFactory.isInitialized()) {
+ Logger.error("Can not build TrustProfile:" + trustProfileId
+ + " Reason: TrustProfile needs TSL support but TSL client NOT initialized.");
+ throw new TslPKIException("Trust Status-List service client is NOT initialized");
+
+ }
+
+ //build TSL truststore if enabled
tslTrustStore = TSLServiceFactory.getTSLServiceClient().
buildTrustStoreProfile(
tp.getCountries(),