wireguard-rs icon indicating copy to clipboard operation
wireguard-rs copied to clipboard

Fix time::Instant underflow in handshake

Open pinkisemils opened this issue 4 years ago • 0 comments

On macOS, time::Instant::now() - time::Duration::from_secs(86400) would panic due to an underflow if the machine was running for less than 24 hours. This of course is not ideal, as that expression is used to initialize the cookie validator. I've worked around this by making the birth of the secret optional, and just assume that a secret without a birthday is invalid. This could also be changed to have the secret itself be optional.

pinkisemils avatar Apr 26 '21 16:04 pinkisemils