Skip to content

Commit

Permalink
removing exporter since QUIC does not use it anymore.
Browse files Browse the repository at this point in the history
  • Loading branch information
kazu-yamamoto committed Sep 5, 2018
1 parent 8c65b42 commit 9b23d2a
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 24 deletions.
3 changes: 0 additions & 3 deletions core/Network/TLS.hs
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,6 @@ module Network.TLS
-- * TLS 1.3
, Group(..)
, HandshakeMode13(..)

-- * Key exporter
, exporter
) where

import Network.TLS.Backend (Backend(..), HasBackend(..))
Expand Down
3 changes: 0 additions & 3 deletions core/Network/TLS/Context.hs
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,6 @@ module Network.TLS.Context
, getHState
, getStateRNG
, tls13orLater

-- * Key exporter
, exporter
) where

import Network.TLS.Backend
Expand Down
18 changes: 0 additions & 18 deletions core/Network/TLS/Context/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,11 @@ module Network.TLS.Context.Internal
, getHState
, getStateRNG
, tls13orLater

, exporter
) where

import Network.TLS.Backend
import Network.TLS.Extension
import Network.TLS.Cipher
import Network.TLS.Crypto
import Network.TLS.Struct
import Network.TLS.Compression (Compression)
import Network.TLS.State
Expand All @@ -72,7 +69,6 @@ import Network.TLS.Record.State
import Network.TLS.Parameters
import Network.TLS.Measurement
import Network.TLS.Imports
import Network.TLS.KeySchedule
import qualified Data.ByteString as B

import Control.Concurrent.MVar
Expand Down Expand Up @@ -267,17 +263,3 @@ tls13orLater ctx = do
return $ case ev of
Left _ -> False
Right v -> v >= TLS13

exporter :: Context -> ByteString -> ByteString -> Int -> IO (Maybe ByteString)
exporter ctx label context outlen = do
msecret <- usingState_ ctx getExporterMasterSecret
mcipher <- failOnEitherError $ runRxState ctx $ gets stCipher
return $ case (msecret, mcipher) of
(Just secret, Just cipher) ->
let h = cipherHash cipher
secret' = deriveSecret h secret label ""
label' = "exporter"
value' = hash h context
key = hkdfExpandLabel h secret' label' value' outlen
in Just key
_ -> Nothing

0 comments on commit 9b23d2a

Please sign in to comment.