mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-11-24 02:05:01 +00:00
bdb_extend prints out secrets derived from the given BDS based on the given BDB. BUG=chromium:649555 BRANCH=none TEST=make runtests. Ran bdb_extend -s bds.bin -b bdb.bin (with/without -m) Change-Id: I8d9f73468992dad4cb93a422c0eae0977be9a16f Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/385539
21 lines
445 B
C
21 lines
445 B
C
/* Copyright 2016 The Chromium OS Authors. All rights reserved.
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
* found in the LICENSE file.
|
|
*/
|
|
|
|
#include <string.h>
|
|
|
|
#include "2sha.h"
|
|
#include "bdb.h"
|
|
|
|
int bdb_sha256(void *digest, const void *buf, size_t size)
|
|
{
|
|
struct vb2_sha256_context ctx;
|
|
|
|
vb2_sha256_init(&ctx);
|
|
vb2_sha256_update(&ctx, buf, size);
|
|
vb2_sha256_finalize(&ctx, digest);
|
|
|
|
return BDB_SUCCESS;
|
|
}
|