Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a37c62f3 authored by David Drysdale's avatar David Drysdale Committed by Automerger Merge Worker
Browse files

AuthGraph: add fuzzer am: 6fb22dc9 am: db141272

parents 74f8aadf db141272
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -63,3 +63,20 @@ rust_binary {
        "src/main.rs",
    ],
}

rust_fuzz {
    name: "android.hardware.authgraph-service.nonsecure_fuzzer",
    rustlibs: [
        "libauthgraph_hal",
        "libauthgraph_nonsecure",
        "libbinder_random_parcel_rs",
        "libbinder_rs",
    ],
    srcs: ["src/fuzzer.rs"],
    fuzz_config: {
        cc: [
            "drysdale@google.com",
            "hasinitg@google.com",
        ],
    },
}
+31 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2023 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#![allow(missing_docs)]
#![no_main]
extern crate libfuzzer_sys;

use authgraph_hal::service::AuthGraphService;
use authgraph_nonsecure::LocalTa;
use binder_random_parcel_rs::fuzz_service;
use libfuzzer_sys::fuzz_target;
use std::sync::{Arc, Mutex};

fuzz_target!(|data: &[u8]| {
    let local_ta = LocalTa::new();
    let service = AuthGraphService::new_as_binder(Arc::new(Mutex::new(local_ta)));
    fuzz_service(&mut service.as_binder(), data);
});