You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@santuario.apache.org by co...@apache.org on 2016/08/25 09:13:42 UTC

svn commit: r1757635 - in /santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security: resource/xmlsecurity_en.properties stax/impl/processor/input/AbstractSignatureInputHandler.java

Author: coheigea
Date: Thu Aug 25 09:13:42 2016
New Revision: 1757635

URL: http://svn.apache.org/viewvc?rev=1757635&view=rev
Log:
NPE fix

Modified:
    santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/resource/xmlsecurity_en.properties
    santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/impl/processor/input/AbstractSignatureInputHandler.java

Modified: santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/resource/xmlsecurity_en.properties
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/resource/xmlsecurity_en.properties?rev=1757635&r1=1757634&r2=1757635&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/resource/xmlsecurity_en.properties [iso-8859-1] (original)
+++ santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/resource/xmlsecurity_en.properties [iso-8859-1] Thu Aug 25 09:13:42 2016
@@ -85,7 +85,7 @@ java.security.InvalidKeyException = Inva
 java.security.NoSuchProviderException = Unknown or unsupported provider
 java.security.UnknownKeyType = Unknown or unsupported key type {0}
 KeyInfo.error = Error loading Key Info
-KeyInfo.needKeyResolver = More than one keyResovler have to be registered
+KeyInfo.needKeyResolver = More than one keyResolver have to be registered
 KeyInfo.nokey = Cannot get key from {0}
 KeyInfo.noKey = Cannot get the public key
 KeyInfo.wrongNumberOfObject = Need {0} keyObjects

Modified: santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/impl/processor/input/AbstractSignatureInputHandler.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/impl/processor/input/AbstractSignatureInputHandler.java?rev=1757635&r1=1757634&r2=1757635&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/impl/processor/input/AbstractSignatureInputHandler.java (original)
+++ santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/impl/processor/input/AbstractSignatureInputHandler.java Thu Aug 25 09:13:42 2016
@@ -290,7 +290,13 @@ public abstract class AbstractSignatureI
             } else {
                 verifyKey = inboundSecurityToken.getSecretKey(
                         algorithmURI, XMLSecurityConstants.Sym_Sig, signatureType.getId());
-                verifyKey = XMLSecurityUtils.prepareSecretKey(algorithmURI, verifyKey.getEncoded());
+                if (verifyKey != null) {
+                    verifyKey = XMLSecurityUtils.prepareSecretKey(algorithmURI, verifyKey.getEncoded());
+                }
+            }
+
+            if (verifyKey == null) {
+                throw new XMLSecurityException("KeyInfo.nokey", new Object[]{"the inbound security token"});
             }
 
             try {