From 3ae5ee41be958e59be174a6e68e05446e8baf355 Mon Sep 17 00:00:00 2001
From: ulrich@undisclosed <ulrich@ulrich-vaio>
Date: Mon, 30 Mar 2020 14:55:06 +0000
Subject: [PATCH] Digester auf die Nutzung der 'matches'-Methode umgestellt

---
 src/java/de/uhilger/um/TomcatDigester.java |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/src/java/de/uhilger/um/TomcatDigester.java b/src/java/de/uhilger/um/TomcatDigester.java
index 9af1a5e..75108a2 100644
--- a/src/java/de/uhilger/um/TomcatDigester.java
+++ b/src/java/de/uhilger/um/TomcatDigester.java
@@ -57,5 +57,17 @@
     mh.setEncoding(encoding);
     return mh.mutate(text);
   }
+
+  @Override
+  public boolean matches(String inputCredentials, String storedCredentials, String algorithm, String encoding) {
+    MessageDigestCredentialHandler mh = new MessageDigestCredentialHandler();
+    try {
+      mh.setAlgorithm(algorithm);
+    } catch (NoSuchAlgorithmException ex) {
+      Logger.getLogger(TomcatDigester.class.getName()).log(Level.SEVERE, null, ex);
+    }
+    mh.setEncoding(encoding);
+    return mh.matches(inputCredentials, storedCredentials);
+  }
   
 }

--
Gitblit v1.9.3