summaryrefslogtreecommitdiff
path: root/tests/bdb_test.c
diff options
context:
space:
mode:
authorDaisuke Nojiri <dnojiri@chromium.org>2016-05-03 16:23:53 -0700
committerchrome-bot <chrome-bot@chromium.org>2016-05-04 11:34:08 -0700
commitedc3c8e4409bd9bd5cccac8a2fe48ddd5927fa6a (patch)
tree2fd95d5a9af2641d3c885dc19ce8e6c03d246782 /tests/bdb_test.c
parent825a2f8c7315520f62f6bb981b24f075ed5136e8 (diff)
downloadvboot-edc3c8e4409bd9bd5cccac8a2fe48ddd5927fa6a.tar.gz
bdb: Replace sha functions with vb2 library
BDB has its own implementation of SHA256. This patch replaces it with the one implemented in vb2 library. BUG=chrome-os-partner:51908 BRANCH=tot TEST=build runtests Change-Id: Ida19dd49153a038fc2b2ce481cedf828818aaeaa Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/342121 Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'tests/bdb_test.c')
-rw-r--r--tests/bdb_test.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/bdb_test.c b/tests/bdb_test.c
index a7f103ab..d96e71a8 100644
--- a/tests/bdb_test.c
+++ b/tests/bdb_test.c
@@ -9,6 +9,7 @@
#include <stdlib.h>
#include <string.h>
+#include "2sha.h"
#include "bdb.h"
#include "host.h"
#include "test_common.h"
@@ -306,7 +307,9 @@ void check_bdb_verify(const char *key_dir)
exit(2);
}
- bdb_sha256(bdbkey_digest, p.bdbkey, p.bdbkey->struct_size);
+ vb2_digest_buffer((uint8_t *)p.bdbkey, p.bdbkey->struct_size,
+ VB2_HASH_SHA256,
+ bdbkey_digest, BDB_SHA256_DIGEST_SIZE);
/* Create the test BDB */
hgood = bdb_create(&p);