MySQL 8.2.0
Source Code Documentation
validate_password_imp.h
Go to the documentation of this file.
1/* Copyright (c) 2017, 2023, Oracle and/or its affiliates.
2
3This program is free software; you can redistribute it and/or modify
4it under the terms of the GNU General Public License, version 2.0,
5as published by the Free Software Foundation.
6
7This program is also distributed with certain software (including
8but not limited to OpenSSL) that is licensed under separate terms,
9as designated in a particular file or component or in included license
10documentation. The authors of MySQL hereby grant you an additional
11permission to link the program and your derivative works with the
12separately licensed software that they have included with MySQL.
13
14This program is distributed in the hope that it will be useful,
15but WITHOUT ANY WARRANTY; without even the implied warranty of
16MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17GNU General Public License, version 2.0, for more details.
18
19You should have received a copy of the GNU General Public License
20along with this program; if not, write to the Free Software
21Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
22
23#ifndef VALIDATE_PASSWORD_IMP_H
24#define VALIDATE_PASSWORD_IMP_H
25
35
37extern REQUIRES_SERVICE_PLACEHOLDER(log_builtins);
38extern REQUIRES_SERVICE_PLACEHOLDER(log_builtins_string);
39extern REQUIRES_SERVICE_PLACEHOLDER(mysql_string_character_access);
40extern REQUIRES_SERVICE_PLACEHOLDER(mysql_string_factory);
41extern REQUIRES_SERVICE_PLACEHOLDER(mysql_string_case);
42extern REQUIRES_SERVICE_PLACEHOLDER(mysql_string_converter);
43extern REQUIRES_SERVICE_PLACEHOLDER(mysql_string_iterator);
44extern REQUIRES_SERVICE_PLACEHOLDER(mysql_string_ctype);
45extern REQUIRES_SERVICE_PLACEHOLDER(mysql_string_value);
46extern REQUIRES_SERVICE_PLACEHOLDER(component_sys_variable_register);
47extern REQUIRES_SERVICE_PLACEHOLDER(component_sys_variable_unregister);
48extern REQUIRES_SERVICE_PLACEHOLDER(status_variable_registration);
49extern REQUIRES_SERVICE_PLACEHOLDER(mysql_thd_security_context);
50extern REQUIRES_SERVICE_PLACEHOLDER(mysql_security_context_options);
51extern REQUIRES_SERVICE_PLACEHOLDER(psi_memory_v2);
52
53/**
54 An implementation of the password_validation_service to validate password and
55 to get its strength.
56*/
58 public:
59 /**
60 Validates the strength of given password.
61
62 @sa validate_password::validate()
63 */
64 static DEFINE_BOOL_METHOD(validate, (void *thd, my_h_string password));
65
66 /**
67 Gets the password strength between (0-100)
68
69 @sa validate_password::get_strength()
70 */
72 unsigned int *strength));
73};
74
76 public:
77 /**
78 Validate if number of changed characters matches the pre-configured
79 criteria
80
81 @param [in] current_password Current password
82 @param [in] new_password New password
83 @param [out] minimum_required Minimum required number of changed characters
84 @param [out] changed Actual number of changed characters
85
86 @returns Result of validation
87 @retval false Success
88 @retval true Error
89 */
90 static DEFINE_BOOL_METHOD(validate, (my_h_string current_password,
91 my_h_string new_password,
92 uint *minimum_required, uint *changed));
93};
94#endif /* VALIDATE_PASSWORD_IMP_H */
Definition: validate_password_imp.h:75
static mysql_service_status_t validate(my_h_string current_password, my_h_string new_password, uint *minimum_required, uint *changed) noexcept
Validate if number of changed characters matches the pre-configured criteria.
Definition: validate_password_imp.cc:615
An implementation of the password_validation_service to validate password and to get its strength.
Definition: validate_password_imp.h:57
static mysql_service_status_t get_strength(void *thd, my_h_string password, unsigned int *strength) noexcept
Gets the password strength between (0-100)
Definition: validate_password_imp.cc:531
static mysql_service_status_t validate(void *thd, my_h_string password) noexcept
Validates the strength of given password.
Definition: validate_password_imp.cc:587
Specifies macros to define Components.
static char * password
Definition: mysql_secure_installation.cc:57
Specifies macros to define Service Implementations.
#define DEFINE_BOOL_METHOD(name, args)
A short macro to define method that returns bool, which is the most common case.
Definition: service_implementation.h:87
Definition: mysql_string_service.cc:59
REQUIRES_SERVICE_PLACEHOLDER(registry)