wireguard.lists.zx2c4.com archive mirror
 help / color / mirror / Atom feed
* Not really TAI64N
@ 2018-11-07 15:49 Vlad Krasnov
  2018-11-08  3:12 ` Jason A. Donenfeld
  0 siblings, 1 reply; 3+ messages in thread
From: Vlad Krasnov @ 2018-11-07 15:49 UTC (permalink / raw)
  To: wireguard

The WireGuard spec states that a timestamp used is TAI64N, however the wireguard-go implementation produces an invalid timestamp, because the Go function now.UnixNano() returns the total number of nanoseconds from epoch and truncated to 32bit, whereas TAI64N requires it to be in the range [0, 999999999].

Moreover the kernel implementation does not check if a timestamp is valid TAI64N at all, it simply checks that this is a monotonically increasing, 12 byte long, big endian number.

While this is probably not insecure, it goes against what is stated in the whitepaper.

Also, the function used for comparison is memcmp, non-constant time function, that shouldn’t be used in cryptographic context.

Cheers,
Vlad
_______________________________________________
WireGuard mailing list
WireGuard@lists.zx2c4.com
https://lists.zx2c4.com/mailman/listinfo/wireguard

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-11-08 19:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-07 15:49 Not really TAI64N Vlad Krasnov
2018-11-08  3:12 ` Jason A. Donenfeld
2018-11-08 15:48   ` Vlad Krasnov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).