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: NPE fix
Date Tue, 27 Oct 2015 17:11:38 GMT
NPE fix


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

Branch: refs/heads/3.0.x-fixes
Commit: 01bcdb5e3b527b90b3c2103103fe351385e41f14
Parents: 34eb4b1
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Tue Oct 27 15:51:52 2015 +0000
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Tue Oct 27 17:11:15 2015 +0000

----------------------------------------------------------------------
 .../main/java/org/apache/cxf/rs/security/jose/jwe/JweUtils.java | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/01bcdb5e/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweUtils.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweUtils.java
b/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweUtils.java
index 0c86142..e936359 100644
--- a/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweUtils.java
+++ b/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweUtils.java
@@ -388,6 +388,11 @@ public final class JweUtils {
         } else {
             if (JoseConstants.HEADER_JSON_WEB_KEY.equals(props.get(JoseConstants.RSSEC_KEY_STORE_TYPE)))
{
                 JsonWebKey jwk = JwkUtils.loadJsonWebKey(m, props, KeyOperation.DECRYPT);
+                if (jwk == null) {
+                    LOG.warning("Extracting the JsonWebKey failed");
+                    throw new JweException(JweException.Error.KEY_DECRYPTION_FAILURE);
+                }
+                
                 if ("direct".equals(keyEncryptionAlgo)) {
                     contentEncryptionAlgo = getContentEncryptionAlgo(m, props, jwk.getAlgorithm());
                     ctDecryptionKey = getContentDecryptionSecretKey(jwk, contentEncryptionAlgo);


Mime
View raw message