Skip to content

Commit b7b1e44

Browse files
committed
Add support for CID related generators
ConnectionIDGenerator generates connection identifiers that should be sent by the remote party if it supports the DTLS Connection Identifier extension, as determined during the handshake. Generated connection identifiers must always have the same length. Returning a zero-length connection identifier indicates that the local party supports sending connection identifiers but does not require the remote party to send them. A nil ConnectionIDGenerator indicates that connection identifiers are not supported. https://datatracker.ietf.org/doc/html/rfc9146 PaddingLengthGenerator generates the number of padding bytes used to inflate ciphertext size in order to obscure content size from observers. The length of the content is passed to the generator such that both deterministic and random padding schemes can be applied while not exceeding maximum record size. If no PaddingLengthGenerator is specified, padding will not be applied. https://datatracker.ietf.org/doc/html/rfc9146#section-4 Signed-off-by: Daniel Mangum <georgedanielmangum@gmail.com>
1 parent 2005135 commit b7b1e44

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

config.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,26 @@ type Config struct {
176176
// skip hello verify phase and receive ServerHello after initial ClientHello.
177177
// This have implication on DoS attack resistance.
178178
InsecureSkipVerifyHello bool
179+
180+
// ConnectionIDGenerator generates connection identifiers that should be
181+
// sent by the remote party if it supports the DTLS Connection Identifier
182+
// extension, as determined during the handshake. Generated connection
183+
// identifiers must always have the same length. Returning a zero-length
184+
// connection identifier indicates that the local party supports sending
185+
// connection identifiers but does not require the remote party to send
186+
// them. A nil ConnectionIDGenerator indicates that connection identifiers
187+
// are not supported.
188+
// https://datatracker.ietf.org/doc/html/rfc9146
189+
ConnectionIDGenerator func() []byte
190+
191+
// PaddingLengthGenerator generates the number of padding bytes used to
192+
// inflate ciphertext size in order to obscure content size from observers.
193+
// The length of the content is passed to the generator such that both
194+
// deterministic and random padding schemes can be applied while not
195+
// exceeding maximum record size.
196+
// If no PaddingLengthGenerator is specified, padding will not be applied.
197+
// https://datatracker.ietf.org/doc/html/rfc9146#section-4
198+
PaddingLengthGenerator func(uint) uint
179199
}
180200

181201
func defaultConnectContextMaker() (context.Context, func()) {

0 commit comments

Comments
 (0)