Jason,

On 3/9/16 1:19 PM, Jason Overland wrote:
> For what it's worth, that analysis & approach to fixing seem
> reasonable to me.  Yes I'll be glad to file a bug report and test a
> patch.

Give this patch a try:

============ CUT =============

Index: java/org/apache/catalina/realm/JAASMemoryLoginModule.java
===================================================================
--- java/org/apache/catalina/realm/JAASMemoryLoginModule.java   (revision
1725851)
+++ java/org/apache/catalina/realm/JAASMemoryLoginModule.java   (working copy)
@@ -18,6 +18,7 @@

 import java.io.File;
 import java.io.IOException;
+import java.security.NoSuchAlgorithmException;
 import java.security.Principal;
 import java.util.Map;

@@ -221,6 +222,18 @@
         if (options.get("pathname") != null)
             this.pathname = (String) options.get("pathname");

+        // TODO: This should probably have many more options available
+        MessageDigestCredentialHandler ch = new
MessageDigestCredentialHandler();
+        Object digestAlgorithm = options.get("digest");
+        if(digestAlgorithm instanceof String) {
+            try {
+                ch.setAlgorithm((String)digestAlgorithm);
+            } catch (NoSuchAlgorithmException nsae) {
+                log.error("Cannot initialize credential handler", nsae);
+            }
+        }
+        setCredentialHandler(ch);
+
         // Load our defined Principals
         load();

================

Once you're re-built, change your JAAS configuration to:

jaas.config:
/** JAAS Login Configuration for the Application **/

JAASTomcat {
   org.apache.catalina.realm.JAASMemoryLoginModule required debug=true
digest=SHA;
};

(note the digest=SHA is on the same line with everything else)

I have no idea how the options get parsed; we'll see if this simple
implementation will get you going again.

-chris

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

Reply via email to