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])
|
||||
|
||||
extractCAname :: X509 -> DistinguishedName
|
||||
extractCAname cert = DistinguishedName $ certSubjectDN (x509Cert cert)
|
||||
extractCAname cert = certSubjectDN (x509Cert cert)
|
||||
|
||||
handshakeServerWith _ _ _ = fail "unexpected handshake type received. expecting client hello"
|
||||
|
||||
|
|
|
@ -251,7 +251,7 @@ decodeCertRequest cp = do
|
|||
|
||||
decodeDName d = case decodeDN (L.fromChunks [d]) of
|
||||
Left err -> fail ("certrequest: " ++ show err)
|
||||
Right s -> return $ DistinguishedName s
|
||||
Right s -> return s
|
||||
|
||||
decodeCertVerify :: CurrentParams -> Get Handshake
|
||||
decodeCertVerify cp = do
|
||||
|
@ -345,10 +345,7 @@ encodeHandshakeContent (CertRequest certTypes sigAlgs certAuthorities) = do
|
|||
encodeCertAuthorities certAuthorities
|
||||
where
|
||||
-- Convert a distinguished name to its DER encoding.
|
||||
encodeCA (DistinguishedName dn) =
|
||||
case encodeDN dn of
|
||||
Left err -> fail $ "cannot encode distinguished name: " ++ err
|
||||
Right s -> return $ B.concat $ L.toChunks s
|
||||
encodeCA dn = return $ B.concat $ L.toChunks $ encodeDN dn
|
||||
|
||||
-- Encode a list of distinguished names.
|
||||
encodeCertAuthorities certAuths = do
|
||||
|
|
|
@ -23,7 +23,7 @@ module Network.TLS.Struct
|
|||
, HashAndSignatureAlgorithm
|
||||
, ProtocolType(..)
|
||||
, TLSError(..)
|
||||
, DistinguishedName(..)
|
||||
, DistinguishedName
|
||||
, ServerDHParams(..)
|
||||
, ServerRSAParams(..)
|
||||
, ServerKeyXchgAlgorithmData(..)
|
||||
|
@ -53,7 +53,7 @@ import Data.ByteString (ByteString)
|
|||
import qualified Data.ByteString as B (length)
|
||||
import Data.Word
|
||||
import Data.Certificate.X509 (X509)
|
||||
import Data.Certificate.X509.Cert (ASN1String, OID)
|
||||
import Data.Certificate.X509.Cert (DistinguishedName)
|
||||
import Data.Typeable
|
||||
import Control.Monad.Error (Error(..))
|
||||
import Control.Exception (Exception(..))
|
||||
|
@ -233,9 +233,6 @@ data ServerKeyXchgAlgorithmData =
|
|||
| SKX_Unknown Bytes
|
||||
deriving (Show,Eq)
|
||||
|
||||
data DistinguishedName = DistinguishedName [(OID, ASN1String)]
|
||||
deriving (Eq, Show)
|
||||
|
||||
data Handshake =
|
||||
ClientHello !Version !ClientRandom !Session ![CipherID] ![CompressionID] [ExtensionRaw]
|
||||
| ServerHello !Version !ServerRandom !Session !CipherID !CompressionID [ExtensionRaw]
|
||||
|
|
|
@ -43,7 +43,7 @@ Library
|
|||
, bytestring
|
||||
, crypto-api >= 0.5
|
||||
, 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
|
||||
Network.TLS.Cipher
|
||||
Network.TLS.Compression
|
||||
|
|
Loading…
Reference in a new issue