Skip to content
This repository has been archived by the owner on Feb 20, 2020. It is now read-only.

Commit

Permalink
Revert "fix - make /etc/kcpassword multiple of 12 bytes instead of 11…
Browse files Browse the repository at this point in the history
… bytes"

This reverts commit f1c3270.

This was accidentally committed to master without review.
  • Loading branch information
petemoore committed Jun 25, 2019
1 parent d876800 commit fda79a8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kc/kc.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ var (
)

func Encode(password []byte) []byte {
overflow := len(password) % (len(MagicKey) + 1)
overflow := len(password) % len(MagicKey)
paddingLength := 0
if overflow > 0 {
paddingLength = len(MagicKey) + 1 - overflow
paddingLength = len(MagicKey) - overflow
}
data := append(password, make([]byte, paddingLength, paddingLength)...)
for j := 0; j < len(data); j++ {
Expand Down

0 comments on commit fda79a8

Please sign in to comment.