Safe Haskell | None |
---|---|
Language | Haskell98 |
Network.PeyoTLS.Codec
Contents
- data ContType
- data PrtVrsn = PrtVrsn Word8 Word8
- data CipherSuite
- data KeyEx
- = RSA
- | DHE_RSA
- | ECDHE_RSA
- | ECDHE_ECDSA
- | KE_NULL
- data BulkEnc
- data CmpMtd
- data HSAlg = HSAlg HashAlg SignAlg
- data SignAlg
- data HashAlg
- data Handshake
- class HandshakeItem hi where
- fromHandshake :: Handshake -> Maybe hi
- toHandshake :: hi -> Handshake
- data CCSpec
- data ClHello
- data SvHello
- data SssnId = SssnId ByteString
- data Extension
- = ESName [SName]
- | EECrv [CurveName]
- | EEPFrmt [EPFrmt]
- | ESAlg [HSAlg]
- | ESsnTcktTls ByteString
- | ENxPrtNego ByteString
- | ERnInfo ByteString
- | ERaw EType ByteString
- isRnInfo :: Extension -> Bool
- emptyRnInfo :: Extension
- data SvKeyEx = SvKeyEx ByteString ByteString HashAlg SignAlg ByteString
- data SvKeyExDhe = SvKeyExDhe Params PublicNumber HashAlg SignAlg ByteString
- data SvKeyExEcdhe = SvKeyExEcdhe Curve Point HashAlg SignAlg ByteString
- data CertReq = CertReq [ClCertType] [(HashAlg, SignAlg)] [DistinguishedName]
- certReq :: [ClCertType] -> [(HashAlg, SignAlg)] -> CertificateStore -> CertReq
- data ClCertType
- data SHDone = SHDone
- data ClKeyEx = ClKeyEx ByteString
- data Epms = Epms ByteString
- data DigitSigned
- data Finished = Finished ByteString
Fragment
RFC 5246 6.2.1 Fragmentation
enum { change_cipher_spec(20), alert(21), handshake(22), application_data(23), (255) } ContentType;
RFC 5246 6.2.1 Fragmentation
struct { uint8 major; uint8 minor; } ProtocolVersion;
Cipher Suite, Compression Method, Signature Algorithm
data CipherSuite Source
Constructors
CipherSuite KeyEx BulkEnc | |
EMPTY_RENEGOTIATION_INFO | |
CipherSuiteRaw Word8 Word8 |
Constructors
RSA | |
DHE_RSA | |
ECDHE_RSA | |
ECDHE_ECDSA | |
KE_NULL |
Constructors
AES_128_CBC_SHA | |
AES_128_CBC_SHA256 | |
BE_NULL |
Constructors
CmpMtdNull | |
CmpMtdRaw Word8 |
RFC 5246 7.4.1.4.1.
struct { HashAlgorithm hash; SignatureAlgorithm signature; } SignatureAndHashAlgorithm;
RFC 5246 7.4.1.4.1.
enum { anonymous(0), rsa(1), dsa(2), ecdsa(3), (255) }
RFC 5246 7.4.1.4.1.
enum { none(0), md5(1), sha1(2), sha224(3), sha256(4), sha384(5), sha512(6), (255) } HashAlgorithm;
Handshake
RFC 5246 7.4 Handshake Protocol
enum { hello_request(0), client_hello(1), server_hello(2), certificate(11), server_key_exchange(12), certificate_request(13), server_hello_done(14), certificate_verify(15), client_key_exchange(16), finished(20), (255) } HandshakeType; struct { HandshakeType msg_type; uint24 length; select (HandshakeType) { case hello_request: HelloRequest; case client_hello: ClientHello; case server_hello: ServerHello; case certificate: Certificate; case server_key_exchange: ServerKeyExchange; case certificate_request: CertificateRequest; case server_hello_done: ServerHelloDone; case certificate_verify: CertificateVerify; case client_key_exchange: ClientKeyExchange; case finished: Finished; } body; } Handshake;
class HandshakeItem hi where Source
Instances
Hello
RFC 5246 7.4.1.2. Client Hello
struct { uint32 gmt_unix_time; opaque random_bytes[28]; } Random opaque SessionID<0..32>; uint8 CipherSuite[2]; enum { null(0), (255) } CompressionMethod; struct { ProtocolVersion client_version; Random random; SessionID session_id; CipherSuite cipher_suites<2..2^16-2>; CompressionMethod compression_methods<1..2^8-1>; select (extensions_present) { case false: struct {}; case true: Extension extensions<0..2^16-1>; }; } ClientHello;
Constructors
ClHello PrtVrsn ByteString SssnId [CipherSuite] [CmpMtd] (Maybe [Extension]) | |
ClHelloRaw ByteString |
RFC 5246 7.4.1.3. Server Hello
struct { ProtocolVersion server_version; Random random; SessionID session_id; CipherSuite cipher_suite; CompressionMethod compression_method; select (extensions_present) { case false: struct {}; case true: Extension extensions<0..2^16-1>; }; } ServerHello;
Constructors
SvHello PrtVrsn ByteString SssnId CipherSuite CmpMtd (Maybe [Extension]) | |
SvHelloRaw ByteString |
RFC 5246 7.4.1.4. Hello Wxtensions
struct { ExtensionType extension_type; opaque extension_data<0..2^16-1>; } Extension; enum { signature_algorithms(13), (65535) } ExtensionType
Constructors
ESName [SName] | |
EECrv [CurveName] | |
EEPFrmt [EPFrmt] | |
ESAlg [HSAlg] | |
ESsnTcktTls ByteString | |
ENxPrtNego ByteString | |
ERnInfo ByteString | |
ERaw EType ByteString |
Server Key Exchange
Constructors
SvKeyEx ByteString ByteString HashAlg SignAlg ByteString |
data SvKeyExDhe Source
Constructors
SvKeyExDhe Params PublicNumber HashAlg SignAlg ByteString |
data SvKeyExEcdhe Source
Constructors
SvKeyExEcdhe Curve Point HashAlg SignAlg ByteString |
Others
Constructors
CertReq [ClCertType] [(HashAlg, SignAlg)] [DistinguishedName] |
certReq :: [ClCertType] -> [(HashAlg, SignAlg)] -> CertificateStore -> CertReq Source
Constructors
ClKeyEx ByteString |
data DigitSigned Source
Constructors
DigitSigned (HashAlg, SignAlg) ByteString | |
DigitSignedRaw ByteString |
Constructors
Finished ByteString |