mysqlnd_auth.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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. #ifndef MYSQLND_AUTH_H
  18. #define MYSQLND_AUTH_H
  19. enum_func_status
  20. mysqlnd_auth_handshake(MYSQLND_CONN_DATA * conn,
  21. const char * const user,
  22. const char * const passwd,
  23. const size_t passwd_len,
  24. const char * const db,
  25. const size_t db_len,
  26. const MYSQLND_SESSION_OPTIONS * const session_options,
  27. const zend_ulong mysql_flags,
  28. const unsigned int server_charset_no,
  29. const bool use_full_blown_auth_packet,
  30. const char * const auth_protocol,
  31. struct st_mysqlnd_authentication_plugin * auth_plugin,
  32. const zend_uchar * const orig_auth_plugin_data,
  33. const size_t orig_auth_plugin_data_len,
  34. const zend_uchar * const auth_plugin_data,
  35. const size_t auth_plugin_data_len,
  36. char ** switch_to_auth_protocol,
  37. size_t * const switch_to_auth_protocol_len,
  38. zend_uchar ** switch_to_auth_protocol_data,
  39. size_t * const switch_to_auth_protocol_data_len
  40. );
  41. enum_func_status
  42. mysqlnd_auth_change_user(MYSQLND_CONN_DATA * const conn,
  43. const char * const user,
  44. const size_t user_len,
  45. const char * const passwd,
  46. const size_t passwd_len,
  47. const char * const db,
  48. const size_t db_len,
  49. const bool silent,
  50. const bool use_full_blown_auth_packet,
  51. const char * const auth_protocol,
  52. struct st_mysqlnd_authentication_plugin * auth_plugin,
  53. const zend_uchar * const orig_auth_plugin_data,
  54. const size_t orig_auth_plugin_data_len,
  55. const zend_uchar * auth_plugin_data,
  56. const size_t auth_plugin_data_len,
  57. char ** switch_to_auth_protocol,
  58. size_t * const switch_to_auth_protocol_len,
  59. zend_uchar ** switch_to_auth_protocol_data,
  60. size_t * const switch_to_auth_protocol_data_len
  61. );
  62. enum_func_status
  63. mysqlnd_connect_run_authentication(
  64. MYSQLND_CONN_DATA * const conn,
  65. const char * const user,
  66. const char * const passwd,
  67. const char * const db,
  68. const size_t db_len,
  69. const size_t passwd_len,
  70. const MYSQLND_STRING authentication_plugin_data,
  71. const char * const authentication_protocol,
  72. const unsigned int charset_no,
  73. const size_t server_capabilities,
  74. const MYSQLND_SESSION_OPTIONS * const session_options,
  75. const zend_ulong mysql_flags
  76. );
  77. enum_func_status
  78. mysqlnd_run_authentication(
  79. MYSQLND_CONN_DATA * const conn,
  80. const char * const user,
  81. const char * const passwd,
  82. const size_t passwd_len,
  83. const char * const db,
  84. const size_t db_len,
  85. const MYSQLND_STRING auth_plugin_data,
  86. const char * const auth_protocol,
  87. const unsigned int charset_no,
  88. const MYSQLND_SESSION_OPTIONS * const session_options,
  89. const zend_ulong mysql_flags,
  90. const bool silent,
  91. const bool is_change_user
  92. );
  93. PHPAPI void php_mysqlnd_scramble(zend_uchar * const buffer, const zend_uchar * const scramble, const zend_uchar * const pass, const size_t pass_len);
  94. #endif /* MYSQLND_AUTH_H */