update to certificate 1.2.6
This commit is contained in:
parent
3e3baaecd8
commit
41f7c9c71b
4 changed files with 6 additions and 12 deletions
|
@ -198,7 +198,7 @@ handshakeServerWith sparams ctx clientHello@(ClientHello ver _ clientSession cip
|
||||||
sendPacket ctx (Handshake [ServerHelloDone])
|
sendPacket ctx (Handshake [ServerHelloDone])
|
||||||
|
|
||||||
extractCAname :: X509 -> DistinguishedName
|
extractCAname :: X509 -> DistinguishedName
|
||||||
extractCAname cert = DistinguishedName $ certSubjectDN (x509Cert cert)
|
extractCAname cert = certSubjectDN (x509Cert cert)
|
||||||
|
|
||||||
handshakeServerWith _ _ _ = fail "unexpected handshake type received. expecting client hello"
|
handshakeServerWith _ _ _ = fail "unexpected handshake type received. expecting client hello"
|
||||||
|
|
||||||
|
|
|
@ -251,7 +251,7 @@ decodeCertRequest cp = do
|
||||||
|
|
||||||
decodeDName d = case decodeDN (L.fromChunks [d]) of
|
decodeDName d = case decodeDN (L.fromChunks [d]) of
|
||||||
Left err -> fail ("certrequest: " ++ show err)
|
Left err -> fail ("certrequest: " ++ show err)
|
||||||
Right s -> return $ DistinguishedName s
|
Right s -> return s
|
||||||
|
|
||||||
decodeCertVerify :: CurrentParams -> Get Handshake
|
decodeCertVerify :: CurrentParams -> Get Handshake
|
||||||
decodeCertVerify cp = do
|
decodeCertVerify cp = do
|
||||||
|
@ -345,10 +345,7 @@ encodeHandshakeContent (CertRequest certTypes sigAlgs certAuthorities) = do
|
||||||
encodeCertAuthorities certAuthorities
|
encodeCertAuthorities certAuthorities
|
||||||
where
|
where
|
||||||
-- Convert a distinguished name to its DER encoding.
|
-- Convert a distinguished name to its DER encoding.
|
||||||
encodeCA (DistinguishedName dn) =
|
encodeCA dn = return $ B.concat $ L.toChunks $ encodeDN dn
|
||||||
case encodeDN dn of
|
|
||||||
Left err -> fail $ "cannot encode distinguished name: " ++ err
|
|
||||||
Right s -> return $ B.concat $ L.toChunks s
|
|
||||||
|
|
||||||
-- Encode a list of distinguished names.
|
-- Encode a list of distinguished names.
|
||||||
encodeCertAuthorities certAuths = do
|
encodeCertAuthorities certAuths = do
|
||||||
|
|
|
@ -23,7 +23,7 @@ module Network.TLS.Struct
|
||||||
, HashAndSignatureAlgorithm
|
, HashAndSignatureAlgorithm
|
||||||
, ProtocolType(..)
|
, ProtocolType(..)
|
||||||
, TLSError(..)
|
, TLSError(..)
|
||||||
, DistinguishedName(..)
|
, DistinguishedName
|
||||||
, ServerDHParams(..)
|
, ServerDHParams(..)
|
||||||
, ServerRSAParams(..)
|
, ServerRSAParams(..)
|
||||||
, ServerKeyXchgAlgorithmData(..)
|
, ServerKeyXchgAlgorithmData(..)
|
||||||
|
@ -53,7 +53,7 @@ import Data.ByteString (ByteString)
|
||||||
import qualified Data.ByteString as B (length)
|
import qualified Data.ByteString as B (length)
|
||||||
import Data.Word
|
import Data.Word
|
||||||
import Data.Certificate.X509 (X509)
|
import Data.Certificate.X509 (X509)
|
||||||
import Data.Certificate.X509.Cert (ASN1String, OID)
|
import Data.Certificate.X509.Cert (DistinguishedName)
|
||||||
import Data.Typeable
|
import Data.Typeable
|
||||||
import Control.Monad.Error (Error(..))
|
import Control.Monad.Error (Error(..))
|
||||||
import Control.Exception (Exception(..))
|
import Control.Exception (Exception(..))
|
||||||
|
@ -233,9 +233,6 @@ data ServerKeyXchgAlgorithmData =
|
||||||
| SKX_Unknown Bytes
|
| SKX_Unknown Bytes
|
||||||
deriving (Show,Eq)
|
deriving (Show,Eq)
|
||||||
|
|
||||||
data DistinguishedName = DistinguishedName [(OID, ASN1String)]
|
|
||||||
deriving (Eq, Show)
|
|
||||||
|
|
||||||
data Handshake =
|
data Handshake =
|
||||||
ClientHello !Version !ClientRandom !Session ![CipherID] ![CompressionID] [ExtensionRaw]
|
ClientHello !Version !ClientRandom !Session ![CipherID] ![CompressionID] [ExtensionRaw]
|
||||||
| ServerHello !Version !ServerRandom !Session !CipherID !CompressionID [ExtensionRaw]
|
| ServerHello !Version !ServerRandom !Session !CipherID !CompressionID [ExtensionRaw]
|
||||||
|
|
|
@ -43,7 +43,7 @@ Library
|
||||||
, bytestring
|
, bytestring
|
||||||
, crypto-api >= 0.5
|
, crypto-api >= 0.5
|
||||||
, cryptocipher >= 0.3.0 && < 0.4.0
|
, cryptocipher >= 0.3.0 && < 0.4.0
|
||||||
, certificate >= 1.2.4 && < 1.3.0
|
, certificate >= 1.2.6 && < 1.3.0
|
||||||
Exposed-modules: Network.TLS
|
Exposed-modules: Network.TLS
|
||||||
Network.TLS.Cipher
|
Network.TLS.Cipher
|
||||||
Network.TLS.Compression
|
Network.TLS.Compression
|
||||||
|
|
Loading…
Reference in a new issue