Blame SOURCES/mysql-cipherspec.patch

6f9931
Some test items assume the default SSL cipher is DHE-RSA-AES256-SHA, 
6f9931
which is no longer the case as of openssl 1.0.1.
6f9931
This patch enhances connect command by an option to specify a cipher 
6f9931
and tests are adjusted to specify the expected cipher explicitly.
6f9931
Upstream bug report: http://bugs.mysql.com/bug.php?id=64461
6f9931
6f9931
diff -Naur mysql-5.5.27.orig/client/mysqltest.cc mysql-5.5.27/client/mysqltest.cc
6f9931
--- mysql-5.5.27.orig/client/mysqltest.cc	2012-07-20 13:38:02.000000000 -0400
6f9931
+++ mysql-5.5.27/client/mysqltest.cc	2012-08-05 01:01:21.502130550 -0400
6f9931
@@ -5458,6 +5458,7 @@
6f9931
   my_bool con_ssl= 0, con_compress= 0;
6f9931
   my_bool con_pipe= 0, con_shm= 0, con_cleartext_enable= 0;
6f9931
   struct st_connection* con_slot;
6f9931
+  char *con_cipher=NULL;
6f9931
 
6f9931
   static DYNAMIC_STRING ds_connection_name;
6f9931
   static DYNAMIC_STRING ds_host;
6f9931
@@ -5548,6 +5549,8 @@
6f9931
       con_shm= 1;
6f9931
     else if (!strncmp(con_options, "CLEARTEXT", 9))
6f9931
       con_cleartext_enable= 1;
6f9931
+    else if (!strncmp(con_options, "CIPHER:", 7))
6f9931
+      con_cipher = con_options + 7;
6f9931
     else
6f9931
       die("Illegal option to connect: %.*s", 
6f9931
           (int) (end - con_options), con_options);
6f9931
@@ -5595,8 +5598,11 @@
6f9931
   if (con_ssl)
6f9931
   {
6f9931
 #if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY)
6f9931
+  /* default cipher */
6f9931
+    if (con_cipher == NULL && opt_ssl_cipher != NULL)
6f9931
+      con_cipher = opt_ssl_cipher;
6f9931
     mysql_ssl_set(&con_slot->mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
6f9931
-		  opt_ssl_capath, opt_ssl_cipher);
6f9931
+		  opt_ssl_capath, con_cipher);
6f9931
 #if MYSQL_VERSION_ID >= 50000
6f9931
     /* Turn on ssl_verify_server_cert only if host is "localhost" */
6f9931
     opt_ssl_verify_server_cert= !strcmp(ds_host.str, "localhost");
6f9931
diff -Naur mysql-5.5.27.orig/mysql-test/t/openssl_1.test mysql-5.5.27/mysql-test/t/openssl_1.test
6f9931
--- mysql-5.5.27.orig/mysql-test/t/openssl_1.test	2012-07-20 13:38:03.000000000 -0400
6f9931
+++ mysql-5.5.27/mysql-test/t/openssl_1.test	2012-08-05 01:00:27.798822919 -0400
6f9931
@@ -20,13 +20,13 @@
6f9931
 grant select on test.* to ssl_user5@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "xxx";
6f9931
 flush privileges;
6f9931
 
6f9931
-connect (con1,localhost,ssl_user1,,,,,SSL);
6f9931
-connect (con2,localhost,ssl_user2,,,,,SSL);
6f9931
-connect (con3,localhost,ssl_user3,,,,,SSL);
6f9931
-connect (con4,localhost,ssl_user4,,,,,SSL);
6f9931
+connect (con1,localhost,ssl_user1,,,,,SSL CIPHER:DHE-RSA-AES256-SHA);
6f9931
+connect (con2,localhost,ssl_user2,,,,,SSL CIPHER:DHE-RSA-AES256-SHA);
6f9931
+connect (con3,localhost,ssl_user3,,,,,SSL CIPHER:DHE-RSA-AES256-SHA);
6f9931
+connect (con4,localhost,ssl_user4,,,,,SSL CIPHER:DHE-RSA-AES256-SHA);
6f9931
 --replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
6f9931
 --error ER_ACCESS_DENIED_ERROR
6f9931
-connect (con5,localhost,ssl_user5,,,,,SSL);
6f9931
+connect (con5,localhost,ssl_user5,,,,,SSL CIPHER:DHE-RSA-AES256-SHA);
6f9931
 
6f9931
 connection con1;
6f9931
 # Check ssl turned on
6f9931
@@ -119,7 +119,7 @@
6f9931
 # verification of servers certificate by setting both ca certificate
6f9931
 # and ca path to NULL
6f9931
 #
6f9931
---exec $MYSQL --ssl --ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem -e "SHOW STATUS LIKE 'ssl_Cipher'" 2>&1
6f9931
+--exec $MYSQL --ssl --ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem --ssl-cipher=DHE-RSA-AES256-SHA -e "SHOW STATUS LIKE 'ssl_Cipher'" 2>&1
6f9931
 --echo End of 5.0 tests
6f9931
 
6f9931
 #
6f9931
@@ -244,7 +244,7 @@
6f9931
 
6f9931
 GRANT SELECT ON test.* TO bug42158@localhost REQUIRE X509;
6f9931
 FLUSH PRIVILEGES;
6f9931
-connect(con1,localhost,bug42158,,,,,SSL);
6f9931
+connect(con1,localhost,bug42158,,,,,SSL CIPHER:DHE-RSA-AES256-SHA);
6f9931
 SHOW STATUS LIKE 'Ssl_cipher';
6f9931
 disconnect con1;
6f9931
 connection default;
6f9931
diff -Naur mysql-5.5.27.orig/mysql-test/t/ssl.test mysql-5.5.27/mysql-test/t/ssl.test
6f9931
--- mysql-5.5.27.orig/mysql-test/t/ssl.test	2012-07-20 13:38:03.000000000 -0400
6f9931
+++ mysql-5.5.27/mysql-test/t/ssl.test	2012-08-05 01:00:27.800822919 -0400
6f9931
@@ -6,7 +6,7 @@
6f9931
 # Save the initial number of concurrent sessions
6f9931
 --source include/count_sessions.inc
6f9931
 
6f9931
-connect (ssl_con,localhost,root,,,,,SSL);
6f9931
+connect (ssl_con,localhost,root,,,,,SSL CIPHER:DHE-RSA-AES256-SHA);
6f9931
 
6f9931
 # Check ssl turned on
6f9931
 SHOW STATUS LIKE 'Ssl_cipher';
6f9931
diff -Naur mysql-5.5.27.orig/mysql-test/t/ssl_8k_key.test mysql-5.5.27/mysql-test/t/ssl_8k_key.test
6f9931
--- mysql-5.5.27.orig/mysql-test/t/ssl_8k_key.test	2012-07-20 13:38:03.000000000 -0400
6f9931
+++ mysql-5.5.27/mysql-test/t/ssl_8k_key.test	2012-08-05 01:00:27.799822918 -0400
6f9931
@@ -2,7 +2,7 @@
6f9931
 #
6f9931
 # Bug#29784 YaSSL assertion failure when reading 8k key.
6f9931
 #
6f9931
---exec $MYSQL --ssl --ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem -e "SHOW STATUS LIKE 'ssl_Cipher'" 2>&1
6f9931
+--exec $MYSQL --ssl --ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem --ssl-cipher=DHE-RSA-AES256-SHA -e "SHOW STATUS LIKE 'ssl_Cipher'" 2>&1
6f9931
 
6f9931
 ##  This test file is for testing encrypted communication only, not other
6f9931
 ##  encryption routines that the SSL library happens to provide!
6f9931
diff -Naur mysql-5.5.27.orig/mysql-test/t/ssl_compress.test mysql-5.5.27/mysql-test/t/ssl_compress.test
6f9931
--- mysql-5.5.27.orig/mysql-test/t/ssl_compress.test	2012-07-20 13:38:03.000000000 -0400
6f9931
+++ mysql-5.5.27/mysql-test/t/ssl_compress.test	2012-08-05 01:00:27.799822918 -0400
6f9931
@@ -7,7 +7,7 @@
6f9931
 # Save the initial number of concurrent sessions
6f9931
 --source include/count_sessions.inc
6f9931
 
6f9931
-connect (ssl_compress_con,localhost,root,,,,,SSL COMPRESS);
6f9931
+connect (ssl_compress_con,localhost,root,,,,,SSL COMPRESS CIPHER:DHE-RSA-AES256-SHA);
6f9931
 
6f9931
 # Check ssl turned on
6f9931
 SHOW STATUS LIKE 'Ssl_cipher';