Spell 'negotiation' as in the spec.
This commit is contained in:
parent
c6d50d5fb8
commit
1bd53d9790
5 changed files with 13 additions and 13 deletions
|
@ -437,8 +437,8 @@ handshakeServerWith ctx clientHello@(ClientHello ver _ clientSession ciphers com
|
|||
else expectFinish
|
||||
expectChangeCipher p = unexpected (show p) (Just "change cipher")
|
||||
|
||||
expectNPN (NextProtocolNegociation _) = return $ RecvStateHandshake expectFinish
|
||||
expectNPN p = unexpected (show p) (Just "Handshake NextProtocolNegociation")
|
||||
expectNPN (NextProtocolNegotiation _) = return $ RecvStateHandshake expectFinish
|
||||
expectNPN p = unexpected (show p) (Just "Handshake NextProtocolNegotiation")
|
||||
|
||||
expectFinish (Finished _) = return RecvStateDone
|
||||
expectFinish p = unexpected (show p) (Just "Handshake Finished")
|
||||
|
|
|
@ -72,7 +72,7 @@ import qualified Crypto.Hash.MD5 as MD5
|
|||
data CurrentParams = CurrentParams
|
||||
{ cParamsVersion :: Version -- ^ current protocol version
|
||||
, cParamsKeyXchgType :: CipherKeyExchangeType -- ^ current key exchange type
|
||||
, cParamsSupportNPN :: Bool -- ^ support Next Protocol Negociation extension
|
||||
, cParamsSupportNPN :: Bool -- ^ support Next Protocol Negotiation extension
|
||||
} deriving (Show,Eq)
|
||||
|
||||
runGetErr :: String -> Get a -> ByteString -> Either TLSError a
|
||||
|
@ -176,7 +176,7 @@ decodeHandshake cp ty = runGetErr "handshake" $ case ty of
|
|||
HandshakeType_Finished -> decodeFinished
|
||||
HandshakeType_NPN -> do
|
||||
unless (cParamsSupportNPN cp) $ fail "unsupported handshake type"
|
||||
decodeNextProtocolNegociation
|
||||
decodeNextProtocolNegotiation
|
||||
|
||||
decodeHelloRequest :: Get Handshake
|
||||
decodeHelloRequest = return HelloRequest
|
||||
|
@ -221,11 +221,11 @@ decodeCertificates = do
|
|||
decodeFinished :: Get Handshake
|
||||
decodeFinished = Finished <$> (remaining >>= getBytes)
|
||||
|
||||
decodeNextProtocolNegociation :: Get Handshake
|
||||
decodeNextProtocolNegociation = do
|
||||
decodeNextProtocolNegotiation :: Get Handshake
|
||||
decodeNextProtocolNegotiation = do
|
||||
opaque <- getOpaque8
|
||||
_ <- getOpaque8
|
||||
return $ NextProtocolNegociation opaque
|
||||
return $ NextProtocolNegotiation opaque
|
||||
|
||||
getSignatureHashAlgorithm :: Get (HashAlgorithm, SignatureAlgorithm)
|
||||
getSignatureHashAlgorithm = do
|
||||
|
@ -343,7 +343,7 @@ encodeHandshakeContent (CertVerify _) = undefined
|
|||
|
||||
encodeHandshakeContent (Finished opaque) = putBytes opaque
|
||||
|
||||
encodeHandshakeContent (NextProtocolNegociation protocol) = do
|
||||
encodeHandshakeContent (NextProtocolNegotiation protocol) = do
|
||||
putOpaque8 protocol
|
||||
putOpaque8 $ B.replicate paddingLen 0
|
||||
where paddingLen = 32 - ((B.length protocol + 2) `mod` 32)
|
||||
|
|
|
@ -66,7 +66,7 @@ processHandshake hs = do
|
|||
Certificates certs -> when clientmode $ do processCertificates certs
|
||||
ClientKeyXchg content -> unless clientmode $ do
|
||||
processClientKeyXchg content
|
||||
NextProtocolNegociation selected_protocol ->
|
||||
NextProtocolNegotiation selected_protocol ->
|
||||
unless clientmode $ do
|
||||
setNegotiatedProtocol selected_protocol
|
||||
Finished fdata -> processClientFinished fdata
|
||||
|
|
|
@ -205,7 +205,7 @@ data HandshakeType =
|
|||
| HandshakeType_CertVerify
|
||||
| HandshakeType_ClientKeyXchg
|
||||
| HandshakeType_Finished
|
||||
| HandshakeType_NPN -- Next Protocol Negociation extension
|
||||
| HandshakeType_NPN -- Next Protocol Negotiation extension
|
||||
deriving (Show,Eq)
|
||||
|
||||
data ServerDHParams = ServerDHParams
|
||||
|
@ -240,7 +240,7 @@ data Handshake =
|
|||
| CertRequest [CertificateType] (Maybe [ (HashAlgorithm, SignatureAlgorithm) ]) [Word8]
|
||||
| CertVerify [Word8]
|
||||
| Finished FinishedData
|
||||
| NextProtocolNegociation Bytes -- NPN extension
|
||||
| NextProtocolNegotiation Bytes -- NPN extension
|
||||
deriving (Show,Eq)
|
||||
|
||||
packetType :: Packet -> ProtocolType
|
||||
|
@ -260,7 +260,7 @@ typeOfHandshake (ServerKeyXchg {}) = HandshakeType_ServerKeyXchg
|
|||
typeOfHandshake (CertRequest {}) = HandshakeType_CertRequest
|
||||
typeOfHandshake (CertVerify {}) = HandshakeType_CertVerify
|
||||
typeOfHandshake (Finished {}) = HandshakeType_Finished
|
||||
typeOfHandshake (NextProtocolNegociation {}) = HandshakeType_NPN
|
||||
typeOfHandshake (NextProtocolNegotiation {}) = HandshakeType_NPN
|
||||
|
||||
numericalVer :: Version -> (Word8, Word8)
|
||||
numericalVer SSL2 = (2, 0)
|
||||
|
|
|
@ -21,5 +21,5 @@ Features
|
|||
* supported versions: SSL3, TLS1.0, TLS1.1, TLS1.2.
|
||||
* key exchange supported: only RSA.
|
||||
* bulk algorithm supported: any stream or block ciphers.
|
||||
* supported extensions: secure renegociation, next protocol renegociation (draft 2)
|
||||
* supported extensions: secure renegociation, next protocol negotiation (draft 2)
|
||||
|
||||
|
|
Loading…
Reference in a new issue