This is an automated email from the ASF dual-hosted git repository. remm pushed a commit to branch 9.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/9.0.x by this push: new f7b6e26b8f 69607: Allow failed initialization of MD5 f7b6e26b8f is described below commit f7b6e26b8f3a905e47c1461b9ec3582829ab8669 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 d89c4638bd..54156e7815 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 9.0.102 (remm)" rtext="2025-03-06"> <subsection name="Catalina"> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org