1
2-- source include/have_ssl_crypto_functs.inc
3
4# This test can't be in func_encrypt.test, because it requires
5# --des-key-file to not be set.
6
7#
8# Bug #11643: des_encrypt() causes server to die
9#
10select des_encrypt('hello');
11
12# End of 4.1 tests
13
14--echo #
15--echo # Bug #11643: des_encrypt() causes server to die
16--echo #
17
18CREATE TABLE t1 (des VARBINARY(200) NOT NULL DEFAULT '');
19
20INSERT INTO t1 VALUES ('1234'), ('12345'), ('123456'), ('1234567');
21
22UPDATE t1 SET des=DES_ENCRYPT('1234');
23
24SELECT LENGTH(des) FROM t1;
25SELECT DES_DECRYPT(des) FROM t1;
26
27SELECT
28 LENGTH(DES_ENCRYPT('1234')),
29 LENGTH(DES_ENCRYPT('12345')),
30 LENGTH(DES_ENCRYPT('123456')),
31 LENGTH(DES_ENCRYPT('1234567'));
32SELECT
33 DES_DECRYPT(DES_ENCRYPT('1234')),
34 DES_DECRYPT(DES_ENCRYPT('12345')),
35 DES_DECRYPT(DES_ENCRYPT('123456')),
36 DES_DECRYPT(DES_ENCRYPT('1234567'));
37
38DROP TABLE t1;
39
40--Echo End of 5.0 tests
41