()
| 1296 | } |
| 1297 | |
| 1298 | func (m *certificateMsgTLS13) marshal() []byte { |
| 1299 | if m.raw != nil { |
| 1300 | return m.raw |
| 1301 | } |
| 1302 | |
| 1303 | var b cryptobyte.Builder |
| 1304 | b.AddUint8(typeCertificate) |
| 1305 | b.AddUint24LengthPrefixed(func(b *cryptobyte.Builder) { |
| 1306 | b.AddUint8(0) // certificate_request_context |
| 1307 | |
| 1308 | certificate := m.certificate |
| 1309 | if !m.ocspStapling { |
| 1310 | certificate.OCSPStaple = nil |
| 1311 | } |
| 1312 | if !m.scts { |
| 1313 | certificate.SignedCertificateTimestamps = nil |
| 1314 | } |
| 1315 | marshalCertificate(b, certificate) |
| 1316 | }) |
| 1317 | |
| 1318 | m.raw = b.BytesOrPanic() |
| 1319 | return m.raw |
| 1320 | } |
| 1321 | |
| 1322 | func marshalCertificate(b *cryptobyte.Builder, certificate Certificate) { |
| 1323 | b.AddUint24LengthPrefixed(func(b *cryptobyte.Builder) { |
nothing calls this directly
no test coverage detected