[tarantool-patches] [PATCH] lua: remove digest.sha() and digest.sha_hex()

Alexander Turenko alexander.turenko at tarantool.org
Tue Mar 19 01:49:22 MSK 2019


SHA-0 is considered weak for years and was removed in OpenSSL since
1.1.0.

These Lua functions did not work since 15ed10e4, but give 'Digest
method "sha" is not supported' error for any input. Removed them to
don't confuse a user with a Tab completion.

Follow up #1722.
Fixes #4028.
---

issue: https://github.com/tarantool/tarantool/issues/4028
branch: https://github.com/tarantool/tarantool/tree/Totktonada/gh-4028-remove-digest-sha-0

 src/lua/crypto.lua | 2 +-
 src/lua/digest.lua | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/lua/crypto.lua b/src/lua/crypto.lua
index b6b2d6540..e76370517 100644
--- a/src/lua/crypto.lua
+++ b/src/lua/crypto.lua
@@ -58,7 +58,7 @@ end
 local digests = {}
 for class, name in pairs({
     md2 = 'MD2', md4 = 'MD4', md5 = 'MD5',
-    sha = 'SHA', sha1 = 'SHA1', sha224 = 'SHA224',
+    sha1 = 'SHA1', sha224 = 'SHA224',
     sha256 = 'SHA256', sha384 = 'SHA384', sha512 = 'SHA512',
     dss = 'DSS', dss1 = 'DSS1', mdc2 = 'MDC2', ripemd160 = 'RIPEMD160'}) do
     local digest = ffi.C.EVP_get_digestbyname(class)
diff --git a/src/lua/digest.lua b/src/lua/digest.lua
index 314ede1ed..8f199c0af 100644
--- a/src/lua/digest.lua
+++ b/src/lua/digest.lua
@@ -36,7 +36,6 @@ local BASE64_NOWRAP = 2
 local BASE64_URLSAFE = 7
 
 local digest_shortcuts = {
-    sha     = 'SHA',
     sha224  = 'SHA224',
     sha256  = 'SHA256',
     sha384  = 'SHA384',
-- 
2.20.1





More information about the Tarantool-patches mailing list