Blob Blame History Raw
From d4d3f02f3b940693e99f065dd543e6bc03721f53 Mon Sep 17 00:00:00 2001
From: Jakub Janco <jjanco@redhat.com>
Date: Sat, 5 May 2018 15:37:06 +0200
Subject: [PATCH] Remove WindowsNativeSspiAuthentication This dependency is
 optional and not in Fedora

---
 .../internal/com/send/SendGssApiAuthPacket.java    | 26 +---------------------
 1 file changed, 1 insertion(+), 25 deletions(-)

diff --git a/src/main/java/org/mariadb/jdbc/internal/com/send/SendGssApiAuthPacket.java b/src/main/java/org/mariadb/jdbc/internal/com/send/SendGssApiAuthPacket.java
index 55771a61..d6a76979 100644
--- a/src/main/java/org/mariadb/jdbc/internal/com/send/SendGssApiAuthPacket.java
+++ b/src/main/java/org/mariadb/jdbc/internal/com/send/SendGssApiAuthPacket.java
@@ -57,7 +57,6 @@ import org.mariadb.jdbc.internal.com.read.Buffer;
 import org.mariadb.jdbc.internal.com.read.ErrorPacket;
 import org.mariadb.jdbc.internal.com.send.gssapi.GssapiAuth;
 import org.mariadb.jdbc.internal.com.send.gssapi.StandardGssapiAuthentication;
-import org.mariadb.jdbc.internal.com.send.gssapi.WindowsNativeSspiAuthentication;
 import org.mariadb.jdbc.internal.io.input.PacketInputStream;
 import org.mariadb.jdbc.internal.io.output.PacketOutputStream;
 
@@ -88,7 +87,7 @@ public class SendGssApiAuthPacket extends AbstractAuthSwitchSendResponsePacket i
         String mechanisms = buffer.readStringNullEnd(StandardCharsets.UTF_8);
         if (mechanisms.isEmpty()) mechanisms = "Kerberos";
 
-        GssapiAuth gssapiAuth = getAuthenticationMethod();
+        GssapiAuth gssapiAuth = new StandardGssapiAuthentication(reader, packSeq);
         gssapiAuth.authenticate(pos, serverPrincipalName, mechanisms);
     }
 
@@ -107,28 +106,5 @@ public class SendGssApiAuthPacket extends AbstractAuthSwitchSendResponsePacket i
         }
     }
 
-    /**
-     * Get authentication method according to classpath.
-     * Windows native authentication is using Waffle-jna.
-     *
-     * @return authentication method
-     */
-    private GssapiAuth getAuthenticationMethod() {
-        try {
-            //Waffle-jna has jna as dependency, so if not available on classpath, just use standard authentication
-            if (Platform.isWindows()) {
-                try {
-                    Class.forName("waffle.windows.auth.impl.WindowsAuthProviderImpl");
-                    return new WindowsNativeSspiAuthentication(reader, packSeq);
-                } catch (ClassNotFoundException cle) {
-                    //waffle not in the classpath
-                }
-            }
-        } catch (Throwable cle) {
-            //jna jar's are not in classpath
-        }
-        return new StandardGssapiAuthentication(reader, packSeq);
-    }
-
 }
 
-- 
2.14.3