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