-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathboot_lockbox_dbus_adaptor.h
58 lines (46 loc) · 2.09 KB
/
boot_lockbox_dbus_adaptor.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// Copyright 2018 The ChromiumOS Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef BOOTLOCKBOX_BOOT_LOCKBOX_DBUS_ADAPTOR_H_
#define BOOTLOCKBOX_BOOT_LOCKBOX_DBUS_ADAPTOR_H_
#include <memory>
#include <vector>
#include "bootlockbox/nvram_boot_lockbox.h"
#include "bootlockbox/proto_bindings/boot_lockbox_rpc.pb.h"
#include "dbus_adaptors/org.chromium.BootLockboxInterface.h"
namespace bootlockbox {
// Implements DBus BootLockboxInterface.
class BootLockboxDBusAdaptor
: public org::chromium::BootLockboxInterfaceInterface,
public org::chromium::BootLockboxInterfaceAdaptor {
public:
// Don't own boot_lockbox, it is managed by BootLockboxService.
explicit BootLockboxDBusAdaptor(scoped_refptr<dbus::Bus> bus,
NVRamBootLockbox* boot_lockbox);
BootLockboxDBusAdaptor(const BootLockboxDBusAdaptor&) = delete;
BootLockboxDBusAdaptor& operator=(const BootLockboxDBusAdaptor&) = delete;
// Registers dbus objects.
void RegisterAsync(
brillo::dbus_utils::AsyncEventSequencer::CompletionAction cb);
// Stores a digest in bootlockbox.
void StoreBootLockbox(
std::unique_ptr<brillo::dbus_utils::DBusMethodResponse<
bootlockbox::StoreBootLockboxReply>> response,
const bootlockbox::StoreBootLockboxRequest& in_request) override;
// Reads a digest from bootlockbox.
void ReadBootLockbox(
std::unique_ptr<brillo::dbus_utils::DBusMethodResponse<
bootlockbox::ReadBootLockboxReply>> response,
const bootlockbox::ReadBootLockboxRequest& in_request) override;
// Finalizes the BootLockbox and locks the signing key. |response| is of type
// BaseReply.
void FinalizeBootLockbox(
std::unique_ptr<brillo::dbus_utils::DBusMethodResponse<
bootlockbox::FinalizeBootLockboxReply>> response,
const bootlockbox::FinalizeNVRamBootLockboxRequest& in_request) override;
private:
NVRamBootLockbox* boot_lockbox_;
brillo::dbus_utils::DBusObject dbus_object_;
};
} // namespace bootlockbox
#endif // BOOTLOCKBOX_BOOT_LOCKBOX_DBUS_ADAPTOR_H_