cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject [2/5] cxf git commit: Avoid NPE if no keystore password was provided
Date Tue, 21 Apr 2015 14:20:44 GMT
Avoid NPE if no keystore password was provided


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

Branch: refs/heads/master
Commit: 4fdb951039dd8c7bd840d85e68e4225057f2d52d
Parents: 8c8ed16
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Tue Apr 21 14:50:43 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/4fdb9510/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 c434fa5..0447a19 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
@@ -226,6 +226,10 @@ public final class KeyManagementUtils {
         String keyStoreType = props.getProperty(RSSEC_KEY_STORE_TYPE);
         String keyStoreLoc = props.getProperty(RSSEC_KEY_STORE_FILE);
         String keyStorePswd = props.getProperty(RSSEC_KEY_STORE_PSWD);
+        
+        if (keyStorePswd == null) {
+            throw new JoseException("No keystore password was defined");
+        }
         try {
             InputStream is = ResourceUtils.getResourceStream(keyStoreLoc, bus);
             return CryptoUtils.loadKeyStore(is, keyStorePswd.toCharArray(), keyStoreType);


Mime
View raw message