MCPcopy Create free account
hub / github.com/XTLS/Go / unmarshal

Method unmarshal

ticket.go:102–117  ·  view source on GitHub ↗
(data []byte)

Source from the content-addressed store, hash-verified

100}
101
102func (m *sessionStateTLS13) unmarshal(data []byte) bool {
103 *m = sessionStateTLS13{}
104 s := cryptobyte.String(data)
105 var version uint16
106 var revision uint8
107 return s.ReadUint16(&version) &&
108 version == VersionTLS13 &&
109 s.ReadUint8(&revision) &&
110 revision == 0 &&
111 s.ReadUint16(&m.cipherSuite) &&
112 readUint64(&s, &m.createdAt) &&
113 readUint8LengthPrefixed(&s, &m.resumptionSecret) &&
114 len(m.resumptionSecret) != 0 &&
115 unmarshalCertificate(&s, &m.certificate) &&
116 s.Empty()
117}
118
119func (c *Conn) encryptTicket(state []byte) ([]byte, error) {
120 if len(c.ticketKeys) == 0 {

Callers

nothing calls this directly

Calls 4

readUint64Function · 0.85
readUint8LengthPrefixedFunction · 0.85
unmarshalCertificateFunction · 0.85
StringMethod · 0.45

Tested by

no test coverage detected