summaryrefslogtreecommitdiff
path: root/protect.go
diff options
context:
space:
mode:
authorVeselkov Konstantin <kostozyb@gmail.com>2018-09-15 21:23:36 +0400
committerKurt Jung <kurt.w.jung@gmail.com>2018-09-15 13:23:36 -0400
commit7d57599b9d9c5fb48ea733596cbb812d7f84a8d6 (patch)
tree5c4b8a4ffd2fa420877bed0aea4eecc789316af0 /protect.go
parent964b1221fa545d09ad62569f58a94dbbadaad57c (diff)
fixed warnings gocritic 3.3 (#192)
Diffstat (limited to 'protect.go')
-rw-r--r--protect.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/protect.go b/protect.go
index e934c2b..9a33534 100644
--- a/protect.go
+++ b/protect.go
@@ -68,8 +68,8 @@ func oValueGen(userPass, ownerPass []byte) (v []byte) {
var c *rc4.Cipher
tmp := md5.Sum(ownerPass)
c, _ = rc4.NewCipher(tmp[0:5])
- cap := len(userPass)
- v = make([]byte, cap, cap)
+ size := len(userPass)
+ v = make([]byte, size, size)
c.XORKeyStream(v, userPass)
return
}
@@ -77,8 +77,8 @@ func oValueGen(userPass, ownerPass []byte) (v []byte) {
func (p *protectType) uValueGen() (v []byte) {
var c *rc4.Cipher
c, _ = rc4.NewCipher(p.encryptionKey)
- cap := len(p.padding)
- v = make([]byte, cap, cap)
+ size := len(p.padding)
+ v = make([]byte, size, size)
c.XORKeyStream(v, p.padding)
return
}