mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-12-07 16:35:44 +00:00
Currently, VB2_DEBUG() will print the function name as a prefix to the
debug output. Add VB2_DEBUG_RAW() to print without that, so that it's
possible to print little bits of debug output. Use this in ec_sync to
hex dump the hashes.
And then clean up all of the debug calls which explicitly did things like:
VB2_DEBUG("%s: foo", __func__);
to just:
VB2_DEBUG("foo");
so they don't double-print the function name
BUG=chromium:683391
BRANCH=none
TEST=build_packages --board=reef chromeos-firmware &&
DEBUG=1 make -j runtests
CQ-DEPEND=CL:430978,CL:431111
Change-Id: I0c35519d2e670d55d65d01eaa60d61f3e3edf419
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/431171
Reviewed-by: Julius Werner <jwerner@chromium.org>
61 lines
1.4 KiB
C
61 lines
1.4 KiB
C
/* Copyright (c) 2014 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.
|
|
*
|
|
* Stub API implementations which should be implemented by the caller.
|
|
*/
|
|
|
|
#include <stdarg.h>
|
|
#include <stdio.h>
|
|
|
|
#include "2sysincludes.h"
|
|
#include "2api.h"
|
|
|
|
__attribute__((weak))
|
|
void vb2ex_printf(const char *func, const char *fmt, ...)
|
|
{
|
|
va_list ap;
|
|
va_start(ap, fmt);
|
|
if (func)
|
|
fprintf(stderr, "%s: ", func);
|
|
vfprintf(stderr, fmt, ap);
|
|
va_end(ap);
|
|
}
|
|
|
|
__attribute__((weak))
|
|
int vb2ex_tpm_clear_owner(struct vb2_context *ctx)
|
|
{
|
|
return VB2_ERROR_EX_TPM_CLEAR_OWNER_UNIMPLEMENTED;
|
|
}
|
|
|
|
__attribute__((weak))
|
|
int vb2ex_read_resource(struct vb2_context *ctx,
|
|
enum vb2_resource_index index,
|
|
uint32_t offset,
|
|
void *buf,
|
|
uint32_t size)
|
|
{
|
|
return VB2_ERROR_EX_READ_RESOURCE_UNIMPLEMENTED;
|
|
}
|
|
|
|
__attribute__((weak))
|
|
int vb2ex_hwcrypto_digest_init(enum vb2_hash_algorithm hash_alg,
|
|
uint32_t data_size)
|
|
{
|
|
return VB2_ERROR_EX_HWCRYPTO_UNSUPPORTED;
|
|
}
|
|
|
|
__attribute__((weak))
|
|
int vb2ex_hwcrypto_digest_extend(const uint8_t *buf,
|
|
uint32_t size)
|
|
{
|
|
return VB2_ERROR_SHA_EXTEND_ALGORITHM; /* Should not be called. */
|
|
}
|
|
|
|
__attribute__((weak))
|
|
int vb2ex_hwcrypto_digest_finalize(uint8_t *digest,
|
|
uint32_t digest_size)
|
|
{
|
|
return VB2_ERROR_SHA_FINALIZE_ALGORITHM; /* Should not be called. */
|
|
}
|