diff options
author | Sergei Golubchik <serg@mariadb.org> | 2016-04-22 13:13:48 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2016-04-24 18:15:20 +0200 |
commit | 797cadce47ecacd9dff2ee4829786e0be3009748 (patch) | |
tree | 74b2d00cc929dd3873a152047f0fb11bed053bd8 /sql/item_strfunc.cc | |
parent | 906f97d3108df8370489f1f5a2531d8a43d8ce1a (diff) | |
download | mariadb-git-797cadce47ecacd9dff2ee4829786e0be3009748.tar.gz |
MDEV-8482 mysql-test - main.func_encrypt fails if FIPS=1
* check for openssl errors in DES_ENCRYPT/DES_DECRYPT
* disable the test when DES doesn't work
* also disable main.func_des_encrypt
Diffstat (limited to 'sql/item_strfunc.cc')
-rw-r--r-- | sql/item_strfunc.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 3b8bc1580bb..4ea3075e69c 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -828,9 +828,10 @@ String *Item_func_des_encrypt::val_str(String *str) /* We make good 24-byte (168 bit) key from given plaintext key with MD5 */ bzero((char*) &ivec,sizeof(ivec)); - EVP_BytesToKey(EVP_des_ede3_cbc(),EVP_md5(),NULL, + if (!EVP_BytesToKey(EVP_des_ede3_cbc(),EVP_md5(),NULL, (uchar*) keystr->ptr(), (int) keystr->length(), - 1, (uchar*) &keyblock,ivec); + 1, (uchar*) &keyblock,ivec)) + goto error; DES_set_key_unchecked(&keyblock.key1,&keyschedule.ks1); DES_set_key_unchecked(&keyblock.key2,&keyschedule.ks2); DES_set_key_unchecked(&keyblock.key3,&keyschedule.ks3); @@ -921,9 +922,10 @@ String *Item_func_des_decrypt::val_str(String *str) goto error; bzero((char*) &ivec,sizeof(ivec)); - EVP_BytesToKey(EVP_des_ede3_cbc(),EVP_md5(),NULL, + if (!EVP_BytesToKey(EVP_des_ede3_cbc(),EVP_md5(),NULL, (uchar*) keystr->ptr(),(int) keystr->length(), - 1,(uchar*) &keyblock,ivec); + 1,(uchar*) &keyblock,ivec)) + goto error; // Here we set all 64-bit keys (56 effective) one by one DES_set_key_unchecked(&keyblock.key1,&keyschedule.ks1); DES_set_key_unchecked(&keyblock.key2,&keyschedule.ks2); |