diff options
author | Roman Smrž <roman.smrz@seznam.cz> | 2019-11-25 22:15:05 +0100 |
---|---|---|
committer | Roman Smrž <roman.smrz@seznam.cz> | 2019-11-26 22:16:35 +0100 |
commit | a70628457a5ceccd37d1ba2e1791d4493b5a0502 (patch) | |
tree | 1daddb314ae7284f7e5c0c1e6308c19c681aedd1 /src/Attach.hs | |
parent | dd4c6aeae1cf30035f3c7c3d52e58082f6b7aa36 (diff) |
Load and announce identity updates
Diffstat (limited to 'src/Attach.hs')
-rw-r--r-- | src/Attach.hs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Attach.hs b/src/Attach.hs index bf4d61e..9861f15 100644 --- a/src/Attach.hs +++ b/src/Attach.hs @@ -87,7 +87,7 @@ instance Service AttachService where (OurRequest nonce, AttachResponse pnonce) -> do peer <- asks $ svcPeer self <- maybe (throwError "failed to verify own identity") return =<< - gets (verifyIdentity . lsIdentity . fromStored . svcLocal) + gets (validateIdentity . lsIdentity . fromStored . svcLocal) svcPrint $ "Attach to " ++ T.unpack (displayIdentity peer) ++ ": " ++ confirmationNumber (nonceDigest self peer nonce pnonce) svcSet $ OurRequestConfirm Nothing return $ Just $ AttachRequestNonce nonce @@ -127,7 +127,7 @@ instance Service AttachService where (PeerRequest nonce dgst, AttachRequestNonce pnonce) -> do peer <- asks $ svcPeer self <- maybe (throwError "failed to verify own identity") return =<< - gets (verifyIdentity . lsIdentity . fromStored . svcLocal) + gets (validateIdentity . lsIdentity . fromStored . svcLocal) if dgst == nonceDigest peer self pnonce BA.empty then do svcPrint $ "Attach from " ++ T.unpack (displayIdentity peer) ++ ": " ++ confirmationNumber (nonceDigest peer self pnonce nonce) svcSet PeerRequestConfirm @@ -209,7 +209,7 @@ verifyAttachedIdentity sdata = do return $ do guard $ iddKeyIdentity (fromStored $ signedData $ fromStored sdata) == iddKeyIdentity (fromStored $ signedData $ fromStored curid) - identity <- verifyIdentity sdata' + identity <- validateIdentity sdata' guard $ iddPrev (fromStored $ signedData $ fromStored $ idData identity) == [curid] return identity @@ -224,7 +224,7 @@ finalizeAttach st identity skeys = do mshared <- mergeSharedStates (lsShared $ fromStored slocal) shared <- wrappedStore st $ (fromStored mshared) { ssPrev = lsShared $ fromStored slocal - , ssIdentity = [idData owner] + , ssIdentity = idDataF owner } wrappedStore st (fromStored slocal) { lsIdentity = idData identity |