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 NPE if no keystore password was provided
Date Tue, 21 Apr 2015 15:06:51 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/0391f12b
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/0391f12b
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/0391f12b

Branch: refs/heads/3.0.x-fixes
Commit: 0391f12b7665e971d7df53edb0b75f5d0e953676
Parents: 948502d
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:54:02 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/0391f12b/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