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

remm 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 b58963db13 Fix regression in SPNEGO authenticator when processing 
Base64
b58963db13 is described below

commit b58963db1384ac286774a0d894a49fea0e1414de
Author: remm <r...@apache.org>
AuthorDate: Wed May 29 16:58:16 2024 +0200

    Fix regression in SPNEGO authenticator when processing Base64
    
    BZ 69066
    Submitted by Daniel Lyko
---
 java/org/apache/catalina/authenticator/SpnegoAuthenticator.java | 3 ++-
 webapps/docs/changelog.xml                                      | 4 ++++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/catalina/authenticator/SpnegoAuthenticator.java 
b/java/org/apache/catalina/authenticator/SpnegoAuthenticator.java
index 1ea2f4c734..8bed63a40e 100644
--- a/java/org/apache/catalina/authenticator/SpnegoAuthenticator.java
+++ b/java/org/apache/catalina/authenticator/SpnegoAuthenticator.java
@@ -168,7 +168,8 @@ public class SpnegoAuthenticator extends AuthenticatorBase {
         authorizationBC.setStart(authorizationBC.getStart() + 10);
 
         byte[] encoded = new byte[authorizationBC.getLength()];
-        System.arraycopy(authorizationBC.getBuffer(), 0, encoded, 0, 
authorizationBC.getLength());
+        System.arraycopy(authorizationBC.getBuffer(), 
authorizationBC.getStart(),
+                encoded, 0, authorizationBC.getLength());
         byte[] decoded = Base64.getDecoder().decode(encoded);
 
         if (getApplyJava8u40Fix()) {
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 78e8bacf37..b0f241936b 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -114,6 +114,10 @@
         Remove the <code>WebdavFixFilter</code> as it is no longer required.
         (markt)
       </scode>
+      <fix>
+        <bug>69066</bug>: Fix regression in SPNEGO authenticator when
+        processing Base64. Submitted by Daniel Lyko. (remm)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Coyote">


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

Reply via email to