Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C14N10 REC Canonicalizer does not follow #92

Open
adamdecaf opened this issue Apr 11, 2023 · 0 comments
Open

C14N10 REC Canonicalizer does not follow #92

adamdecaf opened this issue Apr 11, 2023 · 0 comments

Comments

@adamdecaf
Copy link
Contributor

Taking Example 3.3 from the REC-xml-c14n-20010315 specification does not properly canonicalize the document.

--- FAIL: TestC14N10RecCanonicalizer (0.00s)
    canonicalize_test.go:31: 
        	Error Trace:	canonicalize_test.go:31
        	            				canonicalize_test.go:118
        	Error:      	Not equal: 
        	            	expected: "<doc>\n   <e1></e1>\n   <e2></e2>\n   <e3 id=\"elem3\" name=\"elem3\"></e3>\n   <e4 id=\"elem4\" name=\"elem4\"></e4>\n   <e5 xmlns=\"http://example.org\" xmlns:a=\"http://www.w3.org\" xmlns:b=\"http://www.ietf.org\" attr=\"I'm\" attr2=\"all\" b:attr=\"sorted\" a:attr=\"out\"></e5>\n   <e6 xmlns:a=\"http://www.w3.org\">\n      <e7 xmlns=\"http://www.ietf.org\">\n         <e8 xmlns=\"\">\n            <e9 xmlns:a=\"http://www.ietf.org\" attr=\"default\"></e9>\n         </e8>\n      </e7>\n   </e6>\n</doc>"
        	            	actual  : "<doc>\n   <e1></e1>\n   <e2></e2>\n   <e3 id=\"elem3\" name=\"elem3\"></e3>\n   <e4 id=\"elem4\" name=\"elem4\"></e4>\n   <e5 xmlns=\"http://example.org\" xmlns:a=\"http://www.w3.org\" xmlns:b=\"http://www.ietf.org\" attr=\"I'm\" attr2=\"all\" b:attr=\"sorted\" a:attr=\"out\"></e5>\n   <e6 xmlns=\"\" xmlns:a=\"http://www.w3.org\">\n      <e7 xmlns=\"http://www.ietf.org\">\n         <e8 xmlns=\"\">\n            <e9 xmlns=\"\"></e9>\n         </e8>\n      </e7>\n   </e6>\n</doc>"
        	            	
        	            	Diff:
        	            	--- Expected
        	            	+++ Actual
        	            	@@ -6,6 +6,6 @@
        	            	    <e5 xmlns="http://example.org" xmlns:a="http://www.w3.org" xmlns:b="http://www.ietf.org" attr="I'm" attr2="all" b:attr="sorted" a:attr="out"></e5>
        	            	-   <e6 xmlns:a="http://www.w3.org">
        	            	+   <e6 xmlns="" xmlns:a="http://www.w3.org">
        	            	       <e7 xmlns="http://www.ietf.org">
        	            	          <e8 xmlns="">
        	            	-            <e9 xmlns:a="http://www.ietf.org" attr="default"></e9>
        	            	+            <e9 xmlns=""></e9>
        	            	          </e8>
        	Test:       	TestC14N10RecCanonicalizer
FAIL
FAIL	github.com/russellhaering/goxmldsig	1.175s

It appears we are injecting empty xmlns attributes into the response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant