Android-cuttlefish cvd tool
|
#include <functional>
#include <mutex>
#include <optional>
#include <thread>
#include <android-base/logging.h>
#include <android-base/strings.h>
#include <gflags/gflags.h>
#include "cuttlefish/common/libs/fs/shared_fd.h"
#include "cuttlefish/common/libs/transport/channel_sharedfd.h"
#include "cuttlefish/host/commands/kernel_log_monitor/kernel_log_server.h"
#include "cuttlefish/host/commands/kernel_log_monitor/utils.h"
#include "cuttlefish/host/commands/secure_env/oemlock/oemlock.h"
#include "cuttlefish/host/commands/secure_env/oemlock/oemlock_responder.h"
#include "cuttlefish/host/commands/secure_env/storage/insecure_json_storage.h"
#include "cuttlefish/host/commands/secure_env/suspend_resume_handler.h"
#include "cuttlefish/host/commands/secure_env/worker_thread_loop_body.h"
#include "cuttlefish/host/libs/config/known_paths.h"
#include "cuttlefish/host/libs/config/logging.h"
Namespaces | |
namespace | cuttlefish |
namespace | cuttlefish::anonymous_namespace{secure_env_only_oemlock.cpp} |
Functions | |
DEFINE_int32 (confui_server_fd, -1, "A named socket to serve confirmation UI") | |
DEFINE_int32 (snapshot_control_fd, -1, "A socket connected to run_cvd for snapshot operations and" "responses") | |
DEFINE_int32 (keymaster_fd_in, -1, "A pipe for keymaster communication") | |
DEFINE_int32 (keymaster_fd_out, -1, "A pipe for keymaster communication") | |
DEFINE_int32 (keymint_fd_in, -1, "A pipe for keymint communication") | |
DEFINE_int32 (keymint_fd_out, -1, "A pipe for keymint communication") | |
DEFINE_int32 (gatekeeper_fd_in, -1, "A pipe for gatekeeper communication") | |
DEFINE_int32 (gatekeeper_fd_out, -1, "A pipe for gatekeeper communication") | |
DEFINE_int32 (oemlock_fd_in, -1, "A pipe for oemlock communication") | |
DEFINE_int32 (oemlock_fd_out, -1, "A pipe for oemlock communication") | |
DEFINE_int32 (kernel_events_fd, -1, "A pipe for monitoring events based on " "messages written to the kernel log. This " "is used by secure_env to monitor for " "device reboots.") | |
DEFINE_string (tpm_impl, "in_memory", "The TPM implementation. \"in_memory\" or \"host_device\"") | |
DEFINE_string (keymint_impl, "tpm", "The KeyMint implementation. \"tpm\" or \"software\"") | |
DEFINE_string (gatekeeper_impl, "tpm", "The gatekeeper implementation. \"tpm\" or \"software\"") | |
DEFINE_string (oemlock_impl, "tpm", "The oemlock implementation. \"tpm\" or \"software\"") | |
DEFINE_int32 (jcardsim_fd_in, -1, "A pipe for jcardsim communication") | |
DEFINE_int32 (jcardsim_fd_out, -1, "A pipe for jcardsim communication") | |
DEFINE_bool (enable_jcard_simulator, false, "Whether to enable jcardsimulator.") | |
constexpr std::chrono::seconds | cuttlefish::anonymous_namespace{secure_env_only_oemlock.cpp}::kRestartLockTimeout (2) |
SharedFD | cuttlefish::anonymous_namespace{secure_env_only_oemlock.cpp}::DupFdFlag (gflags::int32 fd) |
void | cuttlefish::anonymous_namespace{secure_env_only_oemlock.cpp}::ReExecSelf () |
std::thread | cuttlefish::anonymous_namespace{secure_env_only_oemlock.cpp}::StartKernelEventMonitor (SharedFD kernel_events_fd, std::timed_mutex &oemlock_lock) |
Result< void > | cuttlefish::anonymous_namespace{secure_env_only_oemlock.cpp}::SecureEnvMain (int argc, char **argv) |
int | main (int argc, char **argv) |
DEFINE_bool | ( | enable_jcard_simulator | , |
false | , | ||
"Whether to enable jcardsimulator." | |||
) |
DEFINE_int32 | ( | confui_server_fd | , |
- | 1, | ||
"A named socket to serve confirmation UI" | |||
) |
DEFINE_int32 | ( | gatekeeper_fd_in | , |
- | 1, | ||
"A pipe for gatekeeper communication" | |||
) |
DEFINE_int32 | ( | gatekeeper_fd_out | , |
- | 1, | ||
"A pipe for gatekeeper communication" | |||
) |
DEFINE_int32 | ( | jcardsim_fd_in | , |
- | 1, | ||
"A pipe for jcardsim communication" | |||
) |
DEFINE_int32 | ( | jcardsim_fd_out | , |
- | 1, | ||
"A pipe for jcardsim communication" | |||
) |
DEFINE_int32 | ( | kernel_events_fd | , |
- | 1, | ||
"A pipe for monitoring events based on " "messages written to the kernel log. This " "is used by secure_env to monitor for " "device reboots." | |||
) |
DEFINE_int32 | ( | keymaster_fd_in | , |
- | 1, | ||
"A pipe for keymaster communication" | |||
) |
DEFINE_int32 | ( | keymaster_fd_out | , |
- | 1, | ||
"A pipe for keymaster communication" | |||
) |
DEFINE_int32 | ( | keymint_fd_in | , |
- | 1, | ||
"A pipe for keymint communication" | |||
) |
DEFINE_int32 | ( | keymint_fd_out | , |
- | 1, | ||
"A pipe for keymint communication" | |||
) |
DEFINE_int32 | ( | oemlock_fd_in | , |
- | 1, | ||
"A pipe for oemlock communication" | |||
) |
DEFINE_int32 | ( | oemlock_fd_out | , |
- | 1, | ||
"A pipe for oemlock communication" | |||
) |
DEFINE_int32 | ( | snapshot_control_fd | , |
- | 1, | ||
"A socket connected to run_cvd for snapshot operations and" "responses" | |||
) |
DEFINE_string | ( | gatekeeper_impl | , |
"tpm" | , | ||
"The gatekeeper implementation. \"tpm\" or \"software\"" | |||
) |
DEFINE_string | ( | keymint_impl | , |
"tpm" | , | ||
"The KeyMint implementation. \"tpm\" or \"software\"" | |||
) |
DEFINE_string | ( | oemlock_impl | , |
"tpm" | , | ||
"The oemlock implementation. \"tpm\" or \"software\"" | |||
) |
DEFINE_string | ( | tpm_impl | , |
"in_memory" | , | ||
"The TPM implementation. \"in_memory\" or \"host_device\"" | |||
) |
int main | ( | int | argc, |
char ** | argv | ||
) |