| 1 | // Copyright 2015 The Go Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style |
| 3 | // license that can be found in the LICENSE file. |
| 4 | |
| 5 | package tlsscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ |
| 6 | |
| 7 | import ( |
| 8 | "bytesscip-go gomod github.com/golang/go/src go1.16 bytes/" |
| 9 | "encoding/hexscip-go gomod github.com/golang/go/src go1.16 `encoding/hex`/" |
| 10 | "encoding/jsonscip-go gomod github.com/golang/go/src go1.16 `encoding/json`/" |
| 11 | "errorsscip-go gomod github.com/golang/go/src go1.16 errors/" |
| 12 | "fmtscip-go gomod github.com/golang/go/src go1.16 fmt/" |
| 13 | "stringsscip-go gomod github.com/golang/go/src go1.16 strings/" |
| 14 | |
| 15 | jsonKeysscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/json`/ "github.com/zmap/zcrypto/jsonscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/json`/" |
| 16 | "github.com/zmap/zcrypto/x509scip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509`/" |
| 17 | "github.com/zmap/zcrypto/x509/ctscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/ct`/" |
| 18 | ) |
| 19 | |
| 20 | var ErrUnimplementedCipherscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ErrUnimplementedCipher. error = errorsscip-go gomod github.com/golang/go/src go1.16 errors/.Newscip-go gomod github.com/golang/go/src go1.16 errors/New().("unimplemented cipher suite") |
| 21 | var ErrNoMutualCipherscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ErrNoMutualCipher. error = errorsscip-go gomod github.com/golang/go/src go1.16 errors/.Newscip-go gomod github.com/golang/go/src go1.16 errors/New().("no mutual cipher suite") |
| 22 | |
| 23 | type TLSVersionscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/TLSVersion# uint16 |
| 24 | |
| 25 | type CipherSuitescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/CipherSuite# uint16 |
| 26 | |
| 27 | type ClientHelloscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientHello# struct { |
| 28 | Versionscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientHello#Version. TLSVersionscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/TLSVersion# `json:"version"` |
| 29 | Randomscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientHello#Random. []byte `json:"random"` |
| 30 | SessionIDscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientHello#SessionID. []byte `json:"session_id,omitempty"` |
| 31 | CipherSuitesscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientHello#CipherSuites. []CipherSuitescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/CipherSuite# `json:"cipher_suites"` |
| 32 | CompressionMethodsscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientHello#CompressionMethods. []CompressionMethodscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/CompressionMethod# `json:"compression_methods"` |
| 33 | OcspStaplingscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientHello#OcspStapling. bool `json:"ocsp_stapling"` |
| 34 | TicketSupportedscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientHello#TicketSupported. bool `json:"ticket"` |
| 35 | SecureRenegotiationscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientHello#SecureRenegotiation. bool `json:"secure_renegotiation"` |
| 36 | HeartbeatSupportedscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientHello#HeartbeatSupported. bool `json:"heartbeat"` |
| 37 | ExtendedRandomscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientHello#ExtendedRandom. []byte `json:"extended_random,omitempty"` |
| 38 | ExtendedMasterSecretscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientHello#ExtendedMasterSecret. bool `json:"extended_master_secret"` |
| 39 | NextProtoNegscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientHello#NextProtoNeg. bool `json:"next_protocol_negotiation"` |
| 40 | ServerNamescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientHello#ServerName. string `json:"server_name,omitempty"` |
| 41 | Sctsscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientHello#Scts. bool `json:"scts"` |
| 42 | SupportedCurvesscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientHello#SupportedCurves. []CurveIDscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/CurveID# `json:"supported_curves,omitempty"` |
| 43 | SupportedPointsscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientHello#SupportedPoints. []PointFormatscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/PointFormat# `json:"supported_point_formats,omitempty"` |
| 44 | SessionTicketscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientHello#SessionTicket. *SessionTicketscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/SessionTicket# `json:"session_ticket,omitempty"` |
| 45 | SignatureAndHashesscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientHello#SignatureAndHashes. []SignatureAndHashscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/SignatureAndHash# `json:"signature_and_hashes,omitempty"` |
| 46 | SctEnabledscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientHello#SctEnabled. bool `json:"sct_enabled"` |
| 47 | AlpnProtocolsscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientHello#AlpnProtocols. []string `json:"alpn_protocols,omitempty"` |
| 48 | UnknownExtensionsscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientHello#UnknownExtensions. [][]byte `json:"unknown_extensions,omitempty"` |
| 49 | } |
| 50 | |
| 51 | type ParsedAndRawSCTscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ParsedAndRawSCT# struct { |
| 52 | Rawscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ParsedAndRawSCT#Raw. []byte `json:"raw,omitempty"` |
| 53 | Parsedscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ParsedAndRawSCT#Parsed. *ctscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/ct`/.SignedCertificateTimestampscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/ct`/SignedCertificateTimestamp# `json:"parsed,omitempty"` |
| 54 | } |
| 55 | |
| 56 | type ServerHelloscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ServerHello# struct { |
| 57 | Versionscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ServerHello#Version. TLSVersionscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/TLSVersion# `json:"version"` |
| 58 | Randomscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ServerHello#Random. []byte `json:"random"` |
| 59 | SessionIDscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ServerHello#SessionID. []byte `json:"session_id"` |
| 60 | CipherSuitescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ServerHello#CipherSuite. CipherSuitescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/CipherSuite# `json:"cipher_suite"` |
| 61 | CompressionMethodscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ServerHello#CompressionMethod. CompressionMethodscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/CompressionMethod# `json:"compression_method"` |
| 62 | OcspStaplingscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ServerHello#OcspStapling. bool `json:"ocsp_stapling"` |
| 63 | TicketSupportedscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ServerHello#TicketSupported. bool `json:"ticket"` |
| 64 | SecureRenegotiationscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ServerHello#SecureRenegotiation. bool `json:"secure_renegotiation"` |
| 65 | HeartbeatSupportedscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ServerHello#HeartbeatSupported. bool `json:"heartbeat"` |
| 66 | ExtendedRandomscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ServerHello#ExtendedRandom. []byte `json:"extended_random,omitempty"` |
| 67 | ExtendedMasterSecretscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ServerHello#ExtendedMasterSecret. bool `json:"extended_master_secret"` |
| 68 | NextProtoNegscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ServerHello#NextProtoNeg. bool `json:"next_protocol_negotiation"` |
| 69 | SignedCertificateTimestampsscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ServerHello#SignedCertificateTimestamps. []ParsedAndRawSCTscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ParsedAndRawSCT# `json:"scts,omitempty"` |
| 70 | AlpnProtocolscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ServerHello#AlpnProtocol. string `json:"alpn_protocol,omitempty"` |
| 71 | UnknownExtensionsscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ServerHello#UnknownExtensions. [][]byte `json:"unknown_extensions,omitempty"` |
| 72 | } |
| 73 | |
| 74 | // SimpleCertificate holds a *x509.Certificate and a []byte for the certificate |
| 75 | type SimpleCertificatescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/SimpleCertificate# struct { |
| 76 | Rawscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/SimpleCertificate#Raw. []byte `json:"raw,omitempty"` |
| 77 | Parsedscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/SimpleCertificate#Parsed. *x509scip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509`/.Certificatescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509`/Certificate# `json:"parsed,omitempty"` |
| 78 | } |
| 79 | |
| 80 | // Certificates represents a TLS certificates message in a format friendly to the golang JSON library. |
| 81 | // ValidationError should be non-nil whenever Valid is false. |
| 82 | type Certificatesscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/Certificates# struct { |
| 83 | Certificatescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/Certificates#Certificate. SimpleCertificatescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/SimpleCertificate# `json:"certificate,omitempty"` |
| 84 | Chainscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/Certificates#Chain. []SimpleCertificatescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/SimpleCertificate# `json:"chain,omitempty"` |
| 85 | Validationscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/Certificates#Validation. *x509scip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509`/.Validationscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509`/Validation# `json:"validation,omitempty"` |
| 86 | } |
| 87 | |
| 88 | // ServerKeyExchange represents the raw key data sent by the server in TLS key exchange message |
| 89 | type ServerKeyExchangescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ServerKeyExchange# struct { |
| 90 | Rawscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ServerKeyExchange#Raw. []byte `json:"-"` |
| 91 | RSAParamsscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ServerKeyExchange#RSAParams. *jsonKeysscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/json`/.RSAPublicKeyscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/json`/RSAPublicKey# `json:"rsa_params,omitempty"` |
| 92 | DHParamsscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ServerKeyExchange#DHParams. *jsonKeysscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/json`/.DHParamsscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/json`/DHParams# `json:"dh_params,omitempty"` |
| 93 | ECDHParamsscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ServerKeyExchange#ECDHParams. *jsonKeysscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/json`/.ECDHParamsscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/json`/ECDHParams# `json:"ecdh_params,omitempty"` |
| 94 | Digestscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ServerKeyExchange#Digest. []byte `json:"digest,omitempty"` |
| 95 | Signaturescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ServerKeyExchange#Signature. *DigitalSignaturescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/DigitalSignature# `json:"signature,omitempty"` |
| 96 | SignatureErrorscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ServerKeyExchange#SignatureError. string `json:"signature_error,omitempty"` |
| 97 | } |
| 98 | |
| 99 | // ClientKeyExchange represents the raw key data sent by the client in TLS key exchange message |
| 100 | type ClientKeyExchangescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientKeyExchange# struct { |
| 101 | Rawscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientKeyExchange#Raw. []byte `json:"-"` |
| 102 | RSAParamsscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientKeyExchange#RSAParams. *jsonKeysscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/json`/.RSAClientParamsscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/json`/RSAClientParams# `json:"rsa_params,omitempty"` |
| 103 | DHParamsscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientKeyExchange#DHParams. *jsonKeysscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/json`/.DHParamsscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/json`/DHParams# `json:"dh_params,omitempty"` |
| 104 | ECDHParamsscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientKeyExchange#ECDHParams. *jsonKeysscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/json`/.ECDHParamsscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/json`/ECDHParams# `json:"ecdh_params,omitempty"` |
| 105 | } |
| 106 | |
| 107 | // Finished represents a TLS Finished message |
| 108 | type Finishedscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/Finished# struct { |
| 109 | VerifyDatascip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/Finished#VerifyData. []byte `json:"verify_data"` |
| 110 | } |
| 111 | |
| 112 | // SessionTicket represents the new session ticket sent by the server to the |
| 113 | // client |
| 114 | type SessionTicketscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/SessionTicket# struct { |
| 115 | Valuescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/SessionTicket#Value. []uint8 `json:"value,omitempty"` |
| 116 | Lengthscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/SessionTicket#Length. int `json:"length,omitempty"` |
| 117 | LifetimeHintscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/SessionTicket#LifetimeHint. uint32 `json:"lifetime_hint,omitempty"` |
| 118 | } |
| 119 | |
| 120 | type MasterSecretscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/MasterSecret# struct { |
| 121 | Valuescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/MasterSecret#Value. []byte `json:"value,omitempty"` |
| 122 | Lengthscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/MasterSecret#Length. int `json:"length,omitempty"` |
| 123 | } |
| 124 | |
| 125 | type PreMasterSecretscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/PreMasterSecret# struct { |
| 126 | Valuescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/PreMasterSecret#Value. []byte `json:"value,omitempty"` |
| 127 | Lengthscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/PreMasterSecret#Length. int `json:"length,omitempty"` |
| 128 | } |
| 129 | |
| 130 | // KeyMaterial explicitly represent the cryptographic values negotiated by |
| 131 | // the client and server |
| 132 | type KeyMaterialscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/KeyMaterial# struct { |
| 133 | MasterSecretscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/KeyMaterial#MasterSecret. *MasterSecretscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/MasterSecret# `json:"master_secret,omitempty"` |
| 134 | PreMasterSecretscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/KeyMaterial#PreMasterSecret. *PreMasterSecretscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/PreMasterSecret# `json:"pre_master_secret,omitempty"` |
| 135 | } |
| 136 | |
| 137 | // ServerHandshake stores all of the messages sent by the server during a standard TLS Handshake. |
| 138 | // It implements zgrab.EventData interface |
| 139 | type ServerHandshakescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ServerHandshake# struct { |
| 140 | ClientHelloscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ServerHandshake#ClientHello. *ClientHelloscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientHello# `json:"client_hello,omitempty" zgrab:"debug"` |
| 141 | ServerHelloscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ServerHandshake#ServerHello. *ServerHelloscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ServerHello# `json:"server_hello,omitempty"` |
| 142 | ServerCertificatesscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ServerHandshake#ServerCertificates. *Certificatesscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/Certificates# `json:"server_certificates,omitempty"` |
| 143 | ServerKeyExchangescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ServerHandshake#ServerKeyExchange. *ServerKeyExchangescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ServerKeyExchange# `json:"server_key_exchange,omitempty"` |
| 144 | ClientKeyExchangescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ServerHandshake#ClientKeyExchange. *ClientKeyExchangescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientKeyExchange# `json:"client_key_exchange,omitempty"` |
| 145 | ClientFinishedscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ServerHandshake#ClientFinished. *Finishedscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/Finished# `json:"client_finished,omitempty"` |
| 146 | SessionTicketscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ServerHandshake#SessionTicket. *SessionTicketscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/SessionTicket# `json:"session_ticket,omitempty"` |
| 147 | ServerFinishedscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ServerHandshake#ServerFinished. *Finishedscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/Finished# `json:"server_finished,omitempty"` |
| 148 | KeyMaterialscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ServerHandshake#KeyMaterial. *KeyMaterialscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/KeyMaterial# `json:"key_material,omitempty"` |
| 149 | } |
| 150 | |
| 151 | // MarshalJSON implements the json.Marshler interface |
| 152 | func (v *TLSVersionscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/TLSVersion#) MarshalJSONscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/TLSVersion#MarshalJSON().() ([]byte, error) { |
| 153 | aux := struct { |
| 154 | Name string `json:"name"` |
| 155 | Value int `json:"value"` |
| 156 | }{ |
| 157 | Name: v.Stringscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/TLSVersion#String().(), |
| 158 | Value: int(*v), |
| 159 | } |
| 160 | return jsonscip-go gomod github.com/golang/go/src go1.16 `encoding/json`/.Marshalscip-go gomod github.com/golang/go/src go1.16 `encoding/json`/Marshal().(&aux) |
| 161 | } |
| 162 | |
| 163 | // UnmarshalJSON implements the json.Unmarshaler interface |
| 164 | func (v *TLSVersionscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/TLSVersion#) UnmarshalJSONscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/TLSVersion#UnmarshalJSON().(b []byte) error { |
| 165 | aux := struct { |
| 166 | Name string `json:"name"` |
| 167 | Value int `json:"value"` |
| 168 | }{} |
| 169 | if err := jsonscip-go gomod github.com/golang/go/src go1.16 `encoding/json`/.Unmarshalscip-go gomod github.com/golang/go/src go1.16 `encoding/json`/Unmarshal().(b, &aux); err != nil { |
| 170 | return err |
| 171 | } |
| 172 | *v = TLSVersionscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/TLSVersion#(aux.Value) |
| 173 | if expectedName := v.Stringscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/TLSVersion#String().(); expectedName != aux.Name { |
| 174 | return fmtscip-go gomod github.com/golang/go/src go1.16 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.16 fmt/Errorf().("mismatched tls version and name: version: %d, name: %s, expected name: %s", aux.Value, aux.Name, expectedName) |
| 175 | } |
| 176 | return nil |
| 177 | } |
| 178 | |
| 179 | // MarshalJSON implements the json.Marshler interface |
| 180 | func (cs *CipherSuitescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/CipherSuite#) MarshalJSONscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/CipherSuite#MarshalJSON().() ([]byte, error) { |
| 181 | buf := make([]byte, 2) |
| 182 | buf[0] = byte(*cs >> 8) |
| 183 | buf[1] = byte(*cs) |
| 184 | enc := stringsscip-go gomod github.com/golang/go/src go1.16 strings/.ToUpperscip-go gomod github.com/golang/go/src go1.16 strings/ToUpper().(hexscip-go gomod github.com/golang/go/src go1.16 `encoding/hex`/.EncodeToStringscip-go gomod github.com/golang/go/src go1.16 `encoding/hex`/EncodeToString().(buf)) |
| 185 | aux := struct { |
| 186 | Hex string `json:"hex"` |
| 187 | Name string `json:"name"` |
| 188 | Value int `json:"value"` |
| 189 | }{ |
| 190 | Hex: fmtscip-go gomod github.com/golang/go/src go1.16 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.16 fmt/Sprintf().("0x%s", enc), |
| 191 | Name: cs.Stringscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/CipherSuite#String().(), |
| 192 | Value: int(*cs), |
| 193 | } |
| 194 | return jsonscip-go gomod github.com/golang/go/src go1.16 `encoding/json`/.Marshalscip-go gomod github.com/golang/go/src go1.16 `encoding/json`/Marshal().(&aux) |
| 195 | } |
| 196 | |
| 197 | // UnmarshalJSON implements the json.Unmarshaler interface |
| 198 | func (cs *CipherSuitescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/CipherSuite#) UnmarshalJSONscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/CipherSuite#UnmarshalJSON().(b []byte) error { |
| 199 | aux := struct { |
| 200 | Hex string `json:"hex"` |
| 201 | Name string `json:"name"` |
| 202 | Value uint16 `json:"value"` |
| 203 | }{} |
| 204 | if err := jsonscip-go gomod github.com/golang/go/src go1.16 `encoding/json`/.Unmarshalscip-go gomod github.com/golang/go/src go1.16 `encoding/json`/Unmarshal().(b, &aux); err != nil { |
| 205 | return err |
| 206 | } |
| 207 | if expectedName := nameForSuitescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/nameForSuite().(aux.Value); expectedName != aux.Name { |
| 208 | return fmtscip-go gomod github.com/golang/go/src go1.16 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.16 fmt/Errorf().("mismatched cipher suite and name, suite: %d, name: %s, expected name: %s", aux.Value, aux.Name, expectedName) |
| 209 | } |
| 210 | *cs = CipherSuitescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/CipherSuite#(aux.Value) |
| 211 | return nil |
| 212 | } |
| 213 | |
| 214 | type CompressionMethodscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/CompressionMethod# uint8 |
| 215 | |
| 216 | func (cm *CompressionMethodscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/CompressionMethod#) MarshalJSONscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/CompressionMethod#MarshalJSON().() ([]byte, error) { |
| 217 | buf := make([]byte, 1) |
| 218 | buf[0] = byte(*cm) |
| 219 | enc := stringsscip-go gomod github.com/golang/go/src go1.16 strings/.ToUpperscip-go gomod github.com/golang/go/src go1.16 strings/ToUpper().(hexscip-go gomod github.com/golang/go/src go1.16 `encoding/hex`/.EncodeToStringscip-go gomod github.com/golang/go/src go1.16 `encoding/hex`/EncodeToString().(buf)) |
| 220 | aux := struct { |
| 221 | Hex string `json:"hex"` |
| 222 | Name string `json:"name"` |
| 223 | Value uint8 `json:"value"` |
| 224 | }{ |
| 225 | Hex: fmtscip-go gomod github.com/golang/go/src go1.16 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.16 fmt/Sprintf().("0x%s", enc), |
| 226 | Name: cm.Stringscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/CompressionMethod#String().(), |
| 227 | Value: uint8(*cm), |
| 228 | } |
| 229 | |
| 230 | return jsonscip-go gomod github.com/golang/go/src go1.16 `encoding/json`/.Marshalscip-go gomod github.com/golang/go/src go1.16 `encoding/json`/Marshal().(aux) |
| 231 | } |
| 232 | |
| 233 | func (cm *CompressionMethodscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/CompressionMethod#) UnmarshalJSONscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/CompressionMethod#UnmarshalJSON().(b []byte) error { |
| 234 | aux := struct { |
| 235 | Hex string `json:"hex"` |
| 236 | Name string `json:"name"` |
| 237 | Value uint8 `json:"value"` |
| 238 | }{} |
| 239 | if err := jsonscip-go gomod github.com/golang/go/src go1.16 `encoding/json`/.Unmarshalscip-go gomod github.com/golang/go/src go1.16 `encoding/json`/Unmarshal().(b, &aux); err != nil { |
| 240 | return err |
| 241 | } |
| 242 | if expectedName := nameForCompressionMethodscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/nameForCompressionMethod().(aux.Value); expectedName != aux.Name { |
| 243 | return fmtscip-go gomod github.com/golang/go/src go1.16 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.16 fmt/Errorf().("mismatched compression method and name, compression method: %d, name: %s, expected name: %s", aux.Value, aux.Name, expectedName) |
| 244 | } |
| 245 | *cm = CompressionMethodscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/CompressionMethod#(aux.Value) |
| 246 | return nil |
| 247 | } |
| 248 | |
| 249 | func (c *Connscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/Conn#) GetHandshakeLogscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/Conn#GetHandshakeLog().() *ServerHandshakescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ServerHandshake# { |
| 250 | return c.handshakeLogscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/Conn#handshakeLog. |
| 251 | } |
| 252 | |
| 253 | func (c *Connscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/Conn#) InCipherscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/Conn#InCipher().() (cipher interface{}) { |
| 254 | return c.inscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/Conn#in..cipherscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/halfConn#cipher. |
| 255 | } |
| 256 | |
| 257 | func (c *Connscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/Conn#) InSeqscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/Conn#InSeq().() []byte { |
| 258 | return c.inscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/Conn#in..seqscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/halfConn#seq.[:] |
| 259 | } |
| 260 | |
| 261 | func (c *Connscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/Conn#) OutCipherscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/Conn#OutCipher().() (cipher interface{}) { |
| 262 | return c.outscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/Conn#out..cipherscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/halfConn#cipher. |
| 263 | } |
| 264 | |
| 265 | func (c *Connscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/Conn#) OutSeqscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/Conn#OutSeq().() []byte { |
| 266 | return c.outscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/Conn#out..seqscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/halfConn#seq.[:] |
| 267 | } |
| 268 | |
| 269 | func (m *clientHelloMsgscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/clientHelloMsg#) MakeLogscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/clientHelloMsg#MakeLog().() *ClientHelloscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientHello# { |
| 270 | ch := new(ClientHelloscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientHello#) |
| 271 | |
| 272 | ch.Versionscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientHello#Version. = TLSVersionscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/TLSVersion#(m.versscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/clientHelloMsg#vers.) |
| 273 | |
| 274 | ch.Randomscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientHello#Random. = make([]byte, len(m.randomscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/clientHelloMsg#random.)) |
| 275 | copy(ch.Randomscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientHello#Random., m.randomscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/clientHelloMsg#random.) |
| 276 | |
| 277 | ch.SessionIDscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientHello#SessionID. = make([]byte, len(m.sessionIdscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/clientHelloMsg#sessionId.)) |
| 278 | copy(ch.SessionIDscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientHello#SessionID., m.sessionIdscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/clientHelloMsg#sessionId.) |
| 279 | |
| 280 | ch.CipherSuitesscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientHello#CipherSuites. = make([]CipherSuitescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/CipherSuite#, len(m.cipherSuitesscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/clientHelloMsg#cipherSuites.)) |
| 281 | for i, aCipher := range m.cipherSuitesscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/clientHelloMsg#cipherSuites. { |
| 282 | ch.CipherSuitesscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientHello#CipherSuites.[i] = CipherSuitescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/CipherSuite#(aCipher) |
| 283 | } |
| 284 | |
| 285 | ch.CompressionMethodsscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientHello#CompressionMethods. = make([]CompressionMethodscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/CompressionMethod#, len(m.compressionMethodsscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/clientHelloMsg#compressionMethods.)) |
| 286 | for i, aCompressMethod := range m.compressionMethodsscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/clientHelloMsg#compressionMethods. { |
| 287 | ch.CompressionMethodsscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientHello#CompressionMethods.[i] = CompressionMethodscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/CompressionMethod#(aCompressMethod) |
| 288 | } |
| 289 | |
| 290 | ch.OcspStaplingscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientHello#OcspStapling. = m.ocspStaplingscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/clientHelloMsg#ocspStapling. |
| 291 | ch.TicketSupportedscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientHello#TicketSupported. = m.ticketSupportedscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/clientHelloMsg#ticketSupported. |
| 292 | ch.SecureRenegotiationscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientHello#SecureRenegotiation. = m.secureRenegotiationscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/clientHelloMsg#secureRenegotiation. |
| 293 | ch.HeartbeatSupportedscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientHello#HeartbeatSupported. = m.heartbeatEnabledscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/clientHelloMsg#heartbeatEnabled. |
| 294 | |
| 295 | if len(m.extendedRandomscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/clientHelloMsg#extendedRandom.) > 0 { |
| 296 | ch.ExtendedRandomscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientHello#ExtendedRandom. = make([]byte, len(m.extendedRandomscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/clientHelloMsg#extendedRandom.)) |
| 297 | copy(ch.ExtendedRandomscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientHello#ExtendedRandom., m.extendedRandomscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/clientHelloMsg#extendedRandom.) |
| 298 | } |
| 299 | |
| 300 | ch.NextProtoNegscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientHello#NextProtoNeg. = m.nextProtoNegscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/clientHelloMsg#nextProtoNeg. |
| 301 | ch.ServerNamescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientHello#ServerName. = m.serverNamescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/clientHelloMsg#serverName. |
| 302 | ch.Sctsscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientHello#Scts. = m.sctsscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/clientHelloMsg#scts. |
| 303 | |
| 304 | ch.SupportedCurvesscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientHello#SupportedCurves. = make([]CurveIDscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/CurveID#, len(m.supportedCurvesscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/clientHelloMsg#supportedCurves.)) |
| 305 | copy(ch.SupportedCurvesscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientHello#SupportedCurves., m.supportedCurvesscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/clientHelloMsg#supportedCurves.) |
| 306 | |
| 307 | ch.SupportedPointsscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientHello#SupportedPoints. = make([]PointFormatscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/PointFormat#, len(m.supportedPointsscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/clientHelloMsg#supportedPoints.)) |
| 308 | for i, aFormat := range m.supportedPointsscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/clientHelloMsg#supportedPoints. { |
| 309 | ch.SupportedPointsscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientHello#SupportedPoints.[i] = PointFormatscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/PointFormat#(aFormat) |
| 310 | } |
| 311 | |
| 312 | if len(m.sessionTicketscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/clientHelloMsg#sessionTicket.) > 0 { |
| 313 | ch.SessionTicketscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientHello#SessionTicket. = new(SessionTicketscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/SessionTicket#) |
| 314 | copy(ch.SessionTicketscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientHello#SessionTicket..Valuescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/SessionTicket#Value., m.sessionTicketscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/clientHelloMsg#sessionTicket.) |
| 315 | ch.SessionTicketscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientHello#SessionTicket..Lengthscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/SessionTicket#Length. = len(m.sessionTicketscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/clientHelloMsg#sessionTicket.) |
| 316 | ch.SessionTicketscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientHello#SessionTicket..LifetimeHintscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/SessionTicket#LifetimeHint. = 0 // Clients don't send |
| 317 | } |
| 318 | |
| 319 | ch.SignatureAndHashesscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientHello#SignatureAndHashes. = make([]SignatureAndHashscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/SignatureAndHash#, len(m.signatureAndHashesscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/clientHelloMsg#signatureAndHashes.)) |
| 320 | for i, aGroup := range m.signatureAndHashesscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/clientHelloMsg#signatureAndHashes. { |
| 321 | ch.SignatureAndHashesscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientHello#SignatureAndHashes.[i] = SignatureAndHashscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/SignatureAndHash#(aGroup) |
| 322 | } |
| 323 | |
| 324 | ch.SctEnabledscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientHello#SctEnabled. = m.sctEnabledscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/clientHelloMsg#sctEnabled. |
| 325 | |
| 326 | ch.AlpnProtocolsscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientHello#AlpnProtocols. = make([]string, len(m.alpnProtocolsscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/clientHelloMsg#alpnProtocols.)) |
| 327 | copy(ch.AlpnProtocolsscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientHello#AlpnProtocols., m.alpnProtocolsscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/clientHelloMsg#alpnProtocols.) |
| 328 | |
| 329 | ch.UnknownExtensionsscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientHello#UnknownExtensions. = make([][]byte, len(m.unknownExtensionsscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/clientHelloMsg#unknownExtensions.)) |
| 330 | for i, extBytes := range m.unknownExtensionsscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/clientHelloMsg#unknownExtensions. { |
| 331 | tempBytes := make([]byte, len(extBytes)) |
| 332 | copy(tempBytes, extBytes) |
| 333 | ch.UnknownExtensionsscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientHello#UnknownExtensions.[i] = tempBytes |
| 334 | } |
| 335 | return ch |
| 336 | } |
| 337 | |
| 338 | func (m *serverHelloMsgscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/serverHelloMsg#) MakeLogscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/serverHelloMsg#MakeLog().() *ServerHelloscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ServerHello# { |
| 339 | sh := new(ServerHelloscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ServerHello#) |
| 340 | sh.Versionscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ServerHello#Version. = TLSVersionscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/TLSVersion#(m.versscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/serverHelloMsg#vers.) |
| 341 | sh.Randomscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ServerHello#Random. = make([]byte, len(m.randomscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/serverHelloMsg#random.)) |
| 342 | copy(sh.Randomscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ServerHello#Random., m.randomscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/serverHelloMsg#random.) |
| 343 | sh.SessionIDscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ServerHello#SessionID. = make([]byte, len(m.sessionIdscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/serverHelloMsg#sessionId.)) |
| 344 | copy(sh.SessionIDscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ServerHello#SessionID., m.sessionIdscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/serverHelloMsg#sessionId.) |
| 345 | sh.CipherSuitescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ServerHello#CipherSuite. = CipherSuitescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/CipherSuite#(m.cipherSuitescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/serverHelloMsg#cipherSuite.) |
| 346 | sh.CompressionMethodscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ServerHello#CompressionMethod. = CompressionMethodscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/CompressionMethod#(m.compressionMethodscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/serverHelloMsg#compressionMethod.) |
| 347 | sh.OcspStaplingscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ServerHello#OcspStapling. = m.ocspStaplingscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/serverHelloMsg#ocspStapling. |
| 348 | sh.TicketSupportedscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ServerHello#TicketSupported. = m.ticketSupportedscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/serverHelloMsg#ticketSupported. |
| 349 | sh.SecureRenegotiationscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ServerHello#SecureRenegotiation. = m.secureRenegotiationscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/serverHelloMsg#secureRenegotiation. |
| 350 | sh.HeartbeatSupportedscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ServerHello#HeartbeatSupported. = m.heartbeatEnabledscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/serverHelloMsg#heartbeatEnabled. |
| 351 | if len(m.extendedRandomscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/serverHelloMsg#extendedRandom.) > 0 { |
| 352 | sh.ExtendedRandomscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ServerHello#ExtendedRandom. = make([]byte, len(m.extendedRandomscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/serverHelloMsg#extendedRandom.)) |
| 353 | copy(sh.ExtendedRandomscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ServerHello#ExtendedRandom., m.extendedRandomscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/serverHelloMsg#extendedRandom.) |
| 354 | } |
| 355 | sh.NextProtoNegscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ServerHello#NextProtoNeg. = m.nextProtoNegscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/serverHelloMsg#nextProtoNeg. |
| 356 | if len(m.sctsscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/serverHelloMsg#scts.) > 0 { |
| 357 | for _, rawSCT := range m.sctsscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/serverHelloMsg#scts. { |
| 358 | var out ParsedAndRawSCTscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ParsedAndRawSCT# |
| 359 | out.Rawscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ParsedAndRawSCT#Raw. = make([]byte, len(rawSCT)) |
| 360 | copy(out.Rawscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ParsedAndRawSCT#Raw., rawSCT) |
| 361 | sct, err := ctscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/ct`/.DeserializeSCTscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509/ct`/DeserializeSCT().(bytesscip-go gomod github.com/golang/go/src go1.16 bytes/.NewReaderscip-go gomod github.com/golang/go/src go1.16 bytes/NewReader().(rawSCT)) |
| 362 | if err == nil { |
| 363 | out.Parsedscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ParsedAndRawSCT#Parsed. = sct |
| 364 | } |
| 365 | sh.SignedCertificateTimestampsscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ServerHello#SignedCertificateTimestamps. = append(sh.SignedCertificateTimestampsscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ServerHello#SignedCertificateTimestamps., out) |
| 366 | } |
| 367 | } |
| 368 | sh.ExtendedMasterSecretscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ServerHello#ExtendedMasterSecret. = m.extendedMasterSecretscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/serverHelloMsg#extendedMasterSecret. |
| 369 | sh.AlpnProtocolscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ServerHello#AlpnProtocol. = m.alpnProtocolscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/serverHelloMsg#alpnProtocol. |
| 370 | sh.UnknownExtensionsscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ServerHello#UnknownExtensions. = make([][]byte, len(m.unknownExtensionsscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/serverHelloMsg#unknownExtensions.)) |
| 371 | for i, extBytes := range m.unknownExtensionsscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/serverHelloMsg#unknownExtensions. { |
| 372 | tempBytes := make([]byte, len(extBytes)) |
| 373 | copy(tempBytes, extBytes) |
| 374 | sh.UnknownExtensionsscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ServerHello#UnknownExtensions.[i] = tempBytes |
| 375 | } |
| 376 | return sh |
| 377 | } |
| 378 | |
| 379 | func (m *certificateMsgscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/certificateMsg#) MakeLogscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/certificateMsg#MakeLog().() *Certificatesscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/Certificates# { |
| 380 | sc := new(Certificatesscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/Certificates#) |
| 381 | if len(m.certificatesscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/certificateMsg#certificates.) >= 1 { |
| 382 | cert := m.certificatesscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/certificateMsg#certificates.[0] |
| 383 | sc.Certificatescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/Certificates#Certificate..Rawscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/SimpleCertificate#Raw. = make([]byte, len(cert)) |
| 384 | copy(sc.Certificatescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/Certificates#Certificate..Rawscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/SimpleCertificate#Raw., cert) |
| 385 | } |
| 386 | if len(m.certificatesscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/certificateMsg#certificates.) >= 2 { |
| 387 | chain := m.certificatesscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/certificateMsg#certificates.[1:] |
| 388 | sc.Chainscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/Certificates#Chain. = make([]SimpleCertificatescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/SimpleCertificate#, len(chain)) |
| 389 | for idx, cert := range chain { |
| 390 | sc.Chainscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/Certificates#Chain.[idx].Rawscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/SimpleCertificate#Raw. = make([]byte, len(cert)) |
| 391 | copy(sc.Chainscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/Certificates#Chain.[idx].Rawscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/SimpleCertificate#Raw., cert) |
| 392 | } |
| 393 | } |
| 394 | return sc |
| 395 | } |
| 396 | |
| 397 | // addParsed sets the parsed certificates and the validation. It assumes the |
| 398 | // chain slice has already been allocated. |
| 399 | func (c *Certificatesscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/Certificates#) addParsedscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/Certificates#addParsed().(certs []*x509scip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509`/.Certificatescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509`/Certificate#, validation *x509scip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509`/.Validationscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/x509`/Validation#) { |
| 400 | if len(certs) >= 1 { |
| 401 | c.Certificatescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/Certificates#Certificate..Parsedscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/SimpleCertificate#Parsed. = certs[0] |
| 402 | } |
| 403 | if len(certs) >= 2 { |
| 404 | chain := certs[1:] |
| 405 | for idx, cert := range chain { |
| 406 | c.Chainscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/Certificates#Chain.[idx].Parsedscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/SimpleCertificate#Parsed. = cert |
| 407 | } |
| 408 | } |
| 409 | c.Validationscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/Certificates#Validation. = validation |
| 410 | } |
| 411 | |
| 412 | func (m *serverKeyExchangeMsgscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/serverKeyExchangeMsg#) MakeLogscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/serverKeyExchangeMsg#MakeLog().(ka keyAgreementscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/keyAgreement#) *ServerKeyExchangescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ServerKeyExchange# { |
| 413 | skx := new(ServerKeyExchangescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ServerKeyExchange#) |
| 414 | skx.Rawscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ServerKeyExchange#Raw. = make([]byte, len(m.keyscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/serverKeyExchangeMsg#key.)) |
| 415 | var auth keyAgreementAuthenticationscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/keyAgreementAuthentication# |
| 416 | var errAuth error |
| 417 | copy(skx.Rawscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ServerKeyExchange#Raw., m.keyscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/serverKeyExchangeMsg#key.) |
| 418 | skx.Digestscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ServerKeyExchange#Digest. = append(make([]byte, 0), m.digestscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/serverKeyExchangeMsg#digest....) |
| 419 | |
| 420 | // Write out parameters |
| 421 | switch ka := ka.(type) { |
| 422 | case *rsaKeyAgreementscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/rsaKeyAgreement#: |
| 423 | skx.RSAParamsscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ServerKeyExchange#RSAParams. = ka.RSAParamsscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/rsaKeyAgreement#RSAParams().() |
| 424 | auth = ka.authscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/rsaKeyAgreement#auth. |
| 425 | errAuth = ka.verifyErrorscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/rsaKeyAgreement#verifyError. |
| 426 | case *dheKeyAgreementscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/dheKeyAgreement#: |
| 427 | skx.DHParamsscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ServerKeyExchange#DHParams. = ka.DHParamsscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/dheKeyAgreement#DHParams().() |
| 428 | auth = ka.authscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/dheKeyAgreement#auth. |
| 429 | errAuth = ka.verifyErrorscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/dheKeyAgreement#verifyError. |
| 430 | case *ecdheKeyAgreementscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ecdheKeyAgreement#: |
| 431 | skx.ECDHParamsscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ServerKeyExchange#ECDHParams. = ka.ECDHParamsscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ecdheKeyAgreement#ECDHParams().() |
| 432 | auth = ka.authscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ecdheKeyAgreement#auth. |
| 433 | errAuth = ka.verifyErrorscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ecdheKeyAgreement#verifyError. |
| 434 | default: |
| 435 | break |
| 436 | } |
| 437 | |
| 438 | // Write out signature |
| 439 | switch auth := auth.(type) { |
| 440 | case *signedKeyAgreementscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/signedKeyAgreement#: |
| 441 | skx.Signaturescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ServerKeyExchange#Signature. = auth.Signaturescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/signedKeyAgreement#Signature().() |
| 442 | default: |
| 443 | break |
| 444 | } |
| 445 | |
| 446 | // Write the signature validation error |
| 447 | if errAuth != nil { |
| 448 | skx.SignatureErrorscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ServerKeyExchange#SignatureError. = errAuth.Error() |
| 449 | } |
| 450 | |
| 451 | return skx |
| 452 | } |
| 453 | |
| 454 | func (m *finishedMsgscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/finishedMsg#) MakeLogscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/finishedMsg#MakeLog().() *Finishedscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/Finished# { |
| 455 | sf := new(Finishedscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/Finished#) |
| 456 | sf.VerifyDatascip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/Finished#VerifyData. = make([]byte, len(m.verifyDatascip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/finishedMsg#verifyData.)) |
| 457 | copy(sf.VerifyDatascip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/Finished#VerifyData., m.verifyDatascip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/finishedMsg#verifyData.) |
| 458 | return sf |
| 459 | } |
| 460 | |
| 461 | func (m *ClientSessionStatescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientSessionState#) MakeLogscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientSessionState#MakeLog().() *SessionTicketscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/SessionTicket# { |
| 462 | st := new(SessionTicketscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/SessionTicket#) |
| 463 | st.Lengthscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/SessionTicket#Length. = len(m.sessionTicketscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientSessionState#sessionTicket.) |
| 464 | st.Valuescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/SessionTicket#Value. = make([]uint8, st.Lengthscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/SessionTicket#Length.) |
| 465 | copy(st.Valuescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/SessionTicket#Value., m.sessionTicketscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientSessionState#sessionTicket.) |
| 466 | st.LifetimeHintscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/SessionTicket#LifetimeHint. = m.lifetimeHintscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientSessionState#lifetimeHint. |
| 467 | return st |
| 468 | } |
| 469 | |
| 470 | func (m *clientHandshakeStatescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/clientHandshakeState#) MakeLogscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/clientHandshakeState#MakeLog().() *KeyMaterialscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/KeyMaterial# { |
| 471 | keymat := new(KeyMaterialscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/KeyMaterial#) |
| 472 | |
| 473 | keymat.MasterSecretscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/KeyMaterial#MasterSecret. = new(MasterSecretscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/MasterSecret#) |
| 474 | keymat.MasterSecretscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/KeyMaterial#MasterSecret..Lengthscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/MasterSecret#Length. = len(m.masterSecretscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/clientHandshakeState#masterSecret.) |
| 475 | keymat.MasterSecretscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/KeyMaterial#MasterSecret..Valuescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/MasterSecret#Value. = make([]byte, len(m.masterSecretscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/clientHandshakeState#masterSecret.)) |
| 476 | copy(keymat.MasterSecretscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/KeyMaterial#MasterSecret..Valuescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/MasterSecret#Value., m.masterSecretscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/clientHandshakeState#masterSecret.) |
| 477 | |
| 478 | keymat.PreMasterSecretscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/KeyMaterial#PreMasterSecret. = new(PreMasterSecretscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/PreMasterSecret#) |
| 479 | keymat.PreMasterSecretscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/KeyMaterial#PreMasterSecret..Lengthscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/PreMasterSecret#Length. = len(m.preMasterSecretscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/clientHandshakeState#preMasterSecret.) |
| 480 | keymat.PreMasterSecretscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/KeyMaterial#PreMasterSecret..Valuescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/PreMasterSecret#Value. = make([]byte, len(m.preMasterSecretscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/clientHandshakeState#preMasterSecret.)) |
| 481 | copy(keymat.PreMasterSecretscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/KeyMaterial#PreMasterSecret..Valuescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/PreMasterSecret#Value., m.preMasterSecretscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/clientHandshakeState#preMasterSecret.) |
| 482 | |
| 483 | return keymat |
| 484 | } |
| 485 | |
| 486 | func (m *serverHandshakeStatescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/serverHandshakeState#) MakeLogscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/serverHandshakeState#MakeLog().() *KeyMaterialscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/KeyMaterial# { |
| 487 | keymat := new(KeyMaterialscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/KeyMaterial#) |
| 488 | |
| 489 | keymat.MasterSecretscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/KeyMaterial#MasterSecret. = new(MasterSecretscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/MasterSecret#) |
| 490 | keymat.MasterSecretscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/KeyMaterial#MasterSecret..Lengthscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/MasterSecret#Length. = len(m.masterSecretscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/serverHandshakeState#masterSecret.) |
| 491 | keymat.MasterSecretscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/KeyMaterial#MasterSecret..Valuescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/MasterSecret#Value. = make([]byte, len(m.masterSecretscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/serverHandshakeState#masterSecret.)) |
| 492 | copy(keymat.MasterSecretscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/KeyMaterial#MasterSecret..Valuescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/MasterSecret#Value., m.masterSecretscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/serverHandshakeState#masterSecret.) |
| 493 | |
| 494 | keymat.PreMasterSecretscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/KeyMaterial#PreMasterSecret. = new(PreMasterSecretscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/PreMasterSecret#) |
| 495 | keymat.PreMasterSecretscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/KeyMaterial#PreMasterSecret..Lengthscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/PreMasterSecret#Length. = len(m.preMasterSecretscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/serverHandshakeState#preMasterSecret.) |
| 496 | keymat.PreMasterSecretscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/KeyMaterial#PreMasterSecret..Valuescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/PreMasterSecret#Value. = make([]byte, len(m.preMasterSecretscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/serverHandshakeState#preMasterSecret.)) |
| 497 | copy(keymat.PreMasterSecretscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/KeyMaterial#PreMasterSecret..Valuescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/PreMasterSecret#Value., m.preMasterSecretscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/serverHandshakeState#preMasterSecret.) |
| 498 | |
| 499 | return keymat |
| 500 | } |
| 501 | |
| 502 | func (m *clientKeyExchangeMsgscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/clientKeyExchangeMsg#) MakeLogscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/clientKeyExchangeMsg#MakeLog().(ka keyAgreementscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/keyAgreement#) *ClientKeyExchangescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientKeyExchange# { |
| 503 | ckx := new(ClientKeyExchangescip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientKeyExchange#) |
| 504 | ckx.Rawscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientKeyExchange#Raw. = make([]byte, len(m.rawscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/clientKeyExchangeMsg#raw.)) |
| 505 | copy(ckx.Rawscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientKeyExchange#Raw., m.rawscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/clientKeyExchangeMsg#raw.) |
| 506 | |
| 507 | switch ka := ka.(type) { |
| 508 | case *rsaKeyAgreementscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/rsaKeyAgreement#: |
| 509 | ckx.RSAParamsscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientKeyExchange#RSAParams. = new(jsonKeysscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/json`/.RSAClientParamsscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/json`/RSAClientParams#) |
| 510 | ckx.RSAParamsscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientKeyExchange#RSAParams..Lengthscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/json`/RSAClientParams#Length. = uint16(len(m.ciphertextscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/clientKeyExchangeMsg#ciphertext.) - 2) // First 2 bytes are length |
| 511 | ckx.RSAParamsscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientKeyExchange#RSAParams..EncryptedPMSscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/json`/RSAClientParams#EncryptedPMS. = make([]byte, len(m.ciphertextscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/clientKeyExchangeMsg#ciphertext.)-2) |
| 512 | copy(ckx.RSAParamsscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientKeyExchange#RSAParams..EncryptedPMSscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/json`/RSAClientParams#EncryptedPMS., m.ciphertextscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/clientKeyExchangeMsg#ciphertext.[2:]) |
| 513 | // Premaster-Secret is available in KeyMaterial record |
| 514 | case *dheKeyAgreementscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/dheKeyAgreement#: |
| 515 | ckx.DHParamsscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientKeyExchange#DHParams. = ka.ClientDHParamsscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/dheKeyAgreement#ClientDHParams().() |
| 516 | case *ecdheKeyAgreementscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ecdheKeyAgreement#: |
| 517 | ckx.ECDHParamsscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ClientKeyExchange#ECDHParams. = ka.ClientECDHParamsscip-go gomod github.com/zmap/zcrypto . `github.com/zmap/zcrypto/tls`/ecdheKeyAgreement#ClientECDHParams().() |
| 518 | default: |
| 519 | break |
| 520 | } |
| 521 | |
| 522 | return ckx |
| 523 | } |