anti_tamper/
lib.rs

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)]
6use std::thread;
7
8#[cfg(windows)]
9use base::ProtoTube;
10#[cfg(windows)]
11use base::Tube;
12
13pub fn setup_common_metric_invariants(
14    _product_version: &Option<String>,
15    _product_channel: &Option<String>,
16    _use_vulkan: &Option<bool>,
17) {
18}
19
20pub 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).
26pub const MAX_CHALLENGE_SIZE: usize = 1;
27
28#[cfg(windows)]
29pub fn forward_security_challenge(_recv: &ProtoTube, _sender: &ProtoTube) {}
30#[cfg(windows)]
31pub fn forward_security_signal(_recv: &ProtoTube, _sender: &Tube) {}
32
33pub struct SecurityContextWrapper {}
34pub fn initialize_security_for_emulator() -> SecurityContextWrapper {
35    SecurityContextWrapper {}
36}
37
38#[cfg(windows)]
39pub 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}