You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ws.apache.org by co...@apache.org on 2026/09/22 13:05:51 UTC
(ws-wss4j) branch 3_0_x-fixes updated: Using AttachmentUtil as well for attachment signature transform
This is an automated email from the ASF dual-hosted git repository.
coheigea pushed a commit to branch 3_0_x-fixes
in repository https://gitbox.apache.org/repos/asf/ws-wss4j.git
The following commit(s) were added to refs/heads/3_0_x-fixes by this push:
new 5b246209b Using AttachmentUtil as well for attachment signature transform
5b246209b is described below
commit 5b246209b7b7a372e2612e3006f5af3616cadf02
Author: Colm O hEigeartaigh <co...@apache.org>
AuthorDate: Tue Sep 22 14:00:32 2026 +0100
Using AttachmentUtil as well for attachment signature transform
---
.../wss4j/dom/transform/AttachmentCompleteSignatureTransform.java | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/ws-security-dom/src/main/java/org/apache/wss4j/dom/transform/AttachmentCompleteSignatureTransform.java b/ws-security-dom/src/main/java/org/apache/wss4j/dom/transform/AttachmentCompleteSignatureTransform.java
index 861c44e2e..78d617426 100644
--- a/ws-security-dom/src/main/java/org/apache/wss4j/dom/transform/AttachmentCompleteSignatureTransform.java
+++ b/ws-security-dom/src/main/java/org/apache/wss4j/dom/transform/AttachmentCompleteSignatureTransform.java
@@ -25,6 +25,7 @@ import java.io.OutputStream;
import org.apache.jcp.xml.dsig.internal.dom.ApacheOctetStreamData;
import org.apache.wss4j.common.ext.Attachment;
+import org.apache.wss4j.common.ext.WSSecurityException;
import org.apache.wss4j.common.util.AttachmentUtils;
import org.apache.wss4j.dom.WSConstants;
@@ -54,7 +55,12 @@ public class AttachmentCompleteSignatureTransform extends AttachmentContentSigna
public Data transform(Data data, XMLCryptoContext context, OutputStream os) throws TransformException {
String attachmentUri = ((ApacheOctetStreamData) data).getURI();
- String attachmentId = attachmentUri.substring(4);
+ String attachmentId;
+ try {
+ attachmentId = AttachmentUtils.getAttachmentId(attachmentUri);
+ } catch (WSSecurityException e) {
+ throw new TransformException(e);
+ }
AttachmentTransformParameterSpec attachmentTransformParameterSpec = getAttachmentTransformParameterSpec();