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 2020/07/10 11:04:48 UTC

[santuario-xml-security-java] branch 2.1.x-fixes updated (b57006e -> c70d51f)

This is an automated email from the ASF dual-hosted git repository.

coheigea pushed a change to branch 2.1.x-fixes
in repository https://gitbox.apache.org/repos/asf/santuario-xml-security-java.git.


    from b57006e  Updating BouncyCastle
     new fe63876  Fix NPE in XMLSignatureInput.toString when bytes are null. This can happen in rare/odd scenarios where an empty node-set is canonicalized (for example, because of an incorrect XPath Transform expression).
     new f1cc599  Log a warning when Reference digest input bytes are null. This can happen in rare/odd scenarios where an empty node-set is canonicalized (for example, because of an incorrect XPath Transform expression).
     new c70d51f  Fixing typo from last commit

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../java/org/apache/jcp/xml/dsig/internal/dom/DOMReference.java   | 4 ++++
 .../java/org/apache/xml/security/signature/XMLSignatureInput.java | 8 ++++----
 2 files changed, 8 insertions(+), 4 deletions(-)


[santuario-xml-security-java] 01/03: Fix NPE in XMLSignatureInput.toString when bytes are null. This can happen in rare/odd scenarios where an empty node-set is canonicalized (for example, because of an incorrect XPath Transform expression).

Posted by co...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

coheigea pushed a commit to branch 2.1.x-fixes
in repository https://gitbox.apache.org/repos/asf/santuario-xml-security-java.git

commit fe63876d65bb4dc38c7460232516e3b44ceeb81f
Author: Sean Mullan <se...@gmail.com>
AuthorDate: Wed Jul 8 14:48:03 2020 -0400

    Fix NPE in XMLSignatureInput.toString when bytes are null. This can happen
    in rare/odd scenarios where an empty node-set is canonicalized (for example,
    because of an incorrect XPath Transform expression).
---
 .../java/org/apache/xml/security/signature/XMLSignatureInput.java | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/main/java/org/apache/xml/security/signature/XMLSignatureInput.java b/src/main/java/org/apache/xml/security/signature/XMLSignatureInput.java
index 4db587f..474c211 100644
--- a/src/main/java/org/apache/xml/security/signature/XMLSignatureInput.java
+++ b/src/main/java/org/apache/xml/security/signature/XMLSignatureInput.java
@@ -401,11 +401,11 @@ public class XMLSignatureInput {
                 + excludeComments +"/" + getSourceURI();
         }
         try {
-            return "XMLSignatureInput/OctetStream/" + getBytes().length
+            byte[] bytes = getBytes();
+            return "XMLSignatureInput/OctetStream/"
+                   + (bytes != null ? bytes.length : 0)
                    + " octets/" + getSourceURI();
-        } catch (IOException iex) {
-            return "XMLSignatureInput/OctetStream//" + getSourceURI();
-        } catch (CanonicalizationException cex) {
+        } catch (IOException | CanonicalizationException ex) {
             return "XMLSignatureInput/OctetStream//" + getSourceURI();
         }
     }


[santuario-xml-security-java] 02/03: Log a warning when Reference digest input bytes are null. This can happen in rare/odd scenarios where an empty node-set is canonicalized (for example, because of an incorrect XPath Transform expression).

Posted by co...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

coheigea pushed a commit to branch 2.1.x-fixes
in repository https://gitbox.apache.org/repos/asf/santuario-xml-security-java.git

commit f1cc5993767d04d944d90da0db5417eec049e748
Author: Sean Mullan <se...@gmail.com>
AuthorDate: Thu Jul 9 13:35:04 2020 -0400

    Log a warning when Reference digest input bytes are null. This can happen
    in rare/odd scenarios where an empty node-set is canonicalized (for example,
    because of an incorrect XPath Transform expression).
---
 .../java/org/apache/jcp/xml/dsig/internal/dom/DOMReference.java     | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/jcp/xml/dsig/internal/dom/DOMReference.java b/src/main/java/org/apache/jcp/xml/dsig/internal/dom/DOMReference.java
index e308e2c..9965ba9 100644
--- a/src/main/java/org/apache/jcp/xml/dsig/internal/dom/DOMReference.java
+++ b/src/main/java/org/apache/jcp/xml/dsig/internal/dom/DOMReference.java
@@ -1,5 +1,5 @@
 /**
- * Licensed to the Apache Software Foundation (ASF) under one
+ *r Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements. See the NOTICE file
  * distributed with this work for additional information
  * regarding copyright ownership. The ASF licenses this file
@@ -529,6 +529,10 @@ public final class DOMReference extends DOMStructure
                 } else {
                     xi.updateOutputStream(os);
                 }
+            } else {
+                LOG.warn("The input bytes to the digest operation are null. " +
+                   "This may be due to a problem with the Reference URI " +
+                   "or its Transforms.");
             }
             os.flush();
             if (cache != null && cache) {


[santuario-xml-security-java] 03/03: Fixing typo from last commit

Posted by co...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

coheigea pushed a commit to branch 2.1.x-fixes
in repository https://gitbox.apache.org/repos/asf/santuario-xml-security-java.git

commit c70d51fc2279366b8b79f587da399822bcc9eaaa
Author: Colm O hEigeartaigh <co...@apache.org>
AuthorDate: Fri Jul 10 11:06:30 2020 +0100

    Fixing typo from last commit
---
 src/main/java/org/apache/jcp/xml/dsig/internal/dom/DOMReference.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/jcp/xml/dsig/internal/dom/DOMReference.java b/src/main/java/org/apache/jcp/xml/dsig/internal/dom/DOMReference.java
index 9965ba9..a134f52 100644
--- a/src/main/java/org/apache/jcp/xml/dsig/internal/dom/DOMReference.java
+++ b/src/main/java/org/apache/jcp/xml/dsig/internal/dom/DOMReference.java
@@ -1,5 +1,5 @@
 /**
- *r Licensed to the Apache Software Foundation (ASF) under one
+ * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements. See the NOTICE file
  * distributed with this work for additional information
  * regarding copyright ownership. The ASF licenses this file