santuario-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 40783] New: - NPE in ResolverDirectHTTP.engineCanResolve
Date Wed, 18 Oct 2006 08:46:11 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40783>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40783

           Summary: NPE in ResolverDirectHTTP.engineCanResolve
           Product: Security
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Signature
        AssignedTo: security-dev@xml.apache.org
        ReportedBy: info@frankcornelis.be


When executing the following code using XML Security 1.4.Beta2 you'll get an
NPE. I think a better error reporting would be something like: cannot resolve URI.

XMLSignature signature = new XMLSignature(testDocument, null,
				XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA512,
				Canonicalizer.ALGO_ID_C14N_WITH_COMMENTS);

Element signatureElement = signature.getElement();
Element rootElement = (Element) testDocument.getFirstChild();
rootElement.appendChild(signatureElement);

Transforms transforms = new Transforms(testDocument);
signature.addDocument("urn:unknown:uri", transforms,
    MessageDigestAlgorithm.ALGO_ID_DIGEST_SHA512);

signature.addKeyInfo(publicKey);

signature.sign(privateKey);



The NPE stack trace:

java.lang.NullPointerException
	at
org.apache.xml.security.utils.resolver.implementations.ResolverDirectHTTP.engineCanResolve(Unknown
Source)
	at org.apache.xml.security.utils.resolver.ResourceResolver.canResolve(Unknown
Source)
	at org.apache.xml.security.utils.resolver.ResourceResolver.getInstance(Unknown
Source)
	at org.apache.xml.security.utils.resolver.ResourceResolver.getInstance(Unknown
Source)
	at
org.apache.xml.security.signature.Reference.getContentsBeforeTransformation(Unknown
Source)
	at
org.apache.xml.security.signature.Reference.dereferenceURIandPerformTransforms(Unknown
Source)
	at org.apache.xml.security.signature.Reference.calculateDigest(Unknown Source)
	at org.apache.xml.security.signature.Reference.generateDigestValue(Unknown Source)
	at org.apache.xml.security.signature.Manifest.generateDigestValues(Unknown Source)
	at org.apache.xml.security.signature.XMLSignature.sign(Unknown Source)

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

Mime
View raw message