plugin_validate_password.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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, version 2.0,
  4. as published by the Free Software Foundation.
  5. This program is also distributed with certain software (including
  6. but not limited to OpenSSL) that is licensed under separate terms,
  7. as designated in a particular file or component or in included license
  8. documentation. The authors of MySQL hereby grant you an additional
  9. permission to link the program and your derivative works with the
  10. separately licensed software that they have included with MySQL.
  11. This program is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. GNU General Public License, version 2.0, for more details.
  15. You should have received a copy of the GNU General Public License
  16. along with this program; if not, write to the Free Software
  17. Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
  18. #ifndef MYSQL_PLUGIN_VALIDATE_PASSWORD_INCLUDED
  19. #define MYSQL_PLUGIN_VALIDATE_PASSWORD_INCLUDED
  20. /* API for validate_password plugin. (MYSQL_VALIDATE_PASSWORD_PLUGIN) */
  21. #include <mysql/plugin.h>
  22. #define MYSQL_VALIDATE_PASSWORD_INTERFACE_VERSION 0x0100
  23. /*
  24. The descriptor structure for the plugin, that is referred from
  25. st_mysql_plugin.
  26. */
  27. typedef void* mysql_string_handle;
  28. struct st_mysql_validate_password
  29. {
  30. int interface_version;
  31. /*
  32. This function retuns TRUE for passwords which satisfy the password
  33. policy (as choosen by plugin variable) and FALSE for all other
  34. password
  35. */
  36. int (*validate_password)(mysql_string_handle password);
  37. /*
  38. This function returns the password strength (0-100) depending
  39. upon the policies
  40. */
  41. int (*get_password_strength)(mysql_string_handle password);
  42. };
  43. #endif