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

markt pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/main by this push:
     new fa5c6af57a Clean-up / improve naming. No functional change.
fa5c6af57a is described below

commit fa5c6af57a627a13d46661166d07d4973f22ce99
Author: Mark Thomas <[email protected]>
AuthorDate: Thu Sep 8 19:48:33 2022 +0100

    Clean-up / improve naming. No functional change.
---
 .../tomcat/websocket/BasicAuthenticator.java       | 14 +++++++-------
 .../tomcat/websocket/DigestAuthenticator.java      | 22 +++++++++++-----------
 2 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/java/org/apache/tomcat/websocket/BasicAuthenticator.java 
b/java/org/apache/tomcat/websocket/BasicAuthenticator.java
index 49c58b0f24..439a7bbc2b 100644
--- a/java/org/apache/tomcat/websocket/BasicAuthenticator.java
+++ b/java/org/apache/tomcat/websocket/BasicAuthenticator.java
@@ -22,7 +22,7 @@ import java.util.Base64;
 import java.util.Map;
 
 /**
- * Authenticator supporting the BASIC auth method.
+ * Authenticator supporting the BASIC authentication method.
  */
 public class BasicAuthenticator extends Authenticator {
 
@@ -34,20 +34,20 @@ public class BasicAuthenticator extends Authenticator {
             Map<String, Object> userProperties) throws AuthenticationException 
{
 
         String userName = (String) 
userProperties.get(Constants.WS_AUTHENTICATION_USER_NAME);
-        String password = (String) 
userProperties.get(Constants.WS_AUTHENTICATION_PASSWORD);
+        String userPassword = (String) 
userProperties.get(Constants.WS_AUTHENTICATION_PASSWORD);
 
-        if (userName == null || password == null) {
+        if (userName == null || userPassword == null) {
             throw new AuthenticationException(
                     "Failed to perform Basic authentication due to  missing 
user/password");
         }
 
-        Map<String, String> wwwAuthenticate = 
parseWWWAuthenticateHeader(WWWAuthenticate);
+        Map<String, String> parameterMap = 
parseWWWAuthenticateHeader(WWWAuthenticate);
 
-        String userPass = userName + ":" + password;
+        String userPass = userName + ":" + userPassword;
         Charset charset;
 
-        if (wwwAuthenticate.get(charsetparam) != null
-                && 
wwwAuthenticate.get(charsetparam).equalsIgnoreCase("UTF-8")) {
+        if (parameterMap.get(charsetparam) != null
+                && parameterMap.get(charsetparam).equalsIgnoreCase("UTF-8")) {
             charset = StandardCharsets.UTF_8;
         } else {
             charset = StandardCharsets.ISO_8859_1;
diff --git a/java/org/apache/tomcat/websocket/DigestAuthenticator.java 
b/java/org/apache/tomcat/websocket/DigestAuthenticator.java
index 5bd513fc2f..0ea037afde 100644
--- a/java/org/apache/tomcat/websocket/DigestAuthenticator.java
+++ b/java/org/apache/tomcat/websocket/DigestAuthenticator.java
@@ -25,7 +25,7 @@ import java.util.Map;
 import org.apache.tomcat.util.security.MD5Encoder;
 
 /**
- * Authenticator supporting the DIGEST auth method.
+ * Authenticator supporting the DIGEST authentication method.
  */
 public class DigestAuthenticator extends Authenticator {
 
@@ -40,21 +40,21 @@ public class DigestAuthenticator extends Authenticator {
             Map<String, Object> userProperties) throws AuthenticationException 
{
 
         String userName = (String) 
userProperties.get(Constants.WS_AUTHENTICATION_USER_NAME);
-        String password = (String) 
userProperties.get(Constants.WS_AUTHENTICATION_PASSWORD);
+        String userPassword = (String) 
userProperties.get(Constants.WS_AUTHENTICATION_PASSWORD);
 
-        if (userName == null || password == null) {
+        if (userName == null || userPassword == null) {
             throw new AuthenticationException(
                     "Failed to perform Digest authentication due to  missing 
user/password");
         }
 
-        Map<String, String> wwwAuthenticate = 
parseWWWAuthenticateHeader(WWWAuthenticate);
+        Map<String, String> parameterMap = 
parseWWWAuthenticateHeader(WWWAuthenticate);
 
-        String realm = wwwAuthenticate.get("realm");
-        String nonce = wwwAuthenticate.get("nonce");
-        String messageQop = wwwAuthenticate.get("qop");
-        String algorithm = wwwAuthenticate.get("algorithm") == null ? "MD5"
-                : wwwAuthenticate.get("algorithm");
-        String opaque = wwwAuthenticate.get("opaque");
+        String realm = parameterMap.get("realm");
+        String nonce = parameterMap.get("nonce");
+        String messageQop = parameterMap.get("qop");
+        String algorithm = parameterMap.get("algorithm") == null ? "MD5"
+                : parameterMap.get("algorithm");
+        String opaque = parameterMap.get("opaque");
 
         StringBuilder challenge = new StringBuilder();
 
@@ -78,7 +78,7 @@ public class DigestAuthenticator extends Authenticator {
         challenge.append("uri=\"" + requestUri + "\",");
 
         try {
-            challenge.append("response=\"" + 
calculateRequestDigest(requestUri, userName, password,
+            challenge.append("response=\"" + 
calculateRequestDigest(requestUri, userName, userPassword,
                     realm, nonce, messageQop, algorithm) + "\",");
         }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to