Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
14 changes: 14 additions & 0 deletions .github/workflows/x509.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,17 @@ jobs:
override: true
- uses: RustCrypto/actions/cargo-hack-install@master
- run: cargo hack test --feature-powerset

fuzz:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: RustCrypto/actions/cargo-cache@master
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
- run: cargo install cargo-fuzz
- run: cargo fuzz run certreq -- -max_total_time=30 -seed_inputs="fuzz/inputs/rsa2048-csr.der"
- run: cargo fuzz run certreqinfo -- -max_total_time=30
4 changes: 4 additions & 0 deletions x509/fuzz/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
target
corpus
artifacts
Cargo.lock
17 changes: 17 additions & 0 deletions x509/fuzz/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[package]
name = "x509-fuzz"
version = "0.0.0"
authors = ["RustCrypto Developers"]
publish = false
edition = "2021"

[package.metadata]
cargo-fuzz = true

[dependencies]
libfuzzer-sys = "0.4"
x509 = { path = ".." }

# Prevents this crate from interfering with the workspace
[workspace]
members = ["."]
Binary file added x509/fuzz/inputs/rsa2048-csr.der
Binary file not shown.
8 changes: 8 additions & 0 deletions x509/fuzz/src/bin/certreq.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#![no_main]

use libfuzzer_sys::fuzz_target;
use x509::request::CertReq;

fuzz_target!(|input: &[u8]| {
let _ = CertReq::try_from(input);
});
8 changes: 8 additions & 0 deletions x509/fuzz/src/bin/certreqinfo.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#![no_main]

use libfuzzer_sys::fuzz_target;
use x509::request::CertReqInfo;

fuzz_target!(|input: &[u8]| {
let _ = CertReqInfo::try_from(input);
});