cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject [1/5] cxf git commit: Avoid a NPE if the keystore file is not configured
Date Tue, 21 Apr 2015 15:06:49 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.0.x-fixes 20448838d -> 2df8ea0b3


Avoid a NPE if the keystore file is not configured


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/a0d3b619
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/a0d3b619
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/a0d3b619

Branch: refs/heads/3.0.x-fixes
Commit: a0d3b619b56e2a3c3d4acc540fb38bfae525d9fe
Parents: 2044883
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Tue Apr 21 14:41:02 2015 +0100
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Tue Apr 21 15:54:00 2015 +0100

----------------------------------------------------------------------
 .../apache/cxf/rs/security/jose/jaxrs/KeyManagementUtils.java    | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/a0d3b619/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/KeyManagementUtils.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/KeyManagementUtils.java
b/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/KeyManagementUtils.java
index 5a1fe60..c434fa5 100644
--- a/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/KeyManagementUtils.java
+++ b/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/KeyManagementUtils.java
@@ -211,6 +211,10 @@ public final class KeyManagementUtils {
         return (RSAPrivateKey)loadPrivateKey(keyStore, m, props, bus, cb, keyOper, alias);
     }
     public static KeyStore loadPersistKeyStore(Message m, Properties props) {
+        if (!props.containsKey(RSSEC_KEY_STORE_FILE)) {
+            LOG.warning("No keystore file has been configured");
+            throw new JoseException("No keystore file has been configured");
+        }
         KeyStore keyStore = (KeyStore)m.getExchange().get(props.get(RSSEC_KEY_STORE_FILE));
         if (keyStore == null) {
             keyStore = loadKeyStore(props, m.getExchange().getBus());


Mime
View raw message