summaryrefslogtreecommitdiffstats
path: root/openpgp/fuzz/fuzz_targets/cert_from_bytes.rs
blob: 905095d23934c35e0d888945f0eb1b92029758a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#![no_main]

use libfuzzer_sys::{Corpus, fuzz_target};

use sequoia_openpgp as openpgp;
use openpgp::{
    Cert,
    parse::Parse,
};

fuzz_target!(|data: &[u8]| -> Corpus {
    match Cert::from_bytes(data) {
        Ok(_) => Corpus::Keep,
        Err(_) => Corpus::Reject,
    }
});