summaryrefslogtreecommitdiffhomepage
path: root/noise-protocol.go
diff options
context:
space:
mode:
Diffstat (limited to 'noise-protocol.go')
-rw-r--r--noise-protocol.go9
1 files changed, 4 insertions, 5 deletions
diff --git a/noise-protocol.go b/noise-protocol.go
index df08a0a..31ae55b 100644
--- a/noise-protocol.go
+++ b/noise-protocol.go
@@ -2,7 +2,6 @@ package main
import (
"errors"
- "git.zx2c4.com/wireguard-go/internal/tai64n"
"golang.org/x/crypto/blake2s"
"golang.org/x/crypto/chacha20poly1305"
"golang.org/x/crypto/poly1305"
@@ -59,7 +58,7 @@ type MessageInitiation struct {
Sender uint32
Ephemeral NoisePublicKey
Static [NoisePublicKeySize + poly1305.TagSize]byte
- Timestamp [tai64n.TimestampSize + poly1305.TagSize]byte
+ Timestamp [TimestampSize + poly1305.TagSize]byte
MAC1 [blake2s.Size128]byte
MAC2 [blake2s.Size128]byte
}
@@ -100,7 +99,7 @@ type Handshake struct {
remoteStatic NoisePublicKey // long term key
remoteEphemeral NoisePublicKey // ephemeral public key
precomputedStaticStatic [NoisePublicKeySize]byte // precomputed shared secret
- lastTimestamp tai64n.Timestamp
+ lastTimestamp Timestamp
lastInitiationConsumption time.Time
}
@@ -207,7 +206,7 @@ func (device *Device) CreateMessageInitiation(peer *Peer) (*MessageInitiation, e
// encrypt timestamp
- timestamp := tai64n.Now()
+ timestamp := TimestampNow()
func() {
var key [chacha20poly1305.KeySize]byte
KDF2(
@@ -272,7 +271,7 @@ func (device *Device) ConsumeMessageInitiation(msg *MessageInitiation) *Peer {
// verify identity
- var timestamp tai64n.Timestamp
+ var timestamp Timestamp
var key [chacha20poly1305.KeySize]byte
handshake.mutex.RLock()