diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-02-12 20:10:44 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-02-12 20:13:03 +0100 |
commit | bffe99aeadae09abd02f2bd3184925af6b680535 (patch) | |
tree | 556d223ebcd32b957e62e15353087b93a824641c /noise-protocol.go | |
parent | 77285c99aa30eb802d0281175990e6809501ec18 (diff) |
Don't use modules
Feel free to revert this if you have a strong feeling about it. But so
far as I can see, it adds a lot of complexity for basically no upsides.
Diffstat (limited to 'noise-protocol.go')
-rw-r--r-- | noise-protocol.go | 9 |
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() |