mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 04:53:01 +01:00
53fecff1ef
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.
39 lines
899 B
Text
39 lines
899 B
Text
-- source include/have_ssl_crypto_functs.inc
|
|
|
|
# This test can't be in func_encrypt.test, because it requires
|
|
# --des-key-file to not be set.
|
|
|
|
#
|
|
# Bug #11643: des_encrypt() causes server to die
|
|
#
|
|
select des_encrypt('hello');
|
|
|
|
# End of 4.1 tests
|
|
|
|
--echo #
|
|
--echo # Bug #11643: des_encrypt() causes server to die
|
|
--echo #
|
|
|
|
CREATE TABLE t1 (des VARBINARY(200) NOT NULL DEFAULT '') ENGINE=MyISAM;
|
|
|
|
INSERT INTO t1 VALUES ('1234'), ('12345'), ('123456'), ('1234567');
|
|
|
|
UPDATE t1 SET des=DES_ENCRYPT('1234');
|
|
|
|
SELECT LENGTH(des) FROM t1;
|
|
SELECT DES_DECRYPT(des) FROM t1;
|
|
|
|
SELECT
|
|
LENGTH(DES_ENCRYPT('1234')),
|
|
LENGTH(DES_ENCRYPT('12345')),
|
|
LENGTH(DES_ENCRYPT('123456')),
|
|
LENGTH(DES_ENCRYPT('1234567'));
|
|
SELECT
|
|
DES_DECRYPT(DES_ENCRYPT('1234')),
|
|
DES_DECRYPT(DES_ENCRYPT('12345')),
|
|
DES_DECRYPT(DES_ENCRYPT('123456')),
|
|
DES_DECRYPT(DES_ENCRYPT('1234567'));
|
|
|
|
DROP TABLE t1;
|
|
|
|
--Echo End of 5.0 tests
|