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

remm pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/10.1.x by this push:
     new 0c54bbe2bb 69607: Allow failed initialization of MD5
0c54bbe2bb is described below

commit 0c54bbe2bb9b47ceb58d36e781c554b12f2aa979
Author: remm <r...@apache.org>
AuthorDate: Tue Mar 11 22:47:29 2025 +0100

    69607: Allow failed initialization of MD5
    
    Based on code submitted by Shivam Verma
---
 .../apache/tomcat/util/security/ConcurrentMessageDigest.java  | 11 +++++++++--
 webapps/docs/changelog.xml                                    |  8 ++++++++
 2 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/tomcat/util/security/ConcurrentMessageDigest.java 
b/java/org/apache/tomcat/util/security/ConcurrentMessageDigest.java
index c59a0fe8ea..45dc4ae48c 100644
--- a/java/org/apache/tomcat/util/security/ConcurrentMessageDigest.java
+++ b/java/org/apache/tomcat/util/security/ConcurrentMessageDigest.java
@@ -23,6 +23,8 @@ import java.util.Queue;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentLinkedQueue;
 
+import org.apache.juli.logging.Log;
+import org.apache.juli.logging.LogFactory;
 import org.apache.tomcat.util.res.StringManager;
 
 /**
@@ -33,6 +35,7 @@ import org.apache.tomcat.util.res.StringManager;
 public class ConcurrentMessageDigest {
 
     private static final StringManager sm = 
StringManager.getManager(ConcurrentMessageDigest.class);
+    private static final Log log = 
LogFactory.getLog(ConcurrentMessageDigest.class);
 
     private static final String MD5 = "MD5";
     private static final String SHA1 = "SHA-1";
@@ -46,10 +49,14 @@ public class ConcurrentMessageDigest {
     }
 
     static {
+        // Init commonly used algorithms
         try {
-            // Init commonly used algorithms
             init(MD5);
-            init(SHA1);
+        } catch (NoSuchAlgorithmException e) {
+            log.warn(sm.getString("concurrentMessageDigest.noDigest"), e);
+        }
+        try {
+           init(SHA1);
         } catch (NoSuchAlgorithmException e) {
             throw new 
IllegalArgumentException(sm.getString("concurrentMessageDigest.noDigest"), e);
         }
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 89cfaac70a..d57abd0dcb 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -124,6 +124,14 @@
       </fix>
     </changelog>
   </subsection>
+  <subsection name="Coyote">
+    <changelog>
+      <fix>
+        <bug>69607</bug>: Allow failed initialization of MD5. Based on code
+        submitted by Shivam Verma. (remm)
+      </fix>
+    </changelog>
+  </subsection>
 </section>
 <section name="Tomcat 10.1.39 (schultz)" rtext="2025-03-07">
 </section>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to