From 6a50ba8572d4fdb760c28dafd0ab652fab9c01fd Mon Sep 17 00:00:00 2001 From: Bin Jin Date: Mon, 13 Mar 2017 00:38:47 +0800 Subject: Remove unnecessary publickey check --- src/Network/WireGuard/Internal/Noise.hs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/Network/WireGuard/Internal') diff --git a/src/Network/WireGuard/Internal/Noise.hs b/src/Network/WireGuard/Internal/Noise.hs index b529d25..842e002 100644 --- a/src/Network/WireGuard/Internal/Noise.hs +++ b/src/Network/WireGuard/Internal/Noise.hs @@ -59,13 +59,11 @@ recvFirstMessageAndReply state0 ciphertext1 plaintext2 = do Just rpub -> return (ciphertext2, plaintext1, rpub, extractSessionKey state2) recvSecondMessage :: NoiseStateWG -> ByteString - -> Either SomeException (ScrubbedBytes, PublicKey, SessionKey) + -> Either SomeException (ScrubbedBytes, SessionKey) recvSecondMessage state1 ciphertext2 = do (plaintext2, state2) <- readMessage state1 ciphertext2 unless (handshakeComplete state2) internalError - case remoteStaticKey state2 of - Nothing -> internalError - Just rpub -> return (plaintext2, rpub, extractSessionKey state2) + return (plaintext2, extractSessionKey state2) encryptMessage :: SessionKey -> Counter -> ScrubbedBytes -> (EncryptedPayload, AuthTag) encryptMessage key counter plaintext = (ciphertext, convert authtag) -- cgit v1.2.3-59-g8ed1b