Skip to content

Commit

Permalink
runner: Remove block pool
Browse files Browse the repository at this point in the history
runner is a fork from a very old version of Go's crypto/tls. Back then,
crypto/tls implemented some pooled memory thing to reduce allocations.
The abstraction is pretty confusing.

Replace it with (I think) more idiomatic patterns using []byte and
bytes.Buffer. As part of this, I've moved things common to TLS and DTLS
into the encrypt method so encrypt is now responsible for generating the
explicit IV and adding TLS 1.3 padding.

Change-Id: I21527dd406d2691bc5d24378a832114c43b8b753
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/71367
Reviewed-by: Nick Harper <[email protected]>
Commit-Queue: David Benjamin <[email protected]>
  • Loading branch information
davidben authored and Boringssl LUCI CQ committed Sep 19, 2024
1 parent 59c222f commit 2c0cc6c
Show file tree
Hide file tree
Showing 6 changed files with 326 additions and 484 deletions.
12 changes: 3 additions & 9 deletions ssl/test/runner/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -1997,8 +1997,9 @@ type ProtocolBugs struct {
// session ID in the ServerHello.
DTLS13EchoSessionID bool

// DTLSUsePlaintextRecord header, if true, has DTLS connections never
// use the DTLS 1.3 record header.
// DTLSUsePlaintextRecord header, if true, has DTLS 1.3 connections to use
// the DTLS 1.2 record header once the handshake completes. The bug is not
// activated during the handshake so that the handshake can complete first.
DTLSUsePlaintextRecordHeader bool

// DTLS13RecordHeaderSetCIDBit, if true, sets the Connection ID bit in
Expand Down Expand Up @@ -2248,13 +2249,6 @@ func (c *Credential) signatureAlgorithms() []signatureAlgorithm {
return supportedSignatureAlgorithms
}

// A TLS record.
type record struct {
contentType recordType
major, minor uint8
payload []byte
}

type handshakeMessage interface {
marshal() []byte
unmarshal([]byte) bool
Expand Down
Loading

0 comments on commit 2c0cc6c

Please sign in to comment.