summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--firmware/2lib/2stub.c13
-rw-r--r--firmware/2lib/include/2return_codes.h13
2 files changed, 17 insertions, 9 deletions
diff --git a/firmware/2lib/2stub.c b/firmware/2lib/2stub.c
index e3489cf5..417c06ee 100644
--- a/firmware/2lib/2stub.c
+++ b/firmware/2lib/2stub.c
@@ -27,7 +27,8 @@ void vb2ex_printf(const char *func, const char *fmt, ...)
__attribute__((weak))
int vb2ex_tpm_clear_owner(struct vb2_context *ctx)
{
- return VB2_ERROR_EX_TPM_CLEAR_OWNER_UNIMPLEMENTED;
+ fprintf(stderr, "%s: function not implemented", __func__);
+ return VB2_ERROR_EX_UNIMPLEMENTED;
}
__attribute__((weak))
@@ -37,7 +38,8 @@ int vb2ex_read_resource(struct vb2_context *ctx,
void *buf,
uint32_t size)
{
- return VB2_ERROR_EX_READ_RESOURCE_UNIMPLEMENTED;
+ fprintf(stderr, "%s: function not implemented", __func__);
+ return VB2_ERROR_EX_UNIMPLEMENTED;
}
__attribute__((weak))
@@ -51,18 +53,19 @@ __attribute__((weak))
int vb2ex_hwcrypto_digest_extend(const uint8_t *buf,
uint32_t size)
{
- return VB2_ERROR_SHA_EXTEND_ALGORITHM; /* Should not be called. */
+ 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. */
+ return VB2_ERROR_SHA_FINALIZE_ALGORITHM; /* Should not be called. */
}
__attribute__((weak))
int vb2ex_tpm_set_mode(enum vb2_tpm_mode mode_val)
{
- return VB2_ERROR_UNKNOWN;
+ fprintf(stderr, "%s: function not implemented", __func__);
+ return VB2_ERROR_EX_UNIMPLEMENTED;
}
diff --git a/firmware/2lib/include/2return_codes.h b/firmware/2lib/include/2return_codes.h
index 3cc01010..92e4eb1c 100644
--- a/firmware/2lib/include/2return_codes.h
+++ b/firmware/2lib/include/2return_codes.h
@@ -588,8 +588,9 @@ enum vb2_return_code {
*/
VB2_ERROR_EX = VB2_ERROR_BASE + 0x0a0000,
- /* Read resource not implemented */
- VB2_ERROR_EX_READ_RESOURCE_UNIMPLEMENTED,
+ /* Read resource not implemented
+ * Deprecated: use VB2_ERROR_EX_UNIMPLEMENTED (chromium:944804) */
+ VB2_ERROR_EX_DEPRECATED_READ_RESOURCE_UNIMPLEMENTED,
/* Resource index not found */
VB2_ERROR_EX_READ_RESOURCE_INDEX,
@@ -600,8 +601,9 @@ enum vb2_return_code {
/* TPM clear owner failed */
VB2_ERROR_EX_TPM_CLEAR_OWNER,
- /* TPM clear owner not implemented */
- VB2_ERROR_EX_TPM_CLEAR_OWNER_UNIMPLEMENTED,
+ /* TPM clear owner not implemented
+ * Deprecated: use VB2_ERROR_EX_UNIMPLEMENTED (chromium:944804) */
+ VB2_ERROR_DEPRECATED_EX_TPM_CLEAR_OWNER_UNIMPLEMENTED,
/* Hardware crypto engine doesn't support this algorithm (non-fatal) */
VB2_ERROR_EX_HWCRYPTO_UNSUPPORTED,
@@ -609,6 +611,9 @@ enum vb2_return_code {
/* TPM does not understand this command */
VB2_ERROR_EX_TPM_NO_SUCH_COMMAND,
+ /* vb2ex function is unimplemented (stubbed in 2lib/2stub.c) */
+ VB2_ERROR_EX_UNIMPLEMENTED,
+
/**********************************************************************
* Errors generated by host library (non-firmware) start here.
*/