Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ntpv5 packet parsing rebased #1141

Merged
merged 28 commits into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
de62173
Start implementation of NTPv5 header parsing
tdittr Oct 9, 2023
2b4dd00
Implemented v5 header parsing
marlonbaeten Oct 9, 2023
4a16d5f
Implement parsing and serialization for draft identification extension
tdittr Oct 9, 2023
b6bea9d
Add NTPv5 header to general NtpHeader to prepare for usage in server
tdittr Oct 9, 2023
0a92d79
Add NTPv5 feature to CI and fuzzing
tdittr Oct 10, 2023
36a8201
Address clippy warnings
tdittr Oct 10, 2023
b5a5591
Implement v5 header serialization
marlonbaeten Oct 10, 2023
c98c43f
Remove panic from v5 header parsing
marlonbaeten Oct 10, 2023
906584f
Fix clippy warnings in v5.rs
marlonbaeten Oct 10, 2023
c0c9b7d
Add extension field ids for all draft extensions
tdittr Oct 17, 2023
19e5577
Address PR comment and simplify draft id deserialization
tdittr Oct 17, 2023
e7d2c66
Address PR comment, fix typo, add comments
tdittr Oct 17, 2023
f9266f2
Move v5 module to subdirectory
marlonbaeten Oct 17, 2023
fa96939
Handle V5 extension fields
tdittr Oct 17, 2023
ca4ccc2
Undo change that violated MSRV
tdittr Oct 17, 2023
ac6682c
Move NTPv5 errors in seperate enum
tdittr Oct 17, 2023
c7fe228
Switch flags from using hex to binary for better readability
tdittr Oct 17, 2023
d920434
Encode correct length in v5 extension fields
marlonbaeten Oct 17, 2023
9f24396
Include ExtensionHeaderVersion in fuzzer call
marlonbaeten Oct 17, 2023
a2cd777
Implement missing setters and getters for v5 header
tdittr Oct 17, 2023
aa5fa41
Fix fuzzer for versioned extension headers
marlonbaeten Oct 17, 2023
a680093
Fix lock file
marlonbaeten Oct 17, 2023
f18e752
Update versions in fuzz/Cargo.lock
marlonbaeten Oct 17, 2023
95fbaf5
Format fuzzer code
marlonbaeten Oct 17, 2023
a38e6c6
Also run fuzzer smoke tests for ntpv5
tdittr Oct 17, 2023
a433e6a
We have derive_arbitrary at home
marlonbaeten Oct 17, 2023
665facc
Address review comments
tdittr Oct 18, 2023
01399e1
Address clippy warning for fuzzing NTPv4
tdittr Oct 18, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 15 additions & 7 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:
- ""
features:
- ""
- "--features ntpv5"
steps:
- name: Checkout sources
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
Expand Down Expand Up @@ -67,6 +68,7 @@ jobs:
os: [ubuntu-latest]
features:
- ""
- "--features ntpv5"
steps:
- name: Checkout sources
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
Expand Down Expand Up @@ -96,6 +98,7 @@ jobs:
- ""
features:
- ""
- "--features ntpv5"
steps:
- name: Checkout sources
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
Expand Down Expand Up @@ -243,7 +246,7 @@ jobs:
uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505
with:
command: clippy
args: --workspace --all-targets -- -D warnings
args: --workspace --all-targets --all-features -- -D warnings
- name: Run clippy (fuzzers)
uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505
with:
Expand Down Expand Up @@ -287,7 +290,7 @@ jobs:
TARGET_CC: "/home/runner/.cargo/bin/cargo-zigbuild zig cc -- -target arm-linux-gnueabihf -mcpu=generic+v7a+vfp3-d32+thumb2-neon -g"
with:
command: clippy
args: --target armv7-unknown-linux-gnueabihf --workspace --all-targets -- -D warnings
args: --target armv7-unknown-linux-gnueabihf --workspace --all-targets --all-features -- -D warnings

clippy-macos:
name: ClippyMacOS
Expand Down Expand Up @@ -321,7 +324,7 @@ jobs:
TARGET_CC: "/home/runner/.cargo/bin/cargo-zigbuild zig cc -- -target x86_64-macos-gnu -g"
with:
command: clippy
args: --target x86_64-apple-darwin --workspace --all-targets -- -D warnings
args: --target x86_64-apple-darwin --workspace --all-targets --all-features -- -D warnings

clippy-musl:
name: ClippyMusl
Expand Down Expand Up @@ -355,11 +358,16 @@ jobs:
TARGET_CC: "/home/runner/.cargo/bin/cargo-zigbuild zig cc -- -target x86_64-linux-musl"
with:
command: clippy
args: --target x86_64-unknown-linux-musl --workspace --all-targets -- -D warnings
args: --target x86_64-unknown-linux-musl --workspace --all-targets --all-features -- -D warnings

fuzz:
name: Smoke-test fuzzing targets
runs-on: ubuntu-20.04
strategy:
matrix:
features:
- ""
- "--features ntpv5"
steps:
- name: Checkout sources
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
Expand All @@ -377,9 +385,9 @@ jobs:
tool: cargo-fuzz
- name: Smoke-test fuzz targets
run: |
cargo fuzz build
for target in $(cargo fuzz list) ; do
cargo fuzz run $target -- -max_total_time=10
cargo fuzz build ${{ matrix.features }}
for target in $(cargo fuzz list ${{ matrix.features }}) ; do
cargo fuzz run ${{ matrix.features }} $target -- -max_total_time=10
done

audit-dependencies:
Expand Down
33 changes: 16 additions & 17 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

98 changes: 4 additions & 94 deletions fuzz/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions fuzz/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ publish = false
[package.metadata]
cargo-fuzz = true

[features]
ntpv5 = ["ntp-proto/ntpv5"]

[dependencies]
rand = "0.8.5"

Expand Down
Loading