68 lines
2.9 KiB
Diff
68 lines
2.9 KiB
Diff
From 560a30be0f79895d00868f7743da32302679343e Mon Sep 17 00:00:00 2001
|
|
From: Tomas Repik <trepik@redhat.com>
|
|
Date: Mon, 26 Jun 2017 13:56:47 +0200
|
|
Subject: [PATCH] remove waffle-jna
|
|
|
|
---
|
|
.../internal/com/send/SendGssApiAuthPacket.java | 31 +---------------------
|
|
1 file changed, 1 insertion(+), 30 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 b739b54..65c4507 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
|
|
@@ -56,7 +56,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.equals("")) mechanisms = "Kerberos";
|
|
|
|
- GssapiAuth gssapiAuth = getAuthenticationMethod();
|
|
+ GssapiAuth gssapiAuth = new StandardGssapiAuthentication(reader, packSeq);
|
|
gssapiAuth.authenticate(pos, serverPrincipalName, mechanisms);
|
|
}
|
|
|
|
@@ -106,33 +105,5 @@ public class SendGssApiAuthPacket extends AbstractAuthSwitchSendResponsePacket i
|
|
throw new SQLException("Authentication exception", "28000", 1045, e);
|
|
}
|
|
}
|
|
-
|
|
- /**
|
|
- * 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
|
|
- Class platformClass = Class.forName("com.sun.jna.Platform");
|
|
- @SuppressWarnings("unchecked")
|
|
- Method method = platformClass.getMethod("isWindows");
|
|
- Boolean isWindows = (Boolean) method.invoke(platformClass);
|
|
- if (isWindows.booleanValue()) {
|
|
- try {
|
|
- Class.forName("waffle.windows.auth.impl.WindowsAuthProviderImpl");
|
|
- return new WindowsNativeSspiAuthentication(reader, packSeq);
|
|
- } catch (ClassNotFoundException cle) {
|
|
- //waffle not in the classpath
|
|
- }
|
|
- }
|
|
- } catch (Exception cle) {
|
|
- //jna jar's are not in classpath
|
|
- }
|
|
- return new StandardGssapiAuthentication(reader, packSeq);
|
|
- }
|
|
-
|
|
}
|
|
|
|
--
|
|
2.9.4
|
|
|