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 #1125

Closed
wants to merge 32 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
dfb6de9
Start implementation of NTPv5 header parsing
tdittr Oct 9, 2023
52e1eff
Implemented v5 header parsing
marlonbaeten Oct 9, 2023
0cb97ae
Implement parsing and serialization for draft identification extension
tdittr Oct 9, 2023
ae6dd9c
Add NTPv5 header to general NtpHeader to prepare for usage in server
tdittr Oct 9, 2023
5feaff3
fixup! Add NTPv5 header to general NtpHeader to prepare for usage in …
tdittr Oct 10, 2023
aa93a45
Add NTPv5 feature to CI and fuzzing
tdittr Oct 10, 2023
96e0aca
Address clippy warnings
tdittr Oct 10, 2023
518f4f1
fixup! Address clippy warnings
tdittr Oct 10, 2023
60e05eb
fixup! Add NTPv5 feature to CI and fuzzing
tdittr Oct 10, 2023
1358a94
Implement v5 header serialization
marlonbaeten Oct 10, 2023
8ed0bf4
Remove panic from v5 header parsing
marlonbaeten Oct 10, 2023
5bf4d73
Fix clippy warnings in v5.rs
marlonbaeten Oct 10, 2023
c2522d6
Add extension field ids for all draft extensions
tdittr Oct 17, 2023
4ee909e
Address PR comment and simplify draft id deserialization
tdittr Oct 17, 2023
e72d95f
Address PR comment, fix typo, add comments
tdittr Oct 17, 2023
f344a11
Move v5 module to subdirectory
marlonbaeten Oct 17, 2023
86d8b76
Handle V5 extension fields
tdittr Oct 17, 2023
dc12be4
Undo change that violated MSRV
tdittr Oct 17, 2023
6f90c79
Move NTPv5 errors in seperate enum
tdittr Oct 17, 2023
d9ecc48
Switch flags from using hex to binary for better readability
tdittr Oct 17, 2023
0c64b44
Encode correct length in v5 extension fields
marlonbaeten Oct 17, 2023
88088db
Include ExtensionHeaderVersion in fuzzer call
marlonbaeten Oct 17, 2023
d867e25
Implement missing setters and getters for v5 header
tdittr Oct 17, 2023
6eef269
Fix fuzzer for versioned extension headers
marlonbaeten Oct 17, 2023
160ee32
Merge branch 'main' into ntpv5-packet-parsing
marlonbaeten Oct 17, 2023
0d5b78a
Fix lock file
marlonbaeten Oct 17, 2023
68fdd68
Update versions in fuzz/Cargo.lock
marlonbaeten Oct 17, 2023
6a8f81f
Format fuzzer code
marlonbaeten Oct 17, 2023
c4bfb3f
Also run fuzzer smoke tests for ntpv5
tdittr Oct 17, 2023
0580671
We have derive_arbitrary at home
marlonbaeten Oct 17, 2023
993db2b
Address review comments
tdittr Oct 18, 2023
e58ca4c
fixup! Address review comments
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