Commit 19f51d3f authored by unknown's avatar unknown
Browse files

Merge neptunus.(none):/home/msvensson/mysql/mysql-4.1

into neptunus.(none):/home/msvensson/mysql/bug10589

parents 2af65b1d 2e0ac6d6
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
-- require r/not_openssl.require
disable_query_log;
show variables like "have_openssl";
enable_query_log;
+56 −0
Original line number Diff line number Diff line
@@ -120,6 +120,60 @@ hello
select des_decrypt(des_encrypt("hello",4),'password4');
des_decrypt(des_encrypt("hello",4),'password4')
hello
select des_encrypt("hello",10);
des_encrypt("hello",10)
NULL
Warnings:
Error	1108	Incorrect parameters to procedure 'des_encrypt'
select des_encrypt(NULL);
des_encrypt(NULL)
NULL
Warnings:
Error	1108	Incorrect parameters to procedure 'des_encrypt'
select des_encrypt(NULL, 10);
des_encrypt(NULL, 10)
NULL
Warnings:
Error	1108	Incorrect parameters to procedure 'des_encrypt'
select des_encrypt(NULL, NULL);
des_encrypt(NULL, NULL)
NULL
Warnings:
Error	1108	Incorrect parameters to procedure 'des_encrypt'
select des_encrypt(10, NULL);
des_encrypt(10, NULL)
NULL
Warnings:
Error	1108	Incorrect parameters to procedure 'des_encrypt'
select des_encrypt("hello", NULL);
des_encrypt("hello", NULL)
NULL
Warnings:
Error	1108	Incorrect parameters to procedure 'des_encrypt'
select des_decrypt("hello",10);
des_decrypt("hello",10)
hello
select des_decrypt(NULL);
des_decrypt(NULL)
NULL
Warnings:
Error	1108	Incorrect parameters to procedure 'des_decrypt'
select des_decrypt(NULL, 10);
des_decrypt(NULL, 10)
NULL
Warnings:
Error	1108	Incorrect parameters to procedure 'des_decrypt'
select des_decrypt(NULL, NULL);
des_decrypt(NULL, NULL)
NULL
Warnings:
Error	1108	Incorrect parameters to procedure 'des_decrypt'
select des_decrypt(10, NULL);
des_decrypt(10, NULL)
10
select des_decrypt("hello", NULL);
des_decrypt("hello", NULL)
hello
SET @a=des_decrypt(des_encrypt("hello"));
flush des_key_file;
select @a = des_decrypt(des_encrypt("hello"));
@@ -134,6 +188,8 @@ NULL
select hex(des_decrypt(des_encrypt("hello","hidden")));
hex(des_decrypt(des_encrypt("hello","hidden")))
NULL
Warnings:
Error	1108	Incorrect parameters to procedure 'des_decrypt'
explain extended select des_decrypt(des_encrypt("hello",4),'password2'), des_decrypt(des_encrypt("hello","hidden"));
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	NULL	NULL	NULL	NULL	NULL	NULL	NULL	No tables used
+93 −0
Original line number Diff line number Diff line
select des_encrypt("test", 'akeystr');
des_encrypt("test", 'akeystr')
NULL
Warnings:
Error	1289	The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
select des_encrypt("test", 1);
des_encrypt("test", 1)
NULL
Warnings:
Error	1289	The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
select des_encrypt("test", 9);
des_encrypt("test", 9)
NULL
Warnings:
Error	1289	The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
select des_encrypt("test", 100);
des_encrypt("test", 100)
NULL
Warnings:
Error	1289	The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
select des_encrypt("test", NULL);
des_encrypt("test", NULL)
NULL
Warnings:
Error	1289	The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
select des_decrypt("test", 'anotherkeystr');
des_decrypt("test", 'anotherkeystr')
NULL
Warnings:
Error	1289	The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
select des_decrypt(1, 1);
des_decrypt(1, 1)
NULL
Warnings:
Error	1289	The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
select des_decrypt(des_encrypt("test", 'thekey'));
des_decrypt(des_encrypt("test", 'thekey'))
NULL
Warnings:
Error	1289	The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
select hex(des_encrypt("hello")),des_decrypt(des_encrypt("hello"));
hex(des_encrypt("hello"))	des_decrypt(des_encrypt("hello"))
NULL	NULL
Warnings:
Error	1289	The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
Error	1289	The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
select des_decrypt(des_encrypt("hello",4));
des_decrypt(des_encrypt("hello",4))
NULL
Warnings:
Error	1289	The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
select des_decrypt(des_encrypt("hello",'test'),'test');
des_decrypt(des_encrypt("hello",'test'),'test')
NULL
Warnings:
Error	1289	The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
select hex(des_encrypt("hello")),hex(des_encrypt("hello",5)),hex(des_encrypt("hello",'default_password'));
hex(des_encrypt("hello"))	hex(des_encrypt("hello",5))	hex(des_encrypt("hello",'default_password'))
NULL	NULL	NULL
Warnings:
Error	1289	The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
Error	1289	The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
Error	1289	The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
select des_decrypt(des_encrypt("hello"),'default_password');
des_decrypt(des_encrypt("hello"),'default_password')
NULL
Warnings:
Error	1289	The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
select des_decrypt(des_encrypt("hello",4),'password4');
des_decrypt(des_encrypt("hello",4),'password4')
NULL
Warnings:
Error	1289	The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
SET @a=des_decrypt(des_encrypt("hello"));
Warnings:
Error	1289	The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
flush des_key_file;
select @a = des_decrypt(des_encrypt("hello"));
@a = des_decrypt(des_encrypt("hello"))
NULL
select hex("hello");
hex("hello")
68656C6C6F
select hex(des_decrypt(des_encrypt("hello",4),'password2'));
hex(des_decrypt(des_encrypt("hello",4),'password2'))
NULL
Warnings:
Error	1289	The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
select hex(des_decrypt(des_encrypt("hello","hidden")));
hex(des_decrypt(des_encrypt("hello","hidden")))
NULL
Warnings:
Error	1289	The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
+2 −0
Original line number Diff line number Diff line
Variable_name	Value
have_openssl	NO
+16 −0
Original line number Diff line number Diff line
@@ -59,6 +59,22 @@ select hex(des_encrypt("hello")),hex(des_encrypt("hello",5)),hex(des_encrypt("he
select des_decrypt(des_encrypt("hello"),'default_password');
select des_decrypt(des_encrypt("hello",4),'password4');

# Test use of invalid parameters
select des_encrypt("hello",10);
select des_encrypt(NULL);
select des_encrypt(NULL, 10);
select des_encrypt(NULL, NULL);
select des_encrypt(10, NULL);
select des_encrypt("hello", NULL);

select des_decrypt("hello",10);
select des_decrypt(NULL);
select des_decrypt(NULL, 10);
select des_decrypt(NULL, NULL);
select des_decrypt(10, NULL);
select des_decrypt("hello", NULL);


# Test flush
SET @a=des_decrypt(des_encrypt("hello"));
flush des_key_file;
Loading