resolve merge conflicts of eacbb82 to nyc-dev-plus-aosp
Change-Id: Ia3077f826c1d422932b62684ae0d53935abfe807
diff --git a/fs_mgr/fs_mgr_verity.cpp b/fs_mgr/fs_mgr_verity.cpp
index 72554a8..3993b05 100644
--- a/fs_mgr/fs_mgr_verity.cpp
+++ b/fs_mgr/fs_mgr_verity.cpp
@@ -145,6 +145,18 @@
return retval;
}
+static int verify_verity_signature(const struct fec_verity_metadata& verity)
+{
+ if (verify_table(verity.signature, sizeof(verity.signature),
+ verity.table, verity.table_length) == 0 ||
+ verify_table(verity.ecc_signature, sizeof(verity.ecc_signature),
+ verity.table, verity.table_length) == 0) {
+ return 0;
+ }
+
+ return -1;
+}
+
static int invalidate_table(char *table, size_t table_length)
{
size_t n = 0;
@@ -950,8 +962,7 @@
}
// verify the signature on the table
- if (verify_table(verity.signature, sizeof(verity.signature), params.table,
- verity.table_length) < 0) {
+ if (verify_verity_signature(verity) < 0) {
if (params.mode == VERITY_MODE_LOGGING) {
// the user has been warned, allow mounting without dm-verity
retval = FS_MGR_SETUP_VERITY_SUCCESS;