Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1850)

Unified Diff: drivers/md/dm-bht.c

Issue 6902084: CHROMIUM: verity: remove compare_hash layer (Closed) Base URL: http://git.chromium.org/git/kernel-next.git@chromeos-2.6.38
Patch Set: Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: drivers/md/dm-bht.c
diff --git a/drivers/md/dm-bht.c b/drivers/md/dm-bht.c
index d2541603b043575463283bb3797947f9a061d428..74674554733d6666f87eb0fe34d571883068cc2a 100644
--- a/drivers/md/dm-bht.c
+++ b/drivers/md/dm-bht.c
@@ -523,11 +523,6 @@ nomem:
}
-static int dm_bht_compare_hash(struct dm_bht *bht, u8 *known, u8 *computed)
-{
- return memcmp(known, computed, bht->digest_size);
-}
-
/* dm_bht_verify_path
* Verifies the path. Returns 0 on ok.
*/
@@ -553,7 +548,7 @@ static int dm_bht_verify_path(struct dm_bht *bht, unsigned int block_index,
node = dm_bht_get_node(bht, entry, depth, block_index);
if (dm_bht_compute_hash(bht, pg, offset, digest) ||
- dm_bht_compare_hash(bht, digest, node))
+ memcmp(digest, node, bht->digest_size))
goto mismatch;
/* Keep the containing block of hashes to be verified in the
@@ -565,7 +560,7 @@ static int dm_bht_verify_path(struct dm_bht *bht, unsigned int block_index,
if (depth == 0 && state != DM_BHT_ENTRY_VERIFIED) {
if (dm_bht_compute_hash(bht, pg, offset, digest) ||
- dm_bht_compare_hash(bht, digest, bht->root_digest))
+ memcmp(digest, bht->root_digest, bht->digest_size))
goto mismatch;
atomic_set(&entry->state, DM_BHT_ENTRY_VERIFIED);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698