Skip to content

Commit

Permalink
Fixed KeyValue construction for ECC keys (#334)
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
Gamuci authored Jun 21, 2024
1 parent 85c4d0c commit d8277bd
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ void marshalPublicKey(Node parent, Document doc, String dsPrefix,
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);
Expand Down

0 comments on commit d8277bd

Please sign in to comment.