diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2017-04-27 11:10:50 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2017-05-17 18:07:42 +0200 |
commit | dc34c6f2e6f038f2943fff1057a8dd307d9193cd (patch) | |
tree | 48168bb90f94f1d766ba47f8e0765dccc134c3bc /contrib/external-tests/haskell | |
parent | chacha20poly1305: implement vectorized hchacha20 (diff) | |
download | wireguard-monolithic-historical-dc34c6f2e6f038f2943fff1057a8dd307d9193cd.tar.xz wireguard-monolithic-historical-dc34c6f2e6f038f2943fff1057a8dd307d9193cd.zip |
noise: redesign preshared key mode
Diffstat (limited to 'contrib/external-tests/haskell')
-rw-r--r-- | contrib/external-tests/haskell/src/Main.hs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/contrib/external-tests/haskell/src/Main.hs b/contrib/external-tests/haskell/src/Main.hs index 820e2f1..8983e6c 100644 --- a/contrib/external-tests/haskell/src/Main.hs +++ b/contrib/external-tests/haskell/src/Main.hs @@ -34,7 +34,7 @@ w :: PublicKey Curve25519 -> IO () w theirPub (Plaintext myPSK) sock addr msg = do let x = "\x01\x00\x00\x00\x00\x00" `mappend` msg - mac = hash 16 myPSK (sbToBS' (curvePubToBytes theirPub) `mappend` sbToBS' x) + mac = hash 16 myPSK (sbToBS' (curvePubToBytes theirPub) `mappend` sbToBS' x) -- TODO: this should actually be blake2s(key=blake2s("mac1----" || theirPub), payload=blah) void $ NBS.sendTo sock (x `mappend` mac `mappend` replicate 16 '\0') addr r :: MVar ByteString -> Socket -> IO ByteString @@ -63,8 +63,8 @@ main = do serverkey' = curveBytesToPub . bsToSB' . either undefined id . B64.decode . pack $ serverkey :: PublicKey Curve25519 psk' = Plaintext . bsToSB' . either undefined id . B64.decode . pack $ psk hs = handshakeState $ HandshakeStateParams - noiseIK - "WireGuard v0 zx2c4 Jason@zx2c4.com" + noiseIK -- TODO: specify psk2 mode + "WireGuard v1 zx2c4 Jason@zx2c4.com" (Just psk') (Just mykey') Nothing |