magic-wormhole-0.3.1: Interact with Magic Wormhole

Safe HaskellNone
LanguageHaskell2010

MagicWormhole.Internal.Versions

Description

Once a shared SessionKey has been negotiated, the peers need to confirm that they have the same key. They do this with versionExchange.

Synopsis

Documentation

versionExchange Source #

Arguments

:: Connection

A connection to a peer

-> SessionKey

A shared session key. Obtain this via pakeExchange.

-> IO Versions

Shared version information

Exchange version information with a Magic Wormhole peer.

Can throw an Error if something goes wrong.

data Versions Source #

Information about the versions supported by this Magic Wormhole client.

There are no extant Magic Wormhole implementations that send any meaningful information in their versions message, so this is just a single-valued type.

Constructors

Versions 
Instances
Eq Versions Source # 
Instance details

Defined in MagicWormhole.Internal.Versions

Methods

(==) :: Versions -> Versions -> Bool

(/=) :: Versions -> Versions -> Bool

Show Versions Source # 
Instance details

Defined in MagicWormhole.Internal.Versions

Methods

showsPrec :: Int -> Versions -> ShowS

show :: Versions -> String

showList :: [Versions] -> ShowS

FromJSON Versions Source # 
Instance details

Defined in MagicWormhole.Internal.Versions

Methods

parseJSON :: Value -> Parser Versions

parseJSONList :: Value -> Parser [Versions]

ToJSON Versions Source # 
Instance details

Defined in MagicWormhole.Internal.Versions

Methods

toJSON :: Versions -> Value

toEncoding :: Versions -> Encoding

toJSONList :: [Versions] -> Value

toEncodingList :: [Versions] -> Encoding

data VersionsError Source #

An error occurred during versionExchange.

Constructors

ParseError String

We could not interpret the other side's version information

VersionMismatch

The other side sent us version information, but it does not match ours, so we cannot proceed.

Instances
Eq VersionsError Source # 
Instance details

Defined in MagicWormhole.Internal.Versions

Show VersionsError Source # 
Instance details

Defined in MagicWormhole.Internal.Versions

Methods

showsPrec :: Int -> VersionsError -> ShowS

show :: VersionsError -> String

showList :: [VersionsError] -> ShowS

Exception VersionsError Source # 
Instance details

Defined in MagicWormhole.Internal.Versions

Methods

toException :: VersionsError -> SomeException

fromException :: SomeException -> Maybe VersionsError

displayException :: VersionsError -> String