xref: /PHP-7.4/ext/mysqlnd/mysqlnd_auth.h (revision e7e1254f)
1 /*
2   +----------------------------------------------------------------------+
3   | PHP Version 7                                                        |
4   +----------------------------------------------------------------------+
5   | Copyright (c) The PHP Group                                          |
6   +----------------------------------------------------------------------+
7   | This source file is subject to version 3.01 of the PHP license,      |
8   | that is bundled with this package in the file LICENSE, and is        |
9   | available through the world-wide-web at the following url:           |
10   | http://www.php.net/license/3_01.txt                                  |
11   | If you did not receive a copy of the PHP license and are unable to   |
12   | obtain it through the world-wide-web, please send a note to          |
13   | license@php.net so we can mail you a copy immediately.               |
14   +----------------------------------------------------------------------+
15   | Authors: Andrey Hristov <andrey@php.net>                             |
16   |          Ulf Wendel <uw@php.net>                                     |
17   +----------------------------------------------------------------------+
18 */
19 
20 #ifndef MYSQLND_AUTH_H
21 #define MYSQLND_AUTH_H
22 enum_func_status
23 mysqlnd_auth_handshake(MYSQLND_CONN_DATA * conn,
24 						const char * const user,
25 						const char * const passwd,
26 						const size_t passwd_len,
27 						const char * const db,
28 						const size_t db_len,
29 						const MYSQLND_SESSION_OPTIONS * const session_options,
30 						const zend_ulong mysql_flags,
31 						const unsigned int server_charset_no,
32 						const zend_bool use_full_blown_auth_packet,
33 						const char * const auth_protocol,
34 						struct st_mysqlnd_authentication_plugin * auth_plugin,
35 						const zend_uchar * const orig_auth_plugin_data,
36 						const size_t orig_auth_plugin_data_len,
37 						const zend_uchar * const auth_plugin_data,
38 						const size_t auth_plugin_data_len,
39 						char ** switch_to_auth_protocol,
40 						size_t * const switch_to_auth_protocol_len,
41 						zend_uchar ** switch_to_auth_protocol_data,
42 						size_t * const switch_to_auth_protocol_data_len
43 						);
44 
45 enum_func_status
46 mysqlnd_auth_change_user(MYSQLND_CONN_DATA * const conn,
47 								const char * const user,
48 								const size_t user_len,
49 								const char * const passwd,
50 								const size_t passwd_len,
51 								const char * const db,
52 								const size_t db_len,
53 								const zend_bool silent,
54 								const zend_bool use_full_blown_auth_packet,
55 								const char * const auth_protocol,
56 								struct st_mysqlnd_authentication_plugin * auth_plugin,
57 								const zend_uchar * const orig_auth_plugin_data,
58 								const size_t orig_auth_plugin_data_len,
59 								const zend_uchar * auth_plugin_data,
60 								const size_t auth_plugin_data_len,
61 								char ** switch_to_auth_protocol,
62 								size_t * const switch_to_auth_protocol_len,
63 								zend_uchar ** switch_to_auth_protocol_data,
64 								size_t * const switch_to_auth_protocol_data_len
65 								);
66 
67 
68 enum_func_status
69 mysqlnd_connect_run_authentication(
70 			MYSQLND_CONN_DATA * const conn,
71 			const char * const user,
72 			const char * const passwd,
73 			const char * const db,
74 			const size_t db_len,
75 			const size_t passwd_len,
76 			const MYSQLND_STRING authentication_plugin_data,
77 			const char * const authentication_protocol,
78 			const unsigned int charset_no,
79 			const size_t server_capabilities,
80 			const MYSQLND_SESSION_OPTIONS * const session_options,
81 			const zend_ulong mysql_flags
82 			);
83 
84 enum_func_status
85 mysqlnd_run_authentication(
86 			MYSQLND_CONN_DATA * const conn,
87 			const char * const user,
88 			const char * const passwd,
89 			const size_t passwd_len,
90 			const char * const db,
91 			const size_t db_len,
92 			const MYSQLND_STRING auth_plugin_data,
93 			const char * const auth_protocol,
94 			const unsigned int charset_no,
95 			const MYSQLND_SESSION_OPTIONS * const session_options,
96 			const zend_ulong mysql_flags,
97 			const zend_bool silent,
98 			const zend_bool is_change_user
99 			);
100 
101 PHPAPI void php_mysqlnd_scramble(zend_uchar * const buffer, const zend_uchar * const scramble, const zend_uchar * const pass, const size_t pass_len);
102 
103 #endif /* MYSQLND_AUTH_H */
104