aboutsummaryrefslogtreecommitdiffstats
path: root/cookie.go
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-05-14 12:27:29 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2018-05-14 12:27:29 +0200
commit355e9bd619c8ec8bdd0f2934739a87a15ceb6920 (patch)
tree36dfb2a5d34e63873281f1d6ed23ca6eaf34a425 /cookie.go
parentNo more finalizer for rwcancel (diff)
downloadwireguard-go-355e9bd619c8ec8bdd0f2934739a87a15ceb6920.tar.xz
wireguard-go-355e9bd619c8ec8bdd0f2934739a87a15ceb6920.zip
Clean more
Diffstat (limited to '')
-rw-r--r--cookie.go32
1 files changed, 16 insertions, 16 deletions
diff --git a/cookie.go b/cookie.go
index cfee367..c0d3ed9 100644
--- a/cookie.go
+++ b/cookie.go
@@ -48,19 +48,19 @@ func (st *CookieChecker) Init(pk NoisePublicKey) {
// mac1 state
func() {
- hsh, _ := blake2s.New256(nil)
- hsh.Write([]byte(WGLabelMAC1))
- hsh.Write(pk[:])
- hsh.Sum(st.mac1.key[:0])
+ hash, _ := blake2s.New256(nil)
+ hash.Write([]byte(WGLabelMAC1))
+ hash.Write(pk[:])
+ hash.Sum(st.mac1.key[:0])
}()
// mac2 state
func() {
- hsh, _ := blake2s.New256(nil)
- hsh.Write([]byte(WGLabelCookie))
- hsh.Write(pk[:])
- hsh.Sum(st.mac2.encryptionKey[:0])
+ hash, _ := blake2s.New256(nil)
+ hash.Write([]byte(WGLabelCookie))
+ hash.Write(pk[:])
+ hash.Sum(st.mac2.encryptionKey[:0])
}()
st.mac2.secretSet = time.Time{}
@@ -181,17 +181,17 @@ func (st *CookieGenerator) Init(pk NoisePublicKey) {
defer st.mutex.Unlock()
func() {
- hsh, _ := blake2s.New256(nil)
- hsh.Write([]byte(WGLabelMAC1))
- hsh.Write(pk[:])
- hsh.Sum(st.mac1.key[:0])
+ hash, _ := blake2s.New256(nil)
+ hash.Write([]byte(WGLabelMAC1))
+ hash.Write(pk[:])
+ hash.Sum(st.mac1.key[:0])
}()
func() {
- hsh, _ := blake2s.New256(nil)
- hsh.Write([]byte(WGLabelCookie))
- hsh.Write(pk[:])
- hsh.Sum(st.mac2.encryptionKey[:0])
+ hash, _ := blake2s.New256(nil)
+ hash.Write([]byte(WGLabelCookie))
+ hash.Write(pk[:])
+ hash.Sum(st.mac2.encryptionKey[:0])
}()
st.mac2.cookieSet = time.Time{}