This is an automated email from the ASF dual-hosted git repository.
markt-asf 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 7ed79b9a79 Fix JndiRealm tests
7ed79b9a79 is described below
commit 7ed79b9a7992a7d7dd8340576f112f78820d2674
Author: Mark Thomas <[email protected]>
AuthorDate: Wed Jun 24 17:39:13 2026 +0100
Fix JndiRealm tests
---
test/org/apache/catalina/realm/TestJNDIRealm.java | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/test/org/apache/catalina/realm/TestJNDIRealm.java
b/test/org/apache/catalina/realm/TestJNDIRealm.java
index f9d9ebae6a..ba0c19cc67 100644
--- a/test/org/apache/catalina/realm/TestJNDIRealm.java
+++ b/test/org/apache/catalina/realm/TestJNDIRealm.java
@@ -54,6 +54,9 @@ public class TestJNDIRealm {
private static final String REALM = "test-realm";
private static final String NONCE = "test-nonce";
+ private static final String CNONCE = "cnonce";
+ private static final String NC = "00000001";
+ private static final String QOP = "auth";
// Not digested but doesn't matter for the purposes of the test
private static final String DIGEST_A2 = "method:request-uri";
public static final String USER_PASSWORD_ATTR = "test-pwd";
@@ -72,9 +75,9 @@ public class TestJNDIRealm {
// WHEN
String expectedResponse =
- HexUtils.toHexString(md5Helper.digest((digestA1() + ":" +
NONCE + ":" + DIGEST_A2).getBytes()));
+ HexUtils.toHexString(md5Helper.digest((digestA1() + ":" +
NONCE + ":" + NC + ":" + CNONCE + ":" + QOP + ":" + DIGEST_A2).getBytes()));
Principal principal =
- realm.authenticate(USER, expectedResponse, NONCE, null, null,
null, REALM, DIGEST_A2, ALGORITHM);
+ realm.authenticate(USER, expectedResponse, NONCE, NC, CNONCE,
QOP, REALM, DIGEST_A2, ALGORITHM);
// THEN
Assert.assertNull(principal);
@@ -88,9 +91,9 @@ public class TestJNDIRealm {
// WHEN
String expectedResponse =
- HexUtils.toHexString(md5Helper.digest((digestA1() + ":" +
NONCE + ":" + DIGEST_A2).getBytes()));
+ HexUtils.toHexString(md5Helper.digest((digestA1() + ":" +
NONCE + ":" + NC + ":" + CNONCE + ":" + QOP + ":" + DIGEST_A2).getBytes()));
Principal principal =
- realm.authenticate(USER, expectedResponse, NONCE, null, null,
null, REALM, DIGEST_A2, ALGORITHM);
+ realm.authenticate(USER, expectedResponse, NONCE, NC, CNONCE,
QOP, REALM, DIGEST_A2, ALGORITHM);
// THEN
assertThat(principal, instanceOf(GenericPrincipal.class));
@@ -106,9 +109,9 @@ public class TestJNDIRealm {
// WHEN
String expectedResponse =
- HexUtils.toHexString(md5Helper.digest((digestA1() + ":" +
NONCE + ":" + DIGEST_A2).getBytes()));
+ HexUtils.toHexString(md5Helper.digest((digestA1() + ":" +
NONCE + ":" + NC + ":" + CNONCE + ":" + QOP + ":" + DIGEST_A2).getBytes()));
Principal principal =
- realm.authenticate(USER, expectedResponse, NONCE, null, null,
null, REALM, DIGEST_A2, ALGORITHM);
+ realm.authenticate(USER, expectedResponse, NONCE, NC, CNONCE,
QOP, REALM, DIGEST_A2, ALGORITHM);
// THEN
assertThat(principal, instanceOf(GenericPrincipal.class));
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]