1 /* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
2
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License, version 2.0,
5 as published by the Free Software Foundation.
6
7 This program is also distributed with certain software (including
8 but not limited to OpenSSL) that is licensed under separate terms,
9 as designated in a particular file or component or in included license
10 documentation. The authors of MySQL hereby grant you an additional
11 permission to link the program and your derivative works with the
12 separately licensed software that they have included with MySQL.
13
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License, version 2.0, for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
22
23 #include <my_global.h>
24 #include <mysql.h>
25 #include <mysql/plugin_auth.h>
26 #include <mysql/client_plugin.h>
27
28 #include "common.h"
29
30 /*
31 The following MS C++ specific pragma embeds a comment in the resulting
32 object file. A "lib" comment tells the linker to use the specified
33 library, thus the dependency is handled automagically.
34 */
35
36 #ifdef _MSC_VER
37 #pragma comment(lib, "Secur32")
38 #endif
39
win_auth_client_plugin_init(char *,size_t,int,va_list)40 static int win_auth_client_plugin_init(char*, size_t, int, va_list)
41 {
42 return 0;
43 }
44
45
win_auth_client_plugin_deinit()46 static int win_auth_client_plugin_deinit()
47 {
48 return 0;
49 }
50
51
52 int win_auth_handshake_client(MYSQL_PLUGIN_VIO *vio, MYSQL *mysql);
53
54
55 /*
56 Client plugin declaration. This is added to mysql_client_builtins[]
57 in sql-common/client.c
58 */
59
60 extern "C"
61 st_mysql_client_plugin_AUTHENTICATION win_auth_client_plugin=
62 {
63 MYSQL_CLIENT_AUTHENTICATION_PLUGIN,
64 MYSQL_CLIENT_AUTHENTICATION_PLUGIN_INTERFACE_VERSION,
65 "authentication_windows_client",
66 "Rafal Somla",
67 "Windows Authentication Plugin - client side",
68 {0,1,0},
69 "GPL",
70 NULL,
71 win_auth_client_plugin_init,
72 win_auth_client_plugin_deinit,
73 NULL, // option handling
74 win_auth_handshake_client
75 };
76