You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by db...@apache.org on 2020/06/14 22:24:33 UTC

[tomee-patch-plugin] branch master updated (c0e9f90 -> eda6fd1)

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

dblevins pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/tomee-patch-plugin.git.


    from c0e9f90  Don't modify bytecode of patched classes
     new 7d443dc  Transform path 'resources/javax.faces'
     new eda6fd1  Strip out jar signatures

The 2 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:
 .../apache/tomee/patch/core/Transformation.java    | 25 +++++++++++++++++++++-
 1 file changed, 24 insertions(+), 1 deletion(-)


[tomee-patch-plugin] 02/02: Strip out jar signatures

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

dblevins pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomee-patch-plugin.git

commit eda6fd1cd89fb7d1343c13300ce3cba09cef7f9e
Author: David Blevins <da...@gmail.com>
AuthorDate: Sun Jun 14 14:40:28 2020 -0700

    Strip out jar signatures
---
 .../org/apache/tomee/patch/core/Transformation.java    | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/tomee-patch-core/src/main/java/org/apache/tomee/patch/core/Transformation.java b/tomee-patch-core/src/main/java/org/apache/tomee/patch/core/Transformation.java
index 3448970..12d1480 100644
--- a/tomee-patch-core/src/main/java/org/apache/tomee/patch/core/Transformation.java
+++ b/tomee-patch-core/src/main/java/org/apache/tomee/patch/core/Transformation.java
@@ -81,6 +81,11 @@ public class Transformation {
                 // TODO: the name may be changed in transformation
                 final String path = updatePath(oldEntry.getName());
 
+                if (skip(path)) {
+                    IO.copy(zipInputStream, skipped);
+                    continue;
+                }
+                
                 /*
                  * If this entry has been patched, skip it
                  * We will add the patched version at the end
@@ -137,6 +142,19 @@ public class Transformation {
         }
     }
 
+    /**
+     * Skip signed jar public key files.  We most definitely
+     * have tampered with the jar.
+     */
+    private boolean skip(final String name) {
+        if (name.startsWith("META-INF/")) {
+            if (name.endsWith(".SF")) return true;
+            if (name.endsWith(".DSA")) return true;
+            if (name.endsWith(".RSA")) return true;
+        }
+        return false;
+    }
+    
     private String updatePath(final String name) {
         return name.replace("resources/javax.faces","resources/jakarta.faces");
     }


[tomee-patch-plugin] 01/02: Transform path 'resources/javax.faces'

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

dblevins pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomee-patch-plugin.git

commit 7d443dc3545086ea6e007327cb5c08b082a92ba2
Author: David Blevins <da...@gmail.com>
AuthorDate: Sun Jun 14 12:38:40 2020 -0700

    Transform path 'resources/javax.faces'
---
 .../src/main/java/org/apache/tomee/patch/core/Transformation.java  | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/tomee-patch-core/src/main/java/org/apache/tomee/patch/core/Transformation.java b/tomee-patch-core/src/main/java/org/apache/tomee/patch/core/Transformation.java
index 384ca65..3448970 100644
--- a/tomee-patch-core/src/main/java/org/apache/tomee/patch/core/Transformation.java
+++ b/tomee-patch-core/src/main/java/org/apache/tomee/patch/core/Transformation.java
@@ -79,7 +79,7 @@ public class Transformation {
             ZipEntry oldEntry;
             while ((oldEntry = zipInputStream.getNextEntry()) != null) {
                 // TODO: the name may be changed in transformation
-                final String path = oldEntry.getName();
+                final String path = updatePath(oldEntry.getName());
 
                 /*
                  * If this entry has been patched, skip it
@@ -91,6 +91,7 @@ public class Transformation {
                     continue;
                 }
 
+
                 final ZipEntry newEntry = new ZipEntry(path);
 
                 //            copyAttributes(oldEntry, newEntry);
@@ -136,6 +137,10 @@ public class Transformation {
         }
     }
 
+    private String updatePath(final String name) {
+        return name.replace("resources/javax.faces","resources/jakarta.faces");
+    }
+
     private boolean copyUnmodified(final String path) {
         if (path.endsWith("META-INF/DEPENDENCIES")) return true;
         if (path.endsWith("META-INF/dependencies.xml")) return true;