Files
Zeling FengandgVisor bot fb2fd2ee88 Randomize TCP source port selection
Drop PickEphemeralPortStable which uses a hash-based algorithm from RFC 6056,
instead just use PickEphemeralPort that uses a randomized algorithm from RFC
6056 to avoid potential security concerns.

Discovered by Inon Kaplan (PhD candidate in the Hebrew University School of
Computer Science and Engineering), Ron Even (BSc graduate of Bar Ilan
University) and Amit Klein (faculty member in the Hebrew University School of
Computer Science and Engineering). Details will be provided in their paper, to
be presented in a forthcoming academic conference.

PiperOrigin-RevId: 581334218
2023-11-10 12:22:32 -08:00

34 lines
642 B
Python

load("//tools:defs.bzl", "go_library", "go_test")
package(
default_applicable_licenses = ["//:license"],
licenses = ["notice"],
)
go_library(
name = "ports",
srcs = [
"flags.go",
"ports.go",
],
visibility = ["//visibility:public"],
deps = [
"//pkg/rand",
"//pkg/sync",
"//pkg/tcpip",
"//pkg/tcpip/header",
],
)
go_test(
name = "ports_test",
srcs = ["ports_test.go"],
library = ":ports",
deps = [
"//pkg/rand",
"//pkg/tcpip",
"//pkg/tcpip/testutil",
"@com_github_google_go_cmp//cmp:go_default_library",
],
)