vboot: use vb2_safe_memcmp instead of SafeMemcmp

No need to have two implementations of this now.

BUG=chromium:611535
BRANCH=none
TEST=make runtests; emerge-kevin coreboot depthcharge

Change-Id: I18bac928eb09971c37f3e1d7cbfd2009999b1f31
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/400899
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
This commit is contained in:
Randall Spangler
2016-10-14 10:41:44 -07:00
parent bf6263d529
commit 49e517d818
8 changed files with 50 additions and 101 deletions

View File

@@ -7,6 +7,8 @@
#include "sysincludes.h"
#include "2sysincludes.h"
#include "2common.h"
#include "gbb_access.h"
#include "gbb_header.h"
#include "load_kernel_fw.h"
@@ -759,7 +761,7 @@ static VbError_t EcUpdateImage(int devidx, VbCommonParams *cparams,
for (i = 0; i < hash_size; i++)
VBDEBUG(("%02x", hash[i]));
VBDEBUG(("\n"));
*need_update = SafeMemcmp(ec_hash, hash, hash_size);
*need_update = vb2_safe_memcmp(ec_hash, hash, hash_size);
if (!*need_update)
return VBERROR_SUCCESS;
@@ -854,7 +856,7 @@ static VbError_t EcUpdateImage(int devidx, VbCommonParams *cparams,
VBDEBUG(("%02x",ec_hash[i]));
VBDEBUG(("\n"));
if (SafeMemcmp(ec_hash, hash, hash_size)){
if (vb2_safe_memcmp(ec_hash, hash, hash_size)){
VBDEBUG(("EcUpdateImage() - "
"Failed to update EC-%s\n", rw_request ?
"RW" : "RO"));