diff options
author | Roman Smrž <roman.smrz@seznam.cz> | 2023-04-05 22:03:43 +0200 |
---|---|---|
committer | Roman Smrž <roman.smrz@seznam.cz> | 2023-04-05 22:03:43 +0200 |
commit | 7a9ef992afa96ed177ae9a4a67d302017ab73852 (patch) | |
tree | 4c53058ce2ae8015db653326996bfc17a906e72e /src/Channel.hs | |
parent | a8893fbcfa06044e7f999916c4dcc6a2dc907f75 (diff) |
Fix non-exhaustive pattern match warnings
Diffstat (limited to 'src/Channel.hs')
-rw-r--r-- | src/Channel.hs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/Channel.hs b/src/Channel.hs index 8753ecf..b273392 100644 --- a/src/Channel.hs +++ b/src/Channel.hs @@ -101,7 +101,9 @@ acceptChannelRequest self peer req = do throwError $ "channel requent not signed by peer" let st = storedStorage req - KeySizeFixed ksize = cipherKeySize (undefined :: AES128) + ksize <- case cipherKeySize (undefined :: AES128) of + KeySizeFixed s -> return s + _ -> throwError "expecting fixed key size" liftIO $ do (xsecret, xpublic) <- generateKeys st Just skey <- loadKey $ idKeyMessage self @@ -119,7 +121,9 @@ acceptChannelRequest self peer req = do acceptedChannel :: (MonadIO m, MonadError String m) => UnifiedIdentity -> UnifiedIdentity -> Stored ChannelAccept -> m Channel acceptedChannel self peer acc = do let req = caRequest $ fromStored $ signedData $ fromStored acc - KeySizeFixed ksize = cipherKeySize (undefined :: AES128) + ksize <- case cipherKeySize (undefined :: AES128) of + KeySizeFixed s -> return s + _ -> throwError "expecting fixed key size" case sequence $ map validateIdentity $ crPeers $ fromStored $ signedData $ fromStored req of Nothing -> throwError $ "invalid peers in channel accept" |