Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Android/trusty/trusty/user/desktop/app/finger_guard/svc/   (Android Betriebssystem Version 17©)  Datei vom 26.5.2026 mit Größe 2 kB image not shown  

Quelle  lib.rs

  Sprache: Rust
 

/*
* Copyright (C) 2025 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.
*/


mod clock;
mod keymint;
mod storage;
mod trusty;

#[cfg(test)]
mod tests;

use finger_guard::service::FingerGuardService;
use crate::trusty::Trusty;
use binder::BinderFeatures;
use android_desktop_security_finger_guard::aidl::android::desktop::security::finger_guard::IFingerGuard::BnFingerGuard;
use rpcbinder::RpcServer;
use std::ffi::CString;
use std::rc::Rc;
use tipc::{Manager, PortCfg};

const PORT_COUNT: usize = 1;
const CONNECTION_COUNT: usize = 1;

tipc::service_dispatcher! {
    enum FingerGuardDispatcher {
        RpcServer
    }
}
pub fn init_and_start_loop() -> tipc::Result<()> {
    trusty_log::init();

    let mut dispatcher =
        FingerGuardDispatcher::<PORT_COUNT>::new().expect("Could not create dispatcher");
    let service = FingerGuardService::new(Trusty);
    let binder_service = BnFingerGuard::new_binder(service, BinderFeatures::default());
    let rpc_service = RpcServer::new_per_session(move |_uuid| Some(binder_service.as_binder()));

    // Allow secure (within trusty) and non-secure (outside trusty) connections.
    // Originally only intended for non-secure connections, now allowed secure connection as well
    // to facilitate the unit tests within the trusty environment.
    let app_cfg = PortCfg::new_raw(CString::from(finger_guard_api::PORT_CSTR))
        .allow_ta_connect()
        .allow_ns_connect();
    dispatcher
        .add_service(Rc::new(rpc_service), app_cfg)
        .expect("Could not add FingerGuardService to dispatcher");

    // <_, _, 1, 1> means we define a Manager with a single port, and max one connection.
    Manager::<_, _, PORT_COUNT, CONNECTION_COUNT>::new_with_dispatcher(dispatcher, [])
        .expect("Could not create service manager")
        .run_event_loop()
        .expect("FingerGuard event loop failed");

    Ok(())
}

Messung V0.5 in Prozent
C=90 H=97 G=93

¤ Dauer der Verarbeitung: 0.10 Sekunden  (vorverarbeitet am  2026-06-27) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.