Skip to content

Commit c26ec71

Browse files
committed
Revert "WL#11645: Backport caching_sha2_password to libmysql 5.7"
Broken build, missing file.
1 parent b53d1c9 commit c26ec71

20 files changed

+20
-359
lines changed

client/base/mysql_connection_options.cc

-19
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#include "mysql_connection_options.h"
2222
#include "abstract_program.h"
2323
#include <mysys_err.h>
24-
#include "caching_sha2_passwordopt-vars.h"
2524

2625
using Mysql::Tools::Base::Abstract_program;
2726
using namespace Mysql::Tools::Base::Options;
@@ -113,11 +112,6 @@ void Mysql_connection_options::create_options()
113112
"Directory for client-side plugins.");
114113
this->create_new_option(&this->m_default_auth, "default_auth",
115114
"Default authentication client-side plugin to use.");
116-
this->create_new_option(&this->m_server_public_key, "server_public_key_path",
117-
"Path to file containing server public key");
118-
this->create_new_option(&this->m_get_server_public_key,
119-
"get-server-public-key",
120-
"Get public key from server");
121115
}
122116

123117
MYSQL* Mysql_connection_options::create_connection()
@@ -163,19 +157,6 @@ MYSQL* Mysql_connection_options::create_connection()
163157
mysql_options4(connection, MYSQL_OPT_CONNECT_ATTR_ADD,
164158
"program_name", this->m_program->get_name().c_str());
165159

166-
#if !defined(HAVE_YASSL)
167-
if (this->m_server_public_key.has_value())
168-
{
169-
opt_server_public_key=
170-
const_cast <char *> (this->m_server_public_key.value().c_str());
171-
}
172-
173-
opt_get_server_public_key= this->m_get_server_public_key ? TRUE : FALSE;
174-
#endif /* !HAVE_YASSL */
175-
176-
set_server_public_key(connection);
177-
set_get_server_public_key_option(connection);
178-
179160
if (!mysql_real_connect(connection,
180161
this->get_null_or_string(this->m_host),
181162
this->get_null_or_string(this->m_user),

client/base/mysql_connection_options.h

-2
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,6 @@ class Mysql_connection_options
137137
Nullable<std::string> m_user;
138138
Nullable<std::string> m_password;
139139
Nullable<std::string> m_default_charset;
140-
Nullable<std::string> m_server_public_key;
141-
bool m_get_server_public_key;
142140
};
143141

144142
}

client/check/mysqlcheck.cc

-6
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
#include <mysql_version.h>
2525
#include <mysqld_error.h>
2626
#include <sslopt-vars.h>
27-
#include <caching_sha2_passwordopt-vars.h>
2827
#include <welcome_copyright_notice.h> /* ORACLE_WELCOME_COPYRIGHT_NOTICE */
2928

3029
using namespace Mysql::Tools::Check;
@@ -199,7 +198,6 @@ static struct my_option my_long_options[] =
199198
&opt_mysql_unix_port, &opt_mysql_unix_port, 0, GET_STR,
200199
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
201200
#include <sslopt-longopts.h>
202-
#include <caching_sha2_passwordopt-longopts.h>
203201
{"tables", OPT_TABLES, "Overrides option --databases (-B).", 0, 0, 0,
204202
GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
205203
{"use-frm", OPT_FRM,
@@ -490,10 +488,6 @@ static int dbConnect(char *host, char *user, char *passwd)
490488
mysql_options(&mysql_connection, MYSQL_OPT_CONNECT_ATTR_RESET, 0);
491489
mysql_options4(&mysql_connection, MYSQL_OPT_CONNECT_ATTR_ADD,
492490
"program_name", "mysqlcheck");
493-
494-
set_server_public_key(&mysql_connection);
495-
set_get_server_public_key_option(&mysql_connection);
496-
497491
if (!(sock = mysql_real_connect(&mysql_connection, host, user, passwd,
498492
NULL, opt_mysql_port, opt_mysql_unix_port, 0)))
499493
{

client/mysql.cc

+13-4
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,9 @@ static STATUS status;
168168
static ulong select_limit,max_join_size,opt_connect_timeout=0;
169169
static char mysql_charsets_dir[FN_REFLEN+1];
170170
static char *opt_plugin_dir= 0, *opt_default_auth= 0;
171+
#if !defined(HAVE_YASSL)
172+
static char *opt_server_public_key= 0;
173+
#endif
171174
static const char *xmlmeta[] = {
172175
"&", "&amp;",
173176
"<", "&lt;",
@@ -195,7 +198,6 @@ static char *shared_memory_base_name=0;
195198
static uint opt_protocol=0;
196199
static const CHARSET_INFO *charset_info= &my_charset_latin1;
197200

198-
#include "caching_sha2_passwordopt-vars.h"
199201
#include "sslopt-vars.h"
200202

201203
const char *default_dbug_option="d:t:o,/tmp/mysql.trace";
@@ -1811,7 +1813,6 @@ static struct my_option my_long_options[] =
18111813
&opt_mysql_unix_port, &opt_mysql_unix_port, 0, GET_STR_ALLOC,
18121814
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
18131815
#include "sslopt-longopts.h"
1814-
#include "caching_sha2_passwordopt-longopts.h"
18151816
{"table", 't', "Output in table format.", &output_tables,
18161817
&output_tables, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
18171818
{"tee", OPT_TEE,
@@ -1879,6 +1880,12 @@ static struct my_option my_long_options[] =
18791880
"piped to mysql or loaded using the 'source' command). This is necessary "
18801881
"when processing output from mysqlbinlog that may contain blobs.",
18811882
&opt_binary_mode, &opt_binary_mode, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
1883+
#if !defined(HAVE_YASSL)
1884+
{"server-public-key-path", OPT_SERVER_PUBLIC_KEY,
1885+
"File path to the server public RSA key in PEM format.",
1886+
&opt_server_public_key, &opt_server_public_key, 0,
1887+
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
1888+
#endif
18821889
{"connect-expired-password", 0,
18831890
"Notify the server that this client is prepared to handle expired "
18841891
"password sandbox mode.",
@@ -5153,8 +5160,10 @@ init_connection_options(MYSQL *mysql)
51535160
if (opt_default_auth && *opt_default_auth)
51545161
mysql_options(mysql, MYSQL_DEFAULT_AUTH, opt_default_auth);
51555162

5156-
set_server_public_key(mysql);
5157-
set_get_server_public_key_option(mysql);
5163+
#if !defined(HAVE_YASSL)
5164+
if (opt_server_public_key && *opt_server_public_key)
5165+
mysql_options(mysql, MYSQL_SERVER_PUBLIC_KEY, opt_server_public_key);
5166+
#endif
51585167

51595168
if (using_opt_enable_cleartext_plugin)
51605169
mysql_options(mysql, MYSQL_ENABLE_CLEARTEXT_PLUGIN,

client/mysqladmin.cc

-5
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ static my_bool ex_status_printed = 0; /* First output is not relative. */
7070
static uint ex_var_count, max_var_length, max_val_length;
7171

7272
#include <sslopt-vars.h>
73-
#include <caching_sha2_passwordopt-vars.h>
7473

7574
static void print_version(void);
7675
static void usage(void);
@@ -211,7 +210,6 @@ static struct my_option my_long_options[] =
211210
&interval, &interval, 0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0,
212211
0, 0},
213212
#include <sslopt-longopts.h>
214-
#include <caching_sha2_passwordopt-longopts.h>
215213
{"user", 'u', "User for login if not current user.", &user,
216214
&user, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
217215
{"verbose", 'v', "Write more information.", &opt_verbose,
@@ -418,9 +416,6 @@ int main(int argc,char *argv[])
418416
mysql_options(&mysql, MYSQL_OPT_CAN_HANDLE_EXPIRED_PASSWORDS,
419417
&can_handle_passwords);
420418

421-
set_server_public_key(&mysql);
422-
set_get_server_public_key_option(&mysql);
423-
424419
if (sql_connect(&mysql, option_wait))
425420
{
426421
/*

client/mysqlbinlog.cc

-5
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
#include "my_default.h"
3535
#include <my_time.h>
3636
#include <sslopt-vars.h>
37-
#include <caching_sha2_passwordopt-vars.h>
3837
/* That one is necessary for defines of OPTION_NO_FOREIGN_KEY_CHECKS etc */
3938
#include "query_options.h"
4039
#include <signal.h>
@@ -1871,7 +1870,6 @@ static struct my_option my_long_options[] =
18711870
&sock, &sock, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0,
18721871
0, 0},
18731872
#include <sslopt-longopts.h>
1874-
#include <caching_sha2_passwordopt-longopts.h>
18751873
{"start-datetime", OPT_START_DATETIME,
18761874
"Start reading the binlog at first event having a datetime equal or "
18771875
"posterior to the argument; the argument must be a date and time "
@@ -2286,9 +2284,6 @@ static Exit_status safe_connect()
22862284
mysql_options4(mysql, MYSQL_OPT_CONNECT_ATTR_ADD,
22872285
"_client_role", "binary_log_listener");
22882286

2289-
set_server_public_key(mysql);
2290-
set_get_server_public_key_option(mysql);
2291-
22922287
if (!mysql_real_connect(mysql, host, user, pass, 0, port, sock, 0))
22932288
{
22942289
error("Failed on connect: %s", mysql_error(mysql));

client/mysqldump.c

-6
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,6 @@ static char * opt_mysql_unix_port=0;
143143
static char *opt_bind_addr = NULL;
144144
static int first_error=0;
145145
#include <sslopt-vars.h>
146-
#include <caching_sha2_passwordopt-vars.h>
147146
FILE *md_result_file= 0;
148147
FILE *stderror_file=0;
149148

@@ -527,7 +526,6 @@ static struct my_option my_long_options[] =
527526
" uses old (pre-4.1.1) protocol. Deprecated. Always TRUE",
528527
&opt_secure_auth, &opt_secure_auth, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
529528
#include <sslopt-longopts.h>
530-
#include <caching_sha2_passwordopt-longopts.h>
531529
{"tab",'T',
532530
"Create tab-separated textfile for each table to given path. (Create .sql "
533531
"and .txt files.) NOTE: This only works if mysqldump is run on the same "
@@ -1683,10 +1681,6 @@ static int connect_to_db(char *host, char *user,char *passwd)
16831681
mysql_options(&mysql_connection, MYSQL_OPT_CONNECT_ATTR_RESET, 0);
16841682
mysql_options4(&mysql_connection, MYSQL_OPT_CONNECT_ATTR_ADD,
16851683
"program_name", "mysqldump");
1686-
1687-
set_server_public_key(&mysql_connection);
1688-
set_get_server_public_key_option(&mysql_connection);
1689-
16901684
if (!(mysql= mysql_real_connect(&mysql_connection,host,user,passwd,
16911685
NULL,opt_mysql_port,opt_mysql_unix_port,
16921686
0)))

client/mysqlimport.c

-6
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ static char * opt_mysql_unix_port=0;
5959
static char *opt_plugin_dir= 0, *opt_default_auth= 0;
6060
static longlong opt_ignore_lines= -1;
6161
#include <sslopt-vars.h>
62-
#include <caching_sha2_passwordopt-vars.h>
6362

6463
#if defined (_WIN32) && !defined (EMBEDDED_LIBRARY)
6564
static char *shared_memory_base_name=0;
@@ -188,7 +187,6 @@ static struct my_option my_long_options[] =
188187
&opt_mysql_unix_port, &opt_mysql_unix_port, 0, GET_STR,
189188
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
190189
#include <sslopt-longopts.h>
191-
#include <caching_sha2_passwordopt-longopts.h>
192190
{"use-threads", OPT_USE_THREADS,
193191
"Load files in parallel. The argument is the number "
194192
"of threads to use for loading data.",
@@ -499,10 +497,6 @@ static MYSQL *db_connect(char *host, char *database,
499497
mysql_options(mysql, MYSQL_OPT_CONNECT_ATTR_RESET, 0);
500498
mysql_options4(mysql, MYSQL_OPT_CONNECT_ATTR_ADD,
501499
"program_name", "mysqlimport");
502-
503-
set_server_public_key(mysql);
504-
set_get_server_public_key_option(mysql);
505-
506500
if (!(mysql_real_connect(mysql,host,user,passwd,
507501
database,opt_mysql_port,opt_mysql_unix_port,
508502
0)))

client/mysqlshow.c

-6
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
#include <signal.h>
2929
#include <stdarg.h>
3030
#include <sslopt-vars.h>
31-
#include <caching_sha2_passwordopt-vars.h>
3231
#include <welcome_copyright_notice.h> /* ORACLE_WELCOME_COPYRIGHT_NOTICE */
3332

3433
static char * host=0, *opt_password=0, *user=0;
@@ -146,10 +145,6 @@ int main(int argc, char **argv)
146145
mysql_options(&mysql, MYSQL_OPT_CONNECT_ATTR_RESET, 0);
147146
mysql_options4(&mysql, MYSQL_OPT_CONNECT_ATTR_ADD,
148147
"program_name", "mysqlshow");
149-
150-
set_server_public_key(&mysql);
151-
set_get_server_public_key_option(&mysql);
152-
153148
if (!(mysql_real_connect(&mysql,host,user,opt_password,
154149
(first_argument_uses_wildcards) ? "" :
155150
argv[0],opt_mysql_port,opt_mysql_unix_port,
@@ -269,7 +264,6 @@ static struct my_option my_long_options[] =
269264
&opt_mysql_unix_port, &opt_mysql_unix_port, 0, GET_STR,
270265
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
271266
#include <sslopt-longopts.h>
272-
#include <caching_sha2_passwordopt-longopts.h>
273267
{"user", 'u', "User for login if not current user.", &user,
274268
&user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
275269
{"verbose", 'v',

client/mysqlslap.cc

-6
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@
8787
#include <signal.h>
8888
#include <stdarg.h>
8989
#include <sslopt-vars.h>
90-
#include <caching_sha2_passwordopt-vars.h>
9190
#include <sys/types.h>
9291
#ifdef HAVE_SYS_WAIT_H
9392
#include <sys/wait.h>
@@ -360,10 +359,6 @@ int main(int argc, char **argv)
360359
if (using_opt_enable_cleartext_plugin)
361360
mysql_options(&mysql, MYSQL_ENABLE_CLEARTEXT_PLUGIN,
362361
(char*) &opt_enable_cleartext_plugin);
363-
364-
set_server_public_key(&mysql);
365-
set_get_server_public_key_option(&mysql);
366-
367362
if (!opt_only_print)
368363
{
369364
if (!(mysql_real_connect(&mysql, host, user, opt_password,
@@ -710,7 +705,6 @@ static struct my_option my_long_options[] =
710705
{"sql_mode", 0, "Specify sql-mode to run mysqlslap tool.", &sql_mode,
711706
&sql_mode, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
712707
#include <sslopt-longopts.h>
713-
#include <caching_sha2_passwordopt-longopts.h>
714708
{"user", 'u', "User for login if not current user.", &user,
715709
&user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
716710
{"verbose", 'v',

client/mysqltest.cc

+3-10
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,9 @@ static my_bool is_windows= 0;
165165
static char **default_argv;
166166
static const char *load_default_groups[]= { "mysqltest", "client", 0 };
167167
static char line_buffer[MAX_DELIMITER_LENGTH], *line_buffer_pos= line_buffer;
168+
#if !defined(HAVE_YASSL)
169+
static const char *opt_server_public_key= 0;
170+
#endif
168171
static my_bool can_handle_expired_passwords= TRUE;
169172

170173
/* Info on properties that can be set with --enable_X and --disable_X */
@@ -296,7 +299,6 @@ typedef Prealloced_array<st_command*, 1024> Q_lines;
296299
Q_lines *q_lines;
297300

298301
#include "sslopt-vars.h"
299-
#include <caching_sha2_passwordopt-vars.h>
300302

301303
struct Parser
302304
{
@@ -5742,10 +5744,6 @@ void safe_connect(MYSQL* mysql, const char *name, const char *host,
57425744
"program_name", "mysqltest");
57435745
mysql_options(mysql, MYSQL_OPT_CAN_HANDLE_EXPIRED_PASSWORDS,
57445746
&can_handle_expired_passwords);
5745-
5746-
set_server_public_key(mysql);
5747-
set_get_server_public_key_option(mysql);
5748-
57495747
while(!mysql_real_connect(mysql, host,user, pass, db, port, sock,
57505748
CLIENT_MULTI_STATEMENTS | CLIENT_REMEMBER_OPTIONS))
57515749
{
@@ -5851,10 +5849,6 @@ int connect_n_handle_errors(struct st_command *command,
58515849
mysql_options4(con, MYSQL_OPT_CONNECT_ATTR_ADD, "program_name", "mysqltest");
58525850
mysql_options(con, MYSQL_OPT_CAN_HANDLE_EXPIRED_PASSWORDS,
58535851
&can_handle_expired_passwords);
5854-
5855-
set_server_public_key(con);
5856-
set_get_server_public_key_option(con);
5857-
58585852
while (!mysql_real_connect(con, host, user, pass, db, port, sock ? sock: 0,
58595853
CLIENT_MULTI_STATEMENTS))
58605854
{
@@ -7108,7 +7102,6 @@ static struct my_option my_long_options[] =
71087102
&sp_protocol, &sp_protocol, 0,
71097103
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
71107104
#include "sslopt-longopts.h"
7111-
#include <caching_sha2_passwordopt-longopts.h>
71127105
{"tail-lines", OPT_TAIL_LINES,
71137106
"Number of lines of the result to include in a failure report.",
71147107
&opt_tail_lines, &opt_tail_lines, 0,

include/mysql.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,7 @@ enum mysql_option
166166
MYSQL_OPT_SSL_ENFORCE,
167167
MYSQL_OPT_MAX_ALLOWED_PACKET, MYSQL_OPT_NET_BUFFER_LENGTH,
168168
MYSQL_OPT_TLS_VERSION,
169-
MYSQL_OPT_SSL_MODE,
170-
MYSQL_OPT_GET_SERVER_PUBLIC_KEY
169+
MYSQL_OPT_SSL_MODE
171170
};
172171

173172
/**

include/mysql.h.pp

+1-5
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,6 @@
180180
void get_salt_from_password(unsigned char *res, const char *password);
181181
void make_password_from_salt(char *to, const unsigned char *hash_stage2);
182182
char *octet2hex(char *to, const char *str, unsigned int len);
183-
my_bool generate_sha256_scramble(unsigned char *dst, size_t dst_size,
184-
const char *src, size_t src_size, const char *rnd,
185-
size_t rnd_size);
186183
char *get_tty_password(const char *opt_message);
187184
const char *mysql_errno_to_sqlstate(unsigned int mysql_errno);
188185
my_bool my_thread_init(void);
@@ -365,8 +362,7 @@
365362
MYSQL_OPT_SSL_ENFORCE,
366363
MYSQL_OPT_MAX_ALLOWED_PACKET, MYSQL_OPT_NET_BUFFER_LENGTH,
367364
MYSQL_OPT_TLS_VERSION,
368-
MYSQL_OPT_SSL_MODE,
369-
MYSQL_OPT_GET_SERVER_PUBLIC_KEY
365+
MYSQL_OPT_SSL_MODE
370366
};
371367
struct st_mysql_options_extention;
372368
struct st_mysql_options {

include/mysql/client_authentication.h

-3
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@ C_MODE_START
2222
int sha256_password_auth_client(MYSQL_PLUGIN_VIO *vio, MYSQL *mysql);
2323
int sha256_password_init(char *, size_t, int, va_list);
2424
int sha256_password_deinit(void);
25-
int caching_sha2_password_auth_client(MYSQL_PLUGIN_VIO *vio, MYSQL *mysql);
26-
int caching_sha2_password_init(char *, size_t, int, va_list);
27-
int caching_sha2_password_deinit(void);
2825
C_MODE_END
2926

3027
#endif

include/mysql_com.h

-4
Original file line numberDiff line numberDiff line change
@@ -587,10 +587,6 @@ char *octet2hex(char *to, const char *str, unsigned int len);
587587

588588
/* end of password.c */
589589

590-
my_bool generate_sha256_scramble(unsigned char *dst, size_t dst_size,
591-
const char *src, size_t src_size, const char *rnd,
592-
size_t rnd_size);
593-
594590
char *get_tty_password(const char *opt_message);
595591
const char *mysql_errno_to_sqlstate(unsigned int mysql_errno);
596592

include/sql_common.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ struct st_mysql_options_extention {
103103
char *server_public_key_path;
104104
size_t connection_attributes_length;
105105
my_bool enable_cleartext_plugin;
106-
my_bool get_server_public_key;
106+
my_bool unused0; /* Former ssl_enforce */
107107
char *tls_version; /* TLS version option */
108108
long ssl_ctx_flags; /* SSL ctx options flag */
109109
unsigned int ssl_mode;

0 commit comments

Comments
 (0)