cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject cxf-fediz git commit: NPE fix
Date Wed, 11 Mar 2015 17:42:38 GMT
Repository: cxf-fediz
Updated Branches:
  refs/heads/master a32b934ff -> ce7c9a789


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/ce7c9a78
Tree: http://git-wip-us.apache.org/repos/asf/cxf-fediz/tree/ce7c9a78
Diff: http://git-wip-us.apache.org/repos/asf/cxf-fediz/diff/ce7c9a78

Branch: refs/heads/master
Commit: ce7c9a78951d8fde7188b08dac111262fb961c34
Parents: a32b934
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Wed Mar 11 17:42:30 2015 +0000
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Wed Mar 11 17:42:30 2015 +0000

----------------------------------------------------------------------
 .../org/apache/cxf/fediz/core/config/FedizContext.java    | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/ce7c9a78/plugins/core/src/main/java/org/apache/cxf/fediz/core/config/FedizContext.java
----------------------------------------------------------------------
diff --git a/plugins/core/src/main/java/org/apache/cxf/fediz/core/config/FedizContext.java
b/plugins/core/src/main/java/org/apache/cxf/fediz/core/config/FedizContext.java
index 4481ca3..9e9d2ed 100644
--- a/plugins/core/src/main/java/org/apache/cxf/fediz/core/config/FedizContext.java
+++ b/plugins/core/src/main/java/org/apache/cxf/fediz/core/config/FedizContext.java
@@ -104,7 +104,7 @@ public class FedizContext 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;
@@ -170,11 +170,14 @@ public class FedizContext 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;
@@ -196,6 +199,9 @@ public class FedizContext 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;


Mime
View raw message