Make time acquisition impl dependent
Different architectures will have different ways of getting time.
Goal is to keep GateKeeper base architecture independent so
it's easy to reuse.
Change-Id: I1e3179367607172410fbc2fe1daa011d610e24e7
diff --git a/gatekeeper.cpp b/gatekeeper.cpp
index a63b221..5b3ca5d 100644
--- a/gatekeeper.cpp
+++ b/gatekeeper.cpp
@@ -13,9 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-#include <time.h>
-#include <iostream>
-#include <iomanip>
#include <UniquePtr.h>
#include <gatekeeper/gatekeeper.h>
@@ -121,10 +118,7 @@
authenticator_id = password_handle->authenticator_id;
}
- struct timespec time;
- uint64_t timestamp;
- clock_gettime(CLOCK_MONOTONIC_RAW, &time);
- timestamp = static_cast<uint32_t>(time.tv_sec);
+ uint64_t timestamp = GetNanosecondsSinceBoot();
if (DoVerify(password_handle, request.provided_password)) {
// Signature matches