]> Cypherpunks.ru repositories - govpn.git/blobdiff - src/cypherpunks.ru/govpn/identity.go
Raise copyright years
[govpn.git] / src / cypherpunks.ru / govpn / identity.go
index 4dc74eed0e330f4a3ec73570e0c9d73b2503baee..09f7e337b361bb629f1213616567048d5108e9b1 100644 (file)
@@ -1,6 +1,6 @@
 /*
 GoVPN -- simple secure free software virtual private network daemon
-Copyright (C) 2014-2016 Sergey Matveev <stargrave@stargrave.org>
+Copyright (C) 2014-2017 Sergey Matveev <stargrave@stargrave.org>
 
 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
@@ -27,7 +27,7 @@ import (
        "sync"
        "time"
 
-       "github.com/dchest/blake2b"
+       "golang.org/x/crypto/blake2b"
 )
 
 const (
@@ -73,8 +73,12 @@ func (mc *MACCache) Update(peers *map[PeerId]*PeerConf) {
                        mc.cache[pid].ts = pc.TimeSync
                } else {
                        log.Println("Adding key", pid)
+                       mac, err := blake2b.New256(pid[:])
+                       if err != nil {
+                               panic(err)
+                       }
                        mc.cache[pid] = &MACAndTimeSync{
-                               mac: blake2b.NewMAC(8, pid[:]),
+                               mac: mac,
                                ts:  pc.TimeSync,
                        }
                }