cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject [3/5] cxf git commit: Avoid a NPE if the keystore file is not configured
Date Tue, 21 Apr 2015 14:20:45 GMT
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/e4feffb6
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/e4feffb6
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/e4feffb6

Branch: refs/heads/master
Commit: e4feffb6f13fd5ba1c8c76bb2301d2d1a13fd43a
Parents: 9bcc593
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:20:29 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/e4feffb6/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