Add Locking
This uses the estoraged version of locking for erase use.
It will unmount the file system, and make the encrypted block disappear.
Ideally we will add hardware locking support at a later time.
Signed-off-by: John Edward Broadbent <jebr@google.com>
Change-Id: I0cfb0637fc8d3dd6f8d23c9dd60d1f66fd424a4e
diff --git a/src/estoraged.cpp b/src/estoraged.cpp
index 826d44b..4f7fc40 100644
--- a/src/estoraged.cpp
+++ b/src/estoraged.cpp
@@ -104,6 +104,12 @@
}
case EraseMethod::SecuredLocked:
{
+ if (isLocked())
+ {
+ lock();
+ }
+ // TODO: implement hardware locking
+ // Until that is done, we can lock using eStoraged::lock()
break;
}
}