summaryrefslogtreecommitdiff
path: root/soft_keymaster_device.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'soft_keymaster_device.cpp')
-rw-r--r--soft_keymaster_device.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/soft_keymaster_device.cpp b/soft_keymaster_device.cpp
index 852abb2..dba91ee 100644
--- a/soft_keymaster_device.cpp
+++ b/soft_keymaster_device.cpp
@@ -60,6 +60,15 @@ namespace keymaster {
SoftKeymasterDevice::SoftKeymasterDevice(keymaster0_device_t* keymaster0_device)
: impl_(new AndroidKeymaster(new SoftKeymasterContext(keymaster0_device), 16)) {
+ initialize(keymaster0_device);
+}
+
+SoftKeymasterDevice::SoftKeymasterDevice(KeymasterContext* context)
+ : impl_(new AndroidKeymaster(context, 16)) {
+ initialize(nullptr);
+}
+
+void SoftKeymasterDevice::initialize(keymaster0_device_t* keymaster0_device) {
static_assert(std::is_standard_layout<SoftKeymasterDevice>::value,
"SoftKeymasterDevice must be standard layout");
static_assert(offsetof(SoftKeymasterDevice, device_) == 0,