Skip to content

Commit

Permalink
hlint
Browse files Browse the repository at this point in the history
  • Loading branch information
kazu-yamamoto committed Dec 1, 2023
1 parent 19c72a3 commit 8e9c495
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 10 deletions.
2 changes: 1 addition & 1 deletion core/Network/TLS/Context/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ usingState_ ctx f = failOnEitherError $ usingState ctx f
usingHState :: MonadIO m => Context -> HandshakeM a -> m a
usingHState ctx f = liftIO $ modifyMVar (ctxHandshake ctx) $ \mst ->
case mst of
Nothing -> liftIO $ throwIO $ MissingHandshake
Nothing -> liftIO $ throwIO MissingHandshake
Just st -> return $ swap (Just <$> runHandshake st f)

getHState :: MonadIO m => Context -> m (Maybe HandshakeState)
Expand Down
7 changes: 2 additions & 5 deletions core/Network/TLS/Handshake/Server.hs
Original file line number Diff line number Diff line change
Expand Up @@ -893,11 +893,8 @@ doHandshake13 sparams ctx chosenVersion usedCipher exts usedHash clientKeyShare
else do
usingHState ctx $ setTLS13HandshakeMode RTT0
usingHState ctx $ setTLS13RTT0Status RTT0Rejected
else
if authenticated
then usingHState ctx $ setTLS13HandshakeMode PreSharedKey
else -- FullHandshake or HelloRetryRequest
return ()
else when authenticated $ usingHState ctx $ setTLS13HandshakeMode PreSharedKey
-- else : FullHandshake or HelloRetryRequest
mCredInfo <-
if authenticated then return Nothing else decideCredentialInfo allCreds
(ecdhe, keyShare) <- makeServerKeyShare ctx clientKeyShare
Expand Down
4 changes: 2 additions & 2 deletions core/Network/TLS/Parameters.hs
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ data ServerHooks = ServerHooks
-- ^ Allow to modify extensions to be sent in EncryptedExtensions
-- of TLS 1.3.
--
-- Default: 'return . id'
-- Default: 'return'
}

defaultServerHooks :: ServerHooks
Expand All @@ -648,7 +648,7 @@ defaultServerHooks =
, onServerNameIndication = \_ -> return mempty
, onNewHandshake = \_ -> return True
, onALPNClientSuggest = Nothing
, onEncryptedExtensionsCreating = return . id
, onEncryptedExtensionsCreating = return
}

instance Show ServerHooks where
Expand Down
2 changes: 0 additions & 2 deletions core/Network/TLS/Record/Layer.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
{-# LANGUAGE OverloadedStrings #-}

module Network.TLS.Record.Layer (
RecordLayer (..),
newTransparentRecordLayer,
Expand Down

0 comments on commit 8e9c495

Please sign in to comment.