File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -89,26 +89,25 @@ func scramblePassword(scramble, password []byte) []byte {
89
89
// stage1Hash = SHA1(password)
90
90
crypt := sha1 .New ()
91
91
crypt .Write (password )
92
- stage1Hash := crypt .Sum (nil )
92
+ stage1 := crypt .Sum (nil )
93
93
94
94
// scrambleHash = SHA1(scramble + SHA1(stage1Hash))
95
95
// inner Hash
96
96
crypt .Reset ()
97
- crypt .Write (stage1Hash )
98
- scrambleHash := crypt .Sum (nil )
97
+ crypt .Write (stage1 )
98
+ hash := crypt .Sum (nil )
99
99
100
100
// outer Hash
101
101
crypt .Reset ()
102
102
crypt .Write (scramble )
103
- crypt .Write (scrambleHash )
104
- scrambleHash = crypt .Sum (nil )
103
+ crypt .Write (hash )
104
+ scramble = crypt .Sum (nil )
105
105
106
106
// token = scrambleHash XOR stage1Hash
107
- result := make ([]byte , 20 )
108
- for i := range result {
109
- result [i ] = scrambleHash [i ] ^ stage1Hash [i ]
107
+ for i := range scramble {
108
+ scramble [i ] ^= stage1 [i ]
110
109
}
111
- return result
110
+ return scramble
112
111
}
113
112
114
113
/******************************************************************************
You can’t perform that action at this time.
0 commit comments