xref: /aosp_15_r20/external/crosvm/vendor/generic/anti_tamper/src/lib.rs (revision bb4ee6a4ae7042d18b07a98463b9c8b875e44b39)
1 // Copyright 2022 The ChromiumOS Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #[cfg(windows)]
6 use std::thread;
7 
8 #[cfg(windows)]
9 use base::ProtoTube;
10 #[cfg(windows)]
11 use base::Tube;
12 
setup_common_metric_invariants( _product_version: &Option<String>, _product_channel: &Option<String>, _use_vulkan: &Option<bool>, )13 pub fn setup_common_metric_invariants(
14     _product_version: &Option<String>,
15     _product_channel: &Option<String>,
16     _use_vulkan: &Option<bool>,
17 ) {
18 }
19 
enable_vcpu_monitoring() -> bool20 pub fn enable_vcpu_monitoring() -> bool {
21     false
22 }
23 
24 // This is a hard limit as it is used to set the Tube buffer size, and will
25 // deadlock if exceeded (b/223807352).
26 pub const MAX_CHALLENGE_SIZE: usize = 1;
27 
28 #[cfg(windows)]
forward_security_challenge(_recv: &ProtoTube, _sender: &ProtoTube)29 pub fn forward_security_challenge(_recv: &ProtoTube, _sender: &ProtoTube) {}
30 #[cfg(windows)]
forward_security_signal(_recv: &ProtoTube, _sender: &Tube)31 pub fn forward_security_signal(_recv: &ProtoTube, _sender: &Tube) {}
32 
33 pub struct SecurityContextWrapper {}
initialize_security_for_emulator() -> SecurityContextWrapper34 pub fn initialize_security_for_emulator() -> SecurityContextWrapper {
35     SecurityContextWrapper {}
36 }
37 
38 #[cfg(windows)]
spawn_dedicated_anti_tamper_thread( _security_context: SecurityContextWrapper, _tube_to_main_thread: base::ProtoTube, ) -> thread::JoinHandle<()>39 pub fn spawn_dedicated_anti_tamper_thread(
40     _security_context: SecurityContextWrapper,
41     _tube_to_main_thread: base::ProtoTube,
42 ) -> thread::JoinHandle<()> {
43     thread::spawn(move || ())
44 }
45