Blame SOURCES/remove_waffle-jna.patch

7a781e
From d4d3f02f3b940693e99f065dd543e6bc03721f53 Mon Sep 17 00:00:00 2001
7a781e
From: Jakub Janco <jjanco@redhat.com>
7a781e
Date: Sat, 5 May 2018 15:37:06 +0200
7a781e
Subject: [PATCH] Remove WindowsNativeSspiAuthentication This dependency is
7a781e
 optional and not in Fedora
7a781e
7a781e
---
7a781e
 .../internal/com/send/SendGssApiAuthPacket.java    | 26 +---------------------
7a781e
 1 file changed, 1 insertion(+), 25 deletions(-)
7a781e
7a781e
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
7a781e
index 55771a61..d6a76979 100644
7a781e
--- a/src/main/java/org/mariadb/jdbc/internal/com/send/SendGssApiAuthPacket.java
7a781e
+++ b/src/main/java/org/mariadb/jdbc/internal/com/send/SendGssApiAuthPacket.java
7a781e
@@ -57,7 +57,6 @@ import org.mariadb.jdbc.internal.com.read.Buffer;
7a781e
 import org.mariadb.jdbc.internal.com.read.ErrorPacket;
7a781e
 import org.mariadb.jdbc.internal.com.send.gssapi.GssapiAuth;
7a781e
 import org.mariadb.jdbc.internal.com.send.gssapi.StandardGssapiAuthentication;
7a781e
-import org.mariadb.jdbc.internal.com.send.gssapi.WindowsNativeSspiAuthentication;
7a781e
 import org.mariadb.jdbc.internal.io.input.PacketInputStream;
7a781e
 import org.mariadb.jdbc.internal.io.output.PacketOutputStream;
7a781e
 
7a781e
@@ -88,7 +87,7 @@ public class SendGssApiAuthPacket extends AbstractAuthSwitchSendResponsePacket i
7a781e
         String mechanisms = buffer.readStringNullEnd(StandardCharsets.UTF_8);
7a781e
         if (mechanisms.isEmpty()) mechanisms = "Kerberos";
7a781e
 
7a781e
-        GssapiAuth gssapiAuth = getAuthenticationMethod();
7a781e
+        GssapiAuth gssapiAuth = new StandardGssapiAuthentication(reader, packSeq);
7a781e
         gssapiAuth.authenticate(pos, serverPrincipalName, mechanisms);
7a781e
     }
7a781e
 
7a781e
@@ -107,28 +106,5 @@ public class SendGssApiAuthPacket extends AbstractAuthSwitchSendResponsePacket i
7a781e
         }
7a781e
     }
7a781e
 
7a781e
-    /**
7a781e
-     * Get authentication method according to classpath.
7a781e
-     * Windows native authentication is using Waffle-jna.
7a781e
-     *
7a781e
-     * @return authentication method
7a781e
-     */
7a781e
-    private GssapiAuth getAuthenticationMethod() {
7a781e
-        try {
7a781e
-            //Waffle-jna has jna as dependency, so if not available on classpath, just use standard authentication
7a781e
-            if (Platform.isWindows()) {
7a781e
-                try {
7a781e
-                    Class.forName("waffle.windows.auth.impl.WindowsAuthProviderImpl");
7a781e
-                    return new WindowsNativeSspiAuthentication(reader, packSeq);
7a781e
-                } catch (ClassNotFoundException cle) {
7a781e
-                    //waffle not in the classpath
7a781e
-                }
7a781e
-            }
7a781e
-        } catch (Throwable cle) {
7a781e
-            //jna jar's are not in classpath
7a781e
-        }
7a781e
-        return new StandardGssapiAuthentication(reader, packSeq);
7a781e
-    }
7a781e
-
7a781e
 }
7a781e
 
7a781e
-- 
7a781e
2.14.3
7a781e