From 2679b2427bf12305fa6a421632b6034eb3db4b77 Mon Sep 17 00:00:00 2001 From: Soumik Majumder <33070011+100mik@users.noreply.github.com> Date: Thu, 14 Oct 2021 11:58:59 +0530 Subject: [PATCH] Fix semgrep use-of-weak-crypto error (#15784) Signed-off-by: Soumik Majumder --- src/lib/cache/redis/redis.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/cache/redis/redis.go b/src/lib/cache/redis/redis.go index 2cee92a6e..ae6c0ee86 100644 --- a/src/lib/cache/redis/redis.go +++ b/src/lib/cache/redis/redis.go @@ -15,7 +15,7 @@ package redis import ( - "crypto/md5" + "crypto/sha256" "fmt" "time" @@ -107,7 +107,7 @@ func New(opts cache.Options) (cache.Cache, error) { opts.Address = "redis://localhost:6379/0" } - name := fmt.Sprintf("%x", md5.Sum([]byte(opts.Address))) + name := fmt.Sprintf("%x", sha256.Sum256([]byte(opts.Address))) param := &libredis.PoolParam{ PoolMaxIdle: 100,