2007-07-13 04:06:33 +02:00
|
|
|
# Turn on ssl between the client and server
|
|
|
|
# and run a number of tests
|
|
|
|
|
Backport of:
ChangeSet@1.2703, 2007-12-07 09:35:28-05:00, cmiller@zippy.cornsilk.net +40 -0
Bug#13174: SHA2 function
Patch contributed from Bill Karwin, paper unnumbered CLA in Seattle
Implement SHA2 functions.
Chad added code to make it work with YaSSL. Also, he removed the
(probable) bug of embedded server never using SSL-dependent
functions. (libmysqld/Makefile.am didn't read ANY autoconf defs.)
Function specification:
SHA2( string cleartext, integer hash_length )
-> string hash, or NULL
where hash_length is one of 224, 256, 384, or 512. If either is
NULL or a length is unsupported, then the result is NULL. The
resulting string is always the length of the hash_length parameter
or is NULL.
Include the canonical hash examples from the NIST in the test
results.
---
Polish and address concerns of reviewers.
2010-04-13 17:04:45 +02:00
|
|
|
-- source include/have_ssl_communication.inc
|
2007-07-13 04:06:33 +02:00
|
|
|
-- source include/big_test.inc
|
|
|
|
|
2009-03-03 21:34:18 +01:00
|
|
|
# Save the initial number of concurrent sessions
|
|
|
|
--source include/count_sessions.inc
|
|
|
|
|
2007-07-13 04:06:33 +02:00
|
|
|
--disable_warnings
|
|
|
|
DROP TABLE IF EXISTS t1, t2;
|
|
|
|
--enable_warnings
|
|
|
|
|
|
|
|
#
|
2009-03-03 21:34:18 +01:00
|
|
|
# Bug#29579 Clients using SSL can hang the server
|
2007-07-13 04:06:33 +02:00
|
|
|
#
|
|
|
|
|
|
|
|
connect (ssl_con,localhost,root,,,,,SSL);
|
|
|
|
|
|
|
|
create table t1 (a int);
|
|
|
|
|
|
|
|
disconnect ssl_con;
|
|
|
|
|
2009-03-03 21:34:18 +01:00
|
|
|
|
2007-07-13 04:06:33 +02:00
|
|
|
--disable_query_log
|
|
|
|
--disable_result_log
|
|
|
|
|
|
|
|
let $count= 2000;
|
|
|
|
while ($count)
|
|
|
|
{
|
|
|
|
connect (ssl_con,localhost,root,,,,,SSL);
|
2009-03-03 21:34:18 +01:00
|
|
|
|
2007-07-13 04:06:33 +02:00
|
|
|
eval insert into t1 values ($count);
|
|
|
|
dec $count;
|
2009-03-03 21:34:18 +01:00
|
|
|
|
|
|
|
# This select causes the net buffer to fill as the server sends the results
|
2007-07-13 04:06:33 +02:00
|
|
|
# but the client doesn't reap the results. The results are larger each time
|
|
|
|
# through the loop, so that eventually the buffer is completely full
|
|
|
|
# at the exact moment the server attempts to the close the connection with
|
|
|
|
# the lock held.
|
|
|
|
send select * from t1;
|
2009-03-03 21:34:18 +01:00
|
|
|
|
2007-07-13 04:06:33 +02:00
|
|
|
# now send the quit the command so the server will initiate the shutdown.
|
2009-03-03 21:34:18 +01:00
|
|
|
send_quit ssl_con;
|
|
|
|
|
2007-07-13 04:06:33 +02:00
|
|
|
# if the server is hung, this will hang too:
|
|
|
|
connect (ssl_con2,localhost,root,,,,,SSL);
|
2009-03-03 21:34:18 +01:00
|
|
|
|
2007-07-13 04:06:33 +02:00
|
|
|
# no hang if we get here, close and retry
|
|
|
|
disconnect ssl_con2;
|
|
|
|
disconnect ssl_con;
|
2009-03-03 21:34:18 +01:00
|
|
|
}
|
2007-07-13 04:06:33 +02:00
|
|
|
--enable_query_log
|
|
|
|
--enable_result_log
|
|
|
|
|
|
|
|
connect (ssl_con,localhost,root,,,,,SSL);
|
|
|
|
|
|
|
|
drop table t1;
|
2009-03-03 21:34:18 +01:00
|
|
|
connection default;
|
|
|
|
disconnect ssl_con;
|
|
|
|
|
|
|
|
# Wait till all disconnects are completed
|
|
|
|
--source include/wait_until_count_sessions.inc
|
2007-07-13 04:06:33 +02:00
|
|
|
|
Backport of:
ChangeSet@1.2703, 2007-12-07 09:35:28-05:00, cmiller@zippy.cornsilk.net +40 -0
Bug#13174: SHA2 function
Patch contributed from Bill Karwin, paper unnumbered CLA in Seattle
Implement SHA2 functions.
Chad added code to make it work with YaSSL. Also, he removed the
(probable) bug of embedded server never using SSL-dependent
functions. (libmysqld/Makefile.am didn't read ANY autoconf defs.)
Function specification:
SHA2( string cleartext, integer hash_length )
-> string hash, or NULL
where hash_length is one of 224, 256, 384, or 512. If either is
NULL or a length is unsupported, then the result is NULL. The
resulting string is always the length of the hash_length parameter
or is NULL.
Include the canonical hash examples from the NIST in the test
results.
---
Polish and address concerns of reviewers.
2010-04-13 17:04:45 +02:00
|
|
|
## This test file is for testing encrypted communication only, not other
|
|
|
|
## encryption routines that the SSL library happens to provide!
|