summaryrefslogtreecommitdiffstats
path: root/mysql-test/main/func_encrypt_nossl.test
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 18:00:34 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 18:00:34 +0000
commit3f619478f796eddbba6e39502fe941b285dd97b1 (patch)
treee2c7b5777f728320e5b5542b6213fd3591ba51e2 /mysql-test/main/func_encrypt_nossl.test
parentInitial commit. (diff)
downloadmariadb-3f619478f796eddbba6e39502fe941b285dd97b1.tar.xz
mariadb-3f619478f796eddbba6e39502fe941b285dd97b1.zip
Adding upstream version 1:10.11.6.upstream/1%10.11.6upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'mysql-test/main/func_encrypt_nossl.test')
-rw-r--r--mysql-test/main/func_encrypt_nossl.test38
1 files changed, 38 insertions, 0 deletions
diff --git a/mysql-test/main/func_encrypt_nossl.test b/mysql-test/main/func_encrypt_nossl.test
new file mode 100644
index 00000000..fbaffe78
--- /dev/null
+++ b/mysql-test/main/func_encrypt_nossl.test
@@ -0,0 +1,38 @@
+-- source include/is_embedded.inc
+
+#
+# Test output from des_encrypt and des_decrypt when server is
+# compiled without openssl suuport
+#
+select des_encrypt("test", 'akeystr');
+select des_encrypt("test", 1);
+select des_encrypt("test", 9);
+select des_encrypt("test", 100);
+select des_encrypt("test", NULL);
+select des_encrypt(NULL, NULL);
+select des_decrypt("test", 'anotherkeystr');
+select des_decrypt(1, 1);
+select des_decrypt(des_encrypt("test", 'thekey'));
+
+
+#
+# Test default keys
+#
+select hex(des_encrypt("hello")),des_decrypt(des_encrypt("hello"));
+select des_decrypt(des_encrypt("hello",4));
+select des_decrypt(des_encrypt("hello",'test'),'test');
+select hex(des_encrypt("hello")),hex(des_encrypt("hello",5)),hex(des_encrypt("hello",'default_password'));
+select des_decrypt(des_encrypt("hello"),'default_password');
+select des_decrypt(des_encrypt("hello",4),'password4');
+
+# Test flush
+SET @a=des_decrypt(des_encrypt("hello"));
+flush des_key_file;
+select @a = des_decrypt(des_encrypt("hello"));
+
+# Test usage of wrong password
+select hex("hello");
+select hex(des_decrypt(des_encrypt("hello",4),'password2'));
+select hex(des_decrypt(des_encrypt("hello","hidden")));
+
+# End of 4.1 tests