From cc132e005f974577c2ff782add7df8247c4eb541 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Tue, 29 Dec 2020 21:39:19 +0100 Subject: Discovery service --- src/Pairing.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Pairing.hs') diff --git a/src/Pairing.hs b/src/Pairing.hs index 9af33c7..460dd55 100644 --- a/src/Pairing.hs +++ b/src/Pairing.hs @@ -90,7 +90,7 @@ instance PairingResult a => Service (PairingService a) where (NoPairing, _) -> return () (OurRequest nonce, PairingResponse pnonce) -> do - peer <- asks $ svcPeer + peer <- asks $ svcPeerIdentity self <- maybe (throwError "failed to validate own identity") return . validateIdentity . lsIdentity . fromStored =<< svcGetLocal pairingHookResponse $ confirmationNumber $ nonceDigest self peer nonce pnonce @@ -118,7 +118,7 @@ instance PairingResult a => Service (PairingService a) where replyPacket PairingDecline (PeerRequest nonce dgst, PairingRequestNonce pnonce) -> do - peer <- asks $ svcPeer + peer <- asks $ svcPeerIdentity self <- maybe (throwError "failed to verify own identity") return . validateIdentity . lsIdentity . fromStored =<< svcGetLocal if dgst == nonceDigest peer self pnonce BA.empty -- cgit v1.2.3