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

Unified Diff: verity_main.cc

Issue 6811030: verity: remove the depth parameter from bht_create (Closed) Base URL: http://git.chromium.org/git/dm-verity.git@master
Patch Set: Fix per review. 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
« dm-bht_unittest.cc ('K') | « file_hasher.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: verity_main.cc
diff --git a/verity_main.cc b/verity_main.cc
index 7f3631936e77d216d7059f13f2ee74d62f34ec16..8c059e2f555318558c61b0fbc75dc03a3eebcd7f 100644
--- a/verity_main.cc
+++ b/verity_main.cc
@@ -20,7 +20,7 @@ void print_usage(const char *name) {
"- mode: May be create or verify\n"
" If create, the `hash_image' will be created.\n"
" If verify, the `hash_image` will be used to verify `image'.\n"
-"- depth: Integer specifying the hash tree depth (excl root node)\n"
+"- depth: Deprecated. Must be `0'.\n"
"- alg: Cryptographic hash algorithm to use\n"
" Valid values: sha512 sha384 sha256 sha224 sha1 sha\n"
" mdc2 ripemd160 md5 md4 md2\n"
@@ -50,8 +50,7 @@ static unsigned int parse_blocks(const char *block_s) {
}
} // namespace
-static int verity_create(unsigned int depth,
- const char *alg,
+static int verity_create(const char *alg,
const char *image_path,
unsigned int image_blocks,
const char *hash_path);
@@ -62,9 +61,13 @@ int main(int argc, char **argv) {
return 1;
}
+ if (parse_depth(argv[2]) != 0) {
+ LOG(FATAL) << "depth must be 0";
+ return -1;
+ }
+
if (parse_mode(argv[1]) == VERITY_CREATE) {
- return verity_create(parse_depth(argv[2]),
- argv[3], // alg
+ return verity_create(argv[3], // alg
argv[4], // image_path
parse_blocks(argv[5]),
argv[6]); // hash path
@@ -74,9 +77,8 @@ int main(int argc, char **argv) {
return -1;
}
-static int verity_create(unsigned int depth,
- const char *alg,
- const char *image_path,
+static int verity_create(const char *alg,
+ const char *image_path,
unsigned int image_blocks,
const char *hash_path) {
// Configure files
@@ -95,7 +97,6 @@ static int verity_create(unsigned int depth,
verity::FileHasher hasher;
LOG_IF(FATAL, !hasher.Initialize(&source,
&destination,
- depth,
image_blocks,
alg))
<< "Failed to initialize hasher";
« dm-bht_unittest.cc ('K') | « file_hasher.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698