Skip to content

Commit a84a50e

Browse files
author
Kristofer Pettersson
committed
WL5602 - moved tests to new test suite as mtr can't detect correct
prerequisites if sha256_password isn't compiled in.
1 parent 7b27ea2 commit a84a50e

15 files changed

+19
-12
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
--loose-sha256_password_private_key_path=$MYSQL_TEST_DIR/std_data/rsa_private_key.pem
2+
--loose-sha256_password_public_key_path=$MYSQL_TEST_DIR/std_data/rsa_public_key.pem

mysql-test/t/plugin_auth_sha256.test renamed to mysql-test/suite/sha256_auth/t/plugin_auth_sha256.test

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
--source include/have_openssl.inc
2+
--source include/have_plugin_auth_sha256.inc
13
--source include/not_embedded.inc
24
--source include/mysql_upgrade_preparation.inc
35

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
--loose-sha256_password_private_key_path=$MYSQL_TEST_DIR/std_data/rsa_private_key.pem
2+
--loose-sha256_password_public_key_path=$MYSQL_TEST_DIR/std_data/rsa_public_key.pem
3+
--default_authentication=sha256_password

mysql-test/t/plugin_auth_sha256_2.test renamed to mysql-test/suite/sha256_auth/t/plugin_auth_sha256_2.test

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
--source include/have_openssl.inc
2+
--source include/have_plugin_auth_sha256.inc
13
--source include/not_embedded.inc
24
--source include/mysql_upgrade_preparation.inc
35

mysql-test/t/plugin_auth_sha256-master.opt

-2
This file was deleted.

mysql-test/t/plugin_auth_sha256_2-master.opt

-3
This file was deleted.

sql-common/crypt_genhash_impl.cc

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <limits.h>
99
#ifdef HAVE_YASSL
1010
#include <sha.hpp>
11+
#include <openssl/ssl.h>
1112
#else
1213
#include <sys/types.h>
1314
#include <openssl/sha.h>

sql/sql_acl.cc

+9-7
Original file line numberDiff line numberDiff line change
@@ -2554,7 +2554,8 @@ update_user_table(THD *thd, TABLE *table,
25542554

25552555
table->field[(int) password_field]->store(new_password, new_password_len,
25562556
system_charset_info);
2557-
if (new_password_len == SCRAMBLED_PASSWORD_CHAR_LENGTH_323)
2557+
if (new_password_len == SCRAMBLED_PASSWORD_CHAR_LENGTH_323 &&
2558+
password_field == MYSQL_USER_FIELD_PASSWORD)
25582559
WARN_DEPRECATED_41_PWD_HASH(thd);
25592560

25602561
if ((error=table->file->ha_update_row(table->record[1],table->record[0])) &&
@@ -2659,8 +2660,6 @@ static int replace_user_table(THD *thd, TABLE *table, LEX_USER *combo,
26592660

26602661
mysql_mutex_assert_owner(&acl_cache->lock);
26612662

2662-
if (combo->password.length == SCRAMBLED_PASSWORD_CHAR_LENGTH_323)
2663-
WARN_DEPRECATED_41_PWD_HASH(thd);
26642663
table->use_all_columns();
26652664
DBUG_ASSERT(combo->host.str != '\0');
26662665
table->field[MYSQL_USER_FIELD_HOST]->store(combo->host.str,combo->host.length,
@@ -2766,6 +2765,8 @@ static int replace_user_table(THD *thd, TABLE *table, LEX_USER *combo,
27662765
#endif
27672766
{
27682767
/* Use the legacy Password field */
2768+
if (combo->password.length == SCRAMBLED_PASSWORD_CHAR_LENGTH_323)
2769+
WARN_DEPRECATED_41_PWD_HASH(thd);
27692770
table->field[MYSQL_USER_FIELD_PASSWORD]->store(password, password_len,
27702771
system_charset_info);
27712772
table->field[MYSQL_USER_FIELD_AUTHENTICATION_STRING]->store("\0", 0,
@@ -2867,6 +2868,8 @@ static int replace_user_table(THD *thd, TABLE *table, LEX_USER *combo,
28672868
#endif
28682869
{
28692870
/* The legacy Password field is used */
2871+
if (combo->password.length == SCRAMBLED_PASSWORD_CHAR_LENGTH_323)
2872+
WARN_DEPRECATED_41_PWD_HASH(thd);
28702873
table->field[MYSQL_USER_FIELD_PASSWORD]->
28712874
store(password, password_len, system_charset_info);
28722875
table->field[MYSQL_USER_FIELD_AUTHENTICATION_STRING]->
@@ -8725,7 +8728,7 @@ void init_default_auth_plugin()
87258728

87268729
int set_default_auth_plugin(char *plugin_name, int plugin_name_length)
87278730
{
8728-
// TODO verify that the auth plugin is present
8731+
#if defined(HAVE_OPENSSL)
87298732
default_auth_plugin_name.str= plugin_name;
87308733
default_auth_plugin_name.length= plugin_name_length;
87318734

@@ -8740,6 +8743,7 @@ int set_default_auth_plugin(char *plugin_name, int plugin_name_length)
87408743
*/
87418744
global_system_variables.old_passwords= 2;
87428745
}
8746+
#endif
87438747
#endif
87448748
return 0;
87458749
}
@@ -11135,8 +11139,7 @@ mysql_declare_plugin(mysql_password)
1113511139
NULL, /* config options */
1113611140
0, /* flags */
1113711141
}
11138-
#ifdef HAVE_OPENSSL
11139-
#ifndef HAVE_YASSL
11142+
#if defined(HAVE_OPENSSL) && !defined(HAVE_YASSL)
1114011143
,
1114111144
{
1114211145
MYSQL_AUTHENTICATION_PLUGIN, /* type constant */
@@ -11154,6 +11157,5 @@ mysql_declare_plugin(mysql_password)
1115411157
0 /* flags */
1115511158
}
1115611159
#endif
11157-
#endif
1115811160
mysql_declare_plugin_end;
1115911161

0 commit comments

Comments
 (0)