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 2024/06/21 08:36:02 UTC
(santuario-xml-security-java) branch main updated: Fixed KeyValue construction for ECC keys (#334)
This is an automated email from the ASF dual-hosted git repository.
coheigea pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/santuario-xml-security-java.git
The following commit(s) were added to refs/heads/main by this push:
new d8277bd7 Fixed KeyValue construction for ECC keys (#334)
d8277bd7 is described below
commit d8277bd74cbae027e45552d5daf9aeb7d6b5fb1a
Author: Carlos Gamuci <ca...@gmail.com>
AuthorDate: Fri Jun 21 10:35:57 2024 +0200
Fixed KeyValue construction for ECC keys (#334)
- The signature KeyValue construction was wrong when an ECC key was used. The namespace was declared in the "NamedCurve" element, instead of "ECKeyValue". (See https://www.w3.org/TR/xmldsig-core1/#sec-ECKeyValue)
- The fix is needed in Apache Santuario 3.0.x too.
---
src/main/java/org/apache/jcp/xml/dsig/internal/dom/DOMKeyValue.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/main/java/org/apache/jcp/xml/dsig/internal/dom/DOMKeyValue.java b/src/main/java/org/apache/jcp/xml/dsig/internal/dom/DOMKeyValue.java
index 3cbb042e..5cb602d3 100644
--- a/src/main/java/org/apache/jcp/xml/dsig/internal/dom/DOMKeyValue.java
+++ b/src/main/java/org/apache/jcp/xml/dsig/internal/dom/DOMKeyValue.java
@@ -550,7 +550,7 @@ public abstract class DOMKeyValue<K extends PublicKey> extends DOMStructure impl
DOMUtils.setAttribute(namedCurveElem, "URI", "urn:oid:" + oid);
String qname = (prefix == null || prefix.length() == 0)
? "xmlns" : "xmlns:" + prefix;
- namedCurveElem.setAttributeNS("http://www.w3.org/2000/xmlns/",
+ ecKeyValueElem.setAttributeNS("http://www.w3.org/2000/xmlns/",
qname, XMLDSIG_11_XMLNS);
ecKeyValueElem.appendChild(namedCurveElem);
String encoded = XMLUtils.encodeToString(ecPublicKey);