Skip to content

Commit

Permalink
fixing SignatureAlgorithmsCert.
Browse files Browse the repository at this point in the history
  • Loading branch information
kazu-yamamoto committed Aug 6, 2018
1 parent 03f5fa8 commit 33ba430
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion core/Network/TLS/Extension.hs
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,16 @@ instance Extension SignatureAlgorithms where
len <- getWord16
SignatureAlgorithms <$> getList (fromIntegral len) (getSignatureHashAlgorithm >>= \sh -> return (2, sh))

type SignatureAlgorithmsCert = SignatureAlgorithms
newtype SignatureAlgorithmsCert = SignatureAlgorithmsCert [HashAndSignatureAlgorithm] deriving (Show,Eq)

instance Extension SignatureAlgorithmsCert where
extensionID _ = extensionID_SignatureAlgorithms
extensionEncode (SignatureAlgorithmsCert algs) =
runPut $ putWord16 (fromIntegral (length algs * 2)) >> mapM_ putSignatureHashAlgorithm algs
extensionDecode _ =
runGetMaybe $ do
len <- getWord16
SignatureAlgorithmsCert <$> getList (fromIntegral len) (getSignatureHashAlgorithm >>= \sh -> return (2, sh))

data SupportedVersions =
SupportedVersionsClientHello [Version]
Expand Down

0 comments on commit 33ba430

Please sign in to comment.