Skip to content

Commit 7b5ae0b

Browse files
authored
Merge branch 'main' into quinn-udp
Signed-off-by: Lars Eggert <[email protected]>
2 parents 7010f09 + 816182f commit 7b5ae0b

File tree

191 files changed

+3439
-2154
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

191 files changed

+3439
-2154
lines changed

.dockerignore

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1-
nss
2-
nspr
3-
target
1+
# Ignore everything:
2+
*
3+
# Except for the following:
4+
!**/*.toml
5+
!**/*.rs
6+
!**/*.h
7+
!**/*.hpp
8+
!qns
9+
!Cargo.lock

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
* @KershawChang @martinthomson
1+
* @KershawChang @martinthomson @larseggert
22
/docker/ @martinthomson
33
/hooks/ @martinthomson
44
/neqo-crypto/ @martinthomson

.github/semantic.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
enabled: true
2+
titleOnly: true
3+
targetUrl: "https://www.conventionalcommits.org/en/v1.0.0/#summary"

.github/workflows/check.yml

Lines changed: 37 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,14 @@ jobs:
1717
fail-fast: false
1818
matrix:
1919
os: [ubuntu-latest, macos-13, windows-latest]
20-
rust-toolchain: [1.70.0, stable, beta]
20+
rust-toolchain: [1.70.0, stable, nightly]
21+
type: [debug]
22+
include:
23+
- os: ubuntu-latest
24+
rust-toolchain: stable
25+
type: release
26+
env:
27+
BUILD_TYPE: ${{ matrix.type == 'release' && '--release' || '' }}
2128
runs-on: ${{ matrix.os }}
2229
defaults:
2330
run:
@@ -35,8 +42,9 @@ jobs:
3542
env:
3643
DEBIAN_FRONTEND: noninteractive
3744
run: |
38-
sudo apt-get install -y --no-install-recommends gyp mercurial ninja-build
45+
sudo apt-get install -y --no-install-recommends gyp mercurial ninja-build lld
3946
curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
47+
echo "RUSTFLAGS=-C link-arg=-fuse-ld=lld" >> "$GITHUB_ENV"
4048
4149
# In addition to installing dependencies, first make sure System Integrity Protection (SIP)
4250
# is disabled on this MacOS runner. This is needed to allow the NSS libraries to be loaded
@@ -47,13 +55,15 @@ jobs:
4755
if: runner.os == 'MacOS'
4856
run: |
4957
csrutil status | grep disabled
50-
brew install ninja mercurial cargo-binstall
58+
brew install ninja mercurial cargo-binstall llvm
59+
echo "/usr/local/opt/llvm/bin" >> "$GITHUB_PATH"
5160
# python3 -m pip install gyp-next
5261
# Above does not work, since pypi only has gyp 0.15.0, which is too old
5362
# for the homebrew python3. Install from source instead.
5463
python3 -m pip install git+https://github.com/nodejs/gyp-next
5564
python3 -m pip install packaging
5665
echo "$(python3 -m site --user-base)/bin" >> "$GITHUB_PATH"
66+
echo "RUSTFLAGS=-C link-arg=-fuse-ld=lld" >> "$GITHUB_ENV"
5767
5868
- name: Install dependencies (Windows)
5969
if: runner.os == 'Windows'
@@ -65,9 +75,10 @@ jobs:
6575
run: |
6676
echo "C:\\msys64\\usr\\bin" >> "$GITHUB_PATH"
6777
echo "C:\\msys64\\mingw64\\bin" >> "$GITHUB_PATH"
68-
/c/msys64/usr/bin/pacman -S --noconfirm nsinstall
78+
/c/msys64/usr/bin/pacman -S --noconfirm nsinstall lld
6979
python3 -m pip install git+https://github.com/nodejs/gyp-next
7080
echo "$(python3 -m site --user-base)/bin" >> "$GITHUB_PATH"
81+
echo "RUSTFLAGS=-C link-arg=-fuse-ld=lld.exe" >> "$GITHUB_ENV"
7182
7283
- name: Set up MSVC build environment (Windows)
7384
if: runner.os == 'Windows'
@@ -83,10 +94,11 @@ jobs:
8394
# version of NSS. Ubuntu 20.04 only has 3.49, which is far too old.
8495
# (neqo-crypto/build.rs would also need to query pkg-config to get the
8596
# right build flags rather than building NSS.)
97+
# Clone from the main hg repo, because the GitHub mirror can be out of date.
8698
- name: Fetch NSS and NSPR
8799
run: |
88100
hg clone https://hg.mozilla.org/projects/nspr "$NSPR_DIR"
89-
git clone --depth=1 https://github.com/nss-dev/nss "$NSS_DIR"
101+
hg clone https://hg.mozilla.org/projects/nss "$NSS_DIR"
90102
echo "NSS_DIR=$NSS_DIR" >> "$GITHUB_ENV"
91103
echo "NSPR_DIR=$NSPR_DIR" >> "$GITHUB_ENV"
92104
env:
@@ -104,44 +116,50 @@ jobs:
104116
105117
- name: Build
106118
run: |
107-
cargo +${{ matrix.rust-toolchain }} build -v --all-targets
108-
echo "LD_LIBRARY_PATH=${{ github.workspace }}/dist/Debug/lib" >> "$GITHUB_ENV"
109-
echo "DYLD_FALLBACK_LIBRARY_PATH=${{ github.workspace }}/dist/Debug/lib" >> "$GITHUB_ENV"
110-
echo "${{ github.workspace }}/dist/Debug/lib" >> "$GITHUB_PATH"
119+
cargo +${{ matrix.rust-toolchain }} build $BUILD_TYPE --all-targets --features ci,bench
120+
echo "LD_LIBRARY_PATH=${{ github.workspace }}/dist/$LIB_DIR/lib" >> "$GITHUB_ENV"
121+
echo "DYLD_FALLBACK_LIBRARY_PATH=${{ github.workspace }}/dist/$LIB_DIR/lib" >> "$GITHUB_ENV"
122+
echo "${{ github.workspace }}/dist/$LIB_DIR/lib" >> "$GITHUB_PATH"
123+
env:
124+
LIB_DIR: ${{ matrix.type == 'release' && 'Release' || 'Debug' }}
111125

112126
- name: Run tests and determine coverage
113-
run: cargo +${{ matrix.rust-toolchain }} llvm-cov nextest --features ci --all-targets --no-fail-fast --lcov --output-path lcov.info
127+
run: cargo +${{ matrix.rust-toolchain }} llvm-cov nextest $BUILD_TYPE --all-targets --features ci,bench --no-fail-fast --lcov --output-path lcov.info
114128

115129
- name: Run client/server transfer
116130
run: |
117-
cargo +${{ matrix.rust-toolchain }} build --bin neqo-client --bin neqo-server
118-
cargo +${{ matrix.rust-toolchain }} run --bin neqo-server -- $HOST:4433 &
131+
cargo +${{ matrix.rust-toolchain }} build $BUILD_TYPE --features ci,bench --bin neqo-client --bin neqo-server
132+
cargo +${{ matrix.rust-toolchain }} run $BUILD_TYPE --features ci,bench --bin neqo-server -- $HOST:4433 &
119133
PID=$!
120-
cargo +${{ matrix.rust-toolchain }} run --bin neqo-client -- --output-dir . https://$HOST:4433/$SIZE
134+
cargo +${{ matrix.rust-toolchain }} run $BUILD_TYPE --features ci,bench --bin neqo-client -- --output-dir . https://$HOST:4433/$SIZE
121135
kill $PID
122136
[ "$(wc -c <"$SIZE")" -eq "$SIZE" ] || exit 1
123137
env:
124138
HOST: localhost
125139
SIZE: 54321
126-
RUST_LOG: info
140+
RUST_LOG: warn
127141

128142
- name: Check formatting
129-
run: cargo +${{ matrix.rust-toolchain }} fmt --all -- --check
143+
run: |
144+
if [ "${{ matrix.rust-toolchain }}" != "nightly" ]; then
145+
export CONFIG_PATH="--config-path=$(mktemp)"
146+
fi
147+
cargo +${{ matrix.rust-toolchain }} fmt --all -- --check $CONFIG_PATH
130148
if: success() || failure()
131149

132150
- name: Clippy
133-
run: cargo +${{ matrix.rust-toolchain }} clippy -v --tests -- -D warnings
151+
run: cargo +${{ matrix.rust-toolchain }} clippy --all-targets -- -D warnings
134152
if: success() || failure()
135-
continue-on-error: ${{ matrix.rust-toolchain == 'beta' }}
153+
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
136154

137155
- name: Check rustdoc links
138-
run: cargo +${{ matrix.rust-toolchain }} doc --verbose --workspace --no-deps --document-private-items
156+
run: cargo +${{ matrix.rust-toolchain }} doc --workspace --no-deps --document-private-items
139157
env:
140158
RUSTDOCFLAGS: "--deny rustdoc::broken_intra_doc_links --deny warnings"
141159
if: success() || failure()
142160

143161
- name: Upload coverage reports to Codecov
144-
uses: codecov/codecov-action@v3
162+
uses: codecov/codecov-action@v4
145163
with:
146164
file: lcov.info
147165
fail_ci_if_error: false

.github/workflows/qns.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,17 @@ on:
55
- cron: '42 3 * * 2,5' # Runs at 03:42 UTC (m and h chosen arbitrarily) twice a week.
66
workflow_dispatch:
77
pull_request:
8-
branch: ["main"]
8+
branches: ["main"]
99
paths:
1010
- 'qns/**'
1111
- '.github/workflows/qns.yml'
1212
jobs:
1313
docker-image:
1414
runs-on: ubuntu-latest
1515
steps:
16+
- name: Set up QEMU
17+
uses: docker/setup-qemu-action@v3
18+
1619
- name: Set up Docker Buildx
1720
uses: docker/setup-buildx-action@v3
1821

@@ -47,3 +50,4 @@ jobs:
4750
RUST_VERSION=stable
4851
cache-from: type=gha
4952
cache-to: type=gha,mode=max
53+
platforms: linux/amd64, linux/arm64

.rustfmt.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
comment_width=100
2+
wrap_comments=true
3+
4+
imports_granularity="Crate"
5+
group_imports="StdExternalCrate"
6+
7+
format_code_in_doc_comments=true

SECURITY.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Security Policy
2+
3+
This document describes how security vulnerabilities in this project should be reported.
4+
5+
## Supported Versions
6+
7+
Support for neqo is based on the Firefox version in which it has landed.
8+
Versions of neqo in [current versions of Firefox](https://whattrainisitnow.com/calendar/) are actively supported.
9+
10+
The version of neqo that is active can be found in the Firefox repositories:
11+
12+
- [release](https://hg.mozilla.org/mozilla-unified/file/release/third_party/rust/neqo-transport/Cargo.toml),
13+
- [beta](https://hg.mozilla.org/mozilla-unified/file/beta/third_party/rust/neqo-transport/Cargo.toml), and
14+
- [trunk/central](https://hg.mozilla.org/mozilla-unified/file/central/third_party/rust/neqo-transport/Cargo.toml),
15+
- [ESR 115](https://hg.mozilla.org/mozilla-unified/file/esr115/third_party/rust/neqo-transport/Cargo.toml).
16+
17+
The listed version in these files corresponds to [tags](https://github.com/mozilla/neqo/tags) on this repository.
18+
Releases do not always correspond to a branch.
19+
20+
We welcome reports of security vulnerabilities in any of these released versions or the latest code on the `main` branch.
21+
22+
## Reporting a Vulnerability
23+
24+
To report a security problem with neqo, create a bug in Mozilla's Bugzilla instance in the [Core :: Networking](https://bugzilla.mozilla.org/enter_bug.cgi?product=Core&component=Networking) component.
25+
26+
**IMPORTANT: For security issues, please make sure that you check the box labelled "Many users could be harmed by this security problem".**
27+
We advise that you check this option for anything that involves anything security-relevant, including memory safety, crashes, race conditions, and handling of confidential information.
28+
29+
Review Mozilla's [guides on bug reporting](https://bugzilla.mozilla.org/page.cgi?id=bug-writing.html) before you open a bug.
30+
31+
Mozilla operates a [bug bounty program](https://www.mozilla.org/en-US/security/bug-bounty/), for which this project is eligible.

docker/Dockerfile

Lines changed: 0 additions & 64 deletions
This file was deleted.

hooks/pre-commit

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,20 @@ if [[ ./neqo-crypto/bindings/bindings.toml -nt ./neqo-crypto/src/lib.rs ]]; then
3232
exit 1
3333
fi
3434

35+
toolchain=nightly
36+
fmtconfig="$root/.rustfmt.toml"
37+
if cargo "+$toolchain" version >/dev/null; then
38+
echo "warning: A rust $toolchain toolchain is recommended to check formatting."
39+
toolchain=stable
40+
fmtconfig=/dev/null
41+
fi
42+
3543
# Check formatting.
3644
trap 'git stash pop -q' EXIT
3745
git stash push -k -u -q -m "pre-commit stash"
38-
if ! errors=($(cargo fmt -- --check -l)); then
46+
if ! errors=($(cargo "+$toolchain" fmt -- --check -l --config-path="$fmtconfig")); then
3947
echo "Formatting errors found."
40-
echo "Run \`cargo fmt\` to fix the following files:"
48+
echo "Run \`cargo fmt +$toolchain\` to fix the following files:"
4149
for err in "${errors[@]}"; do
4250
echo " $err"
4351
done

neqo-client/Cargo.toml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "neqo-client"
3-
version = "0.6.8"
3+
version = "0.7.0"
44
authors = ["Martin Thomson <[email protected]>",
55
"Dragana Damjanovic <[email protected]>",
66
"Andy Grover <[email protected]>"]
@@ -9,14 +9,16 @@ rust-version = "1.70.0"
99
license = "MIT OR Apache-2.0"
1010

1111
[dependencies]
12-
mio = "~0.6.23"
12+
futures = "0.3"
13+
log = {version = "0.4.17", default-features = false}
1314
neqo-common = { path="./../neqo-common" }
1415
neqo-crypto = { path = "./../neqo-crypto" }
1516
neqo-http3 = { path = "./../neqo-http3" }
1617
neqo-qpack = { path = "./../neqo-qpack" }
1718
neqo-transport = { path = "./../neqo-transport" }
18-
qlog = "0.11.0"
19+
qlog = "0.12.0"
1920
structopt = "0.3"
21+
tokio = { version = "1", features = ["net", "time", "macros", "rt", "rt-multi-thread"] }
2022
url = "~2.5.0"
2123

2224
[features]

0 commit comments

Comments
 (0)