Repository: cxf-fediz Updated Branches: refs/heads/1.1.x-fixes 743bad8b1 -> ca5d72b93
NPE fix Project: http://git-wip-us.apache.org/repos/asf/cxf-fediz/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf-fediz/commit/ca5d72b9 Tree: http://git-wip-us.apache.org/repos/asf/cxf-fediz/tree/ca5d72b9 Diff: http://git-wip-us.apache.org/repos/asf/cxf-fediz/diff/ca5d72b9 Branch: refs/heads/1.1.x-fixes Commit: ca5d72b93a3ad2ab882daa0c9432592b09b8f0ff Parents: 743bad8 Author: Colm O hEigeartaigh <[email protected]> Authored: Wed Mar 11 17:42:30 2015 +0000 Committer: Colm O hEigeartaigh <[email protected]> Committed: Wed Mar 11 17:43:09 2015 +0000 ---------------------------------------------------------------------- .../apache/cxf/fediz/core/config/FederationContext.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/ca5d72b9/plugins/core/src/main/java/org/apache/cxf/fediz/core/config/FederationContext.java ---------------------------------------------------------------------- diff --git a/plugins/core/src/main/java/org/apache/cxf/fediz/core/config/FederationContext.java b/plugins/core/src/main/java/org/apache/cxf/fediz/core/config/FederationContext.java index 21c7230..fe45ab1 100644 --- a/plugins/core/src/main/java/org/apache/cxf/fediz/core/config/FederationContext.java +++ b/plugins/core/src/main/java/org/apache/cxf/fediz/core/config/FederationContext.java @@ -104,7 +104,7 @@ public class FederationContext implements Closeable { certificateStores = new ArrayList<TrustManager>(); CertificateStores certStores = config.getCertificateStores(); List<TrustManagersType> trustManagers = certStores.getTrustManager(); - for (TrustManagersType manager:trustManagers) { + for (TrustManagersType manager : trustManagers) { TrustManager tm = new TrustManager(manager); Crypto crypto = null; @@ -158,11 +158,14 @@ public class FederationContext implements Closeable { public KeyManager getSigningKey() { - //return new KeyManager(config.getSigningKey()); if (keyManager != null) { return keyManager; } + if (config.getSigningKey() == null) { + LOG.error("No signing key has been configured"); + throw new IllegalConfigurationException("No signing key has been configured"); + } keyManager = new KeyManager(config.getSigningKey()); Properties sigProperties = createCryptoProperties(config.getSigningKey()); Crypto crypto; @@ -184,6 +187,9 @@ public class FederationContext implements Closeable { if (decryptionKeyManager != null) { return decryptionKeyManager; } + if (config.getTokenDecryptionKey() == null) { + return null; + } decryptionKeyManager = new KeyManager(config.getTokenDecryptionKey()); Properties decProperties = createCryptoProperties(config.getTokenDecryptionKey()); Crypto crypto;
