Commit 58ebcdbc authored by Ajit Jagtap's avatar Ajit Jagtap
Browse files

Merge branch 'security_helper_sss' into 'master'

security helper

See merge request !36
parents abfaf8ea c89e65ee
Branches
1 merge request!36security helper
Showing with 6 additions and 0 deletions
......@@ -6,8 +6,10 @@ import (
"crypto/cipher"
"crypto/md5"
"encoding/base64"
"errors"
"corelab.mkcl.org/MKCLOS/coredevelopmentplatform/coreospackage/filehelper"
"corelab.mkcl.org/MKCLOS/coredevelopmentplatform/coreospackage/logginghelper"
OneOfOne "github.com/OneOfOne/xxhash"
)
......@@ -68,6 +70,10 @@ func AESDecrypt(encodedData, key []byte) ([]byte, error) {
cbc.CryptBlocks(cipherText, cipherText)
length := len(cipherText)
if length < 1 {
logginghelper.LogError("length of cipherText is less than 1")
return nil, errors.New("length of cipherText is less than 1")
}
unpadding := int(cipherText[length-1])
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment