diff options
Diffstat (limited to 'src/ssl/test/runner/common.go')
-rw-r--r-- | src/ssl/test/runner/common.go | 104 |
1 files changed, 29 insertions, 75 deletions
diff --git a/src/ssl/test/runner/common.go b/src/ssl/test/runner/common.go index 77be9f6..edebba1 100644 --- a/src/ssl/test/runner/common.go +++ b/src/ssl/test/runner/common.go @@ -82,7 +82,6 @@ const ( extensionSignedCertificateTimestamp uint16 = 18 extensionExtendedMasterSecret uint16 = 23 extensionSessionTicket uint16 = 35 - extensionCustom uint16 = 1234 // not IANA assigned extensionNextProtoNeg uint16 = 13172 // not IANA assigned extensionRenegotiationInfo uint16 = 0xff01 extensionChannelID uint16 = 30032 // not IANA assigned @@ -189,9 +188,7 @@ type ConnectionState struct { VerifiedChains [][]*x509.Certificate // verified chains built from PeerCertificates ChannelID *ecdsa.PublicKey // the channel ID for this connection SRTPProtectionProfile uint16 // the negotiated DTLS-SRTP protection profile - TLSUnique []byte // the tls-unique channel binding - SCTList []byte // signed certificate timestamp list - ClientCertSignatureHash uint8 // TLS id of the hash used by the client to sign the handshake + TLSUnique []byte } // ClientAuthType declares the policy the server will follow for @@ -217,8 +214,6 @@ type ClientSessionState struct { handshakeHash []byte // Handshake hash for Channel ID purposes. serverCertificates []*x509.Certificate // Certificate chain presented by the server extendedMasterSecret bool // Whether an extended master secret was used to generate the session - sctList []byte - ocspResponse []byte } // ClientSessionCache is a cache of ClientSessionState objects that can be used @@ -404,10 +399,6 @@ type ProtocolBugs struct { // ServerKeyExchange message should be invalid. InvalidSKXSignature bool - // InvalidCertVerifySignature specifies that the signature in a - // CertificateVerify message should be invalid. - InvalidCertVerifySignature bool - // InvalidSKXCurve causes the curve ID in the ServerKeyExchange message // to be wrong. InvalidSKXCurve bool @@ -485,10 +476,6 @@ type ProtocolBugs struct { // TLS_FALLBACK_SCSV in the ClientHello. SendFallbackSCSV bool - // SendRenegotiationSCSV causes the client to include the renegotiation - // SCSV in the ClientHello. - SendRenegotiationSCSV bool - // MaxHandshakeRecordLength, if non-zero, is the maximum size of a // handshake record. Handshake messages will be split into multiple // records at the specified size, except that the client_version will @@ -548,14 +535,11 @@ type ProtocolBugs struct { // must specify in the server_name extension. ExpectServerName string - // SwapNPNAndALPN switches the relative order between NPN and ALPN in - // both ClientHello and ServerHello. + // SwapNPNAndALPN switches the relative order between NPN and + // ALPN on the server. This is to test that server preference + // of ALPN works regardless of their relative order. SwapNPNAndALPN bool - // ALPNProtocol, if not nil, sets the ALPN protocol that a server will - // return. - ALPNProtocol *string - // AllowSessionVersionMismatch causes the server to resume sessions // regardless of the version associated with the session. AllowSessionVersionMismatch bool @@ -588,15 +572,11 @@ type ProtocolBugs struct { // didn't support the renegotiation info extension. NoRenegotiationInfo bool - // RequireRenegotiationInfo, if true, causes the client to return an - // error if the server doesn't reply with the renegotiation extension. - RequireRenegotiationInfo bool - - // SequenceNumberMapping, if non-nil, is the mapping function to apply - // to the sequence number of outgoing packets. For both TLS and DTLS, - // the two most-significant bytes in the resulting sequence number are - // ignored so that the DTLS epoch cannot be changed. - SequenceNumberMapping func(uint64) uint64 + // SequenceNumberIncrement, if non-zero, causes outgoing sequence + // numbers in DTLS to increment by that value rather by 1. This is to + // stress the replay bitmap window by simulating extreme packet loss and + // retransmit at the record layer. + SequenceNumberIncrement uint64 // RSAEphemeralKey, if true, causes the server to send a // ServerKeyExchange message containing an ephemeral key (as in @@ -629,6 +609,10 @@ type ProtocolBugs struct { // across a renego. RequireSameRenegoClientVersion bool + // RequireFastradioPadding, if true, requires that ClientHello messages + // be at least 1000 bytes long. + RequireFastradioPadding bool + // ExpectInitialRecordVersion, if non-zero, is the expected // version of the records before the version is determined. ExpectInitialRecordVersion uint16 @@ -642,11 +626,7 @@ type ProtocolBugs struct { // the server believes it has actually negotiated. SendCipherSuite uint16 - // AppDataBeforeHandshake, if not nil, causes application data to be - // sent immediately before the first handshake message. - AppDataBeforeHandshake []byte - - // AppDataAfterChangeCipherSpec, if not nil, causes application data to + // AppDataAfterChangeCipherSpec, if not null, causes application data to // be sent immediately after ChangeCipherSpec. AppDataAfterChangeCipherSpec []byte @@ -688,10 +668,17 @@ type ProtocolBugs struct { // handshake fragments in DTLS to have the wrong message length. FragmentMessageLengthMismatch bool - // SplitFragments, if non-zero, causes the handshake fragments in DTLS - // to be split across two records. The value of |SplitFragments| is the - // number of bytes in the first fragment. - SplitFragments int + // SplitFragmentHeader, if true, causes the handshake fragments in DTLS + // to be split across two records. + SplitFragmentHeader bool + + // SplitFragmentBody, if true, causes the handshake bodies in DTLS to be + // split across two records. + // + // TODO(davidben): There's one final split to test: when the header and + // body are split across two records. But those are (incorrectly) + // accepted right now. + SplitFragmentBody bool // SendEmptyFragments, if true, causes handshakes to include empty // fragments in DTLS. @@ -718,6 +705,10 @@ type ProtocolBugs struct { // preferences to be ignored. IgnorePeerCurvePreferences bool + // SendWarningAlerts, if non-zero, causes every record to be prefaced by + // a warning alert. + SendWarningAlerts alert + // BadFinished, if true, causes the Finished hash to be broken. BadFinished bool @@ -736,43 +727,6 @@ type ProtocolBugs struct { // EnableAllCiphersInDTLS, if true, causes RC4 to be enabled in DTLS. EnableAllCiphersInDTLS bool - - // EmptyCertificateList, if true, causes the server to send an empty - // certificate list in the Certificate message. - EmptyCertificateList bool - - // ExpectNewTicket, if true, causes the client to abort if it does not - // receive a new ticket. - ExpectNewTicket bool - - // RequireClientHelloSize, if not zero, is the required length in bytes - // of the ClientHello /record/. This is checked by the server. - RequireClientHelloSize int - - // CustomExtension, if not empty, contains the contents of an extension - // that will be added to client/server hellos. - CustomExtension string - - // ExpectedCustomExtension, if not nil, contains the expected contents - // of a custom extension. - ExpectedCustomExtension *string - - // NoCloseNotify, if true, causes the close_notify alert to be skipped - // on connection shutdown. - NoCloseNotify bool - - // ExpectCloseNotify, if true, requires a close_notify from the peer on - // shutdown. Records from the peer received after close_notify is sent - // are not discard. - ExpectCloseNotify bool - - // SendLargeRecords, if true, allows outgoing records to be sent - // arbitrarily large. - SendLargeRecords bool - - // NegotiateALPNAndNPN, if true, causes the server to negotiate both - // ALPN and NPN in the same connetion. - NegotiateALPNAndNPN bool } func (c *Config) serverInit() { |