Clone of PhatAC @ https://github.com/floaterxk/PhatAC

plugin_validate_password.h 1.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /* Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
  2. This program is free software; you can redistribute it and/or modify
  3. it under the terms of the GNU General Public License as published by
  4. the Free Software Foundation; version 2 of the License.
  5. This program is distributed in the hope that it will be useful,
  6. but WITHOUT ANY WARRANTY; without even the implied warranty of
  7. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  8. GNU General Public License for more details.
  9. You should have received a copy of the GNU General Public License
  10. along with this program; if not, write to the Free Software
  11. Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
  12. #ifndef MYSQL_PLUGIN_VALIDATE_PASSWORD_INCLUDED
  13. #define MYSQL_PLUGIN_VALIDATE_PASSWORD_INCLUDED
  14. /* API for validate_password plugin. (MYSQL_VALIDATE_PASSWORD_PLUGIN) */
  15. #include <mysql/plugin.h>
  16. #define MYSQL_VALIDATE_PASSWORD_INTERFACE_VERSION 0x0100
  17. /*
  18. The descriptor structure for the plugin, that is referred from
  19. st_mysql_plugin.
  20. */
  21. typedef void* mysql_string_handle;
  22. struct st_mysql_validate_password
  23. {
  24. int interface_version;
  25. /*
  26. This function retuns TRUE for passwords which satisfy the password
  27. policy (as choosen by plugin variable) and FALSE for all other
  28. password
  29. */
  30. int (*validate_password)(mysql_string_handle password);
  31. /*
  32. This function returns the password strength (0-100) depending
  33. upon the policies
  34. */
  35. int (*get_password_strength)(mysql_string_handle password);
  36. };
  37. #endif