summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
authorDaisuke Nojiri <dnojiri@chromium.org>2020-08-12 15:46:30 -0700
committerCommit Bot <commit-bot@chromium.org>2020-08-19 02:09:02 +0000
commit053592bd3d5fcb79b8fa3a6f6193ffedfc041dba (patch)
tree6088a6910490013226292fdb570f0dcd992d8739 /firmware
parentfaf9cd3bbbc133487c272d81771b8bbf4d439915 (diff)
downloadvboot-053592bd3d5fcb79b8fa3a6f6193ffedfc041dba.tar.gz
inclusive: change usage of sanity
Google is working to change its source code to use more inclusive language. To that end, replace the term "sanity" with inclusive alternatives. BUG=b:163883397 BRANCH=None TEST=grep -ir sanity TEST=make runtests Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Change-Id: I708a044d89050c442f14fb11a8ae5e98490d56af Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2353420 Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'firmware')
-rw-r--r--firmware/2lib/2common.c4
-rw-r--r--firmware/2lib/2ui_screens.c6
-rw-r--r--firmware/2lib/include/2common.h6
-rw-r--r--firmware/lib/cgptlib/cgptlib.c4
-rw-r--r--firmware/lib/cgptlib/cgptlib_internal.c2
-rw-r--r--firmware/lib/cgptlib/include/cgptlib_internal.h4
-rw-r--r--firmware/lib/tpm_lite/tlcl.c4
-rw-r--r--firmware/lib/vboot_api_kernel.c2
-rw-r--r--firmware/lib/vboot_kernel.c8
-rw-r--r--firmware/lib/vboot_ui_legacy_clamshell.c2
-rw-r--r--firmware/lib/vboot_ui_legacy_menu.c2
-rw-r--r--firmware/lib20/include/vb2_common.h4
-rw-r--r--firmware/lib20/kernel.c2
-rw-r--r--firmware/lib20/packed_key.c2
-rw-r--r--firmware/stub/tpm_lite_stub.c2
15 files changed, 27 insertions, 27 deletions
diff --git a/firmware/2lib/2common.c b/firmware/2lib/2common.c
index e51b84ff..09379cc2 100644
--- a/firmware/2lib/2common.c
+++ b/firmware/2lib/2common.c
@@ -267,7 +267,7 @@ vb2_error_t vb2_verify_keyblock(struct vb2_keyblock *block, uint32_t size,
struct vb2_signature *sig = &block->keyblock_signature;
vb2_error_t rv;
- /* Sanity check keyblock before attempting signature check of data */
+ /* Validity check keyblock before attempting signature check of data */
VB2_TRY(vb2_check_keyblock(block, size, sig));
VB2_DEBUG("Checking keyblock signature...\n");
@@ -290,7 +290,7 @@ vb2_error_t vb2_verify_fw_preamble(struct vb2_fw_preamble *preamble,
VB2_DEBUG("Verifying preamble.\n");
- /* Sanity checks before attempting signature of data */
+ /* Validity checks before attempting signature of data */
if(size < sizeof(*preamble)) {
VB2_DEBUG("Not enough data for preamble header\n");
return VB2_ERROR_PREAMBLE_TOO_SMALL_FOR_HEADER;
diff --git a/firmware/2lib/2ui_screens.c b/firmware/2lib/2ui_screens.c
index 04f037bd..e8f59164 100644
--- a/firmware/2lib/2ui_screens.c
+++ b/firmware/2lib/2ui_screens.c
@@ -415,11 +415,11 @@ static vb2_error_t recovery_to_dev_finalize(struct vb2_ui_context *ui)
{
VB2_DEBUG("Physical presence confirmed!\n");
- /* Sanity check, should never happen. */
+ /* Validity check, should never happen. */
if (ui->state->screen->id != VB2_SCREEN_RECOVERY_TO_DEV ||
(vb2_get_sd(ui->ctx)->flags & VB2_SD_FLAG_DEV_MODE_ENABLED) ||
!vb2_allow_recovery(ui->ctx)) {
- VB2_DEBUG("ERROR: Dev transition sanity check failed\n");
+ VB2_DEBUG("ERROR: Dev transition validity check failed\n");
return VB2_REQUEST_UI_CONTINUE;
}
@@ -630,7 +630,7 @@ vb2_error_t vb2_ui_developer_mode_boot_external_action(
{
vb2_error_t rv;
- /* Sanity check, should never happen. */
+ /* Validity check, should never happen. */
if (!(ui->ctx->flags & VB2_CONTEXT_DEVELOPER_MODE) ||
!vb2_dev_boot_allowed(ui->ctx) ||
!vb2_dev_boot_external_allowed(ui->ctx)) {
diff --git a/firmware/2lib/include/2common.h b/firmware/2lib/include/2common.h
index e3a7989b..dbc62643 100644
--- a/firmware/2lib/include/2common.h
+++ b/firmware/2lib/include/2common.h
@@ -371,7 +371,7 @@ vb2_error_t vb2_verify_data(const uint8_t *data, uint32_t size,
const struct vb2_workbuf *wb);
/**
- * Check the sanity of a keyblock structure.
+ * Check the validity of a keyblock structure.
*
* Verifies all the header fields. Does not verify key index or keyblock
* flags. Should be called before verifying the keyblock data itself using
@@ -388,7 +388,7 @@ vb2_error_t vb2_check_keyblock(const struct vb2_keyblock *block, uint32_t size,
/**
* Verify a keyblock using a public key.
*
- * Header fields are also checked for sanity. Does not verify key index or key
+ * Header fields are also checked for validity. Does not verify key index or key
* block flags. Signature inside block is destroyed during check.
*
* @param block Keyblock to verify
@@ -402,7 +402,7 @@ vb2_error_t vb2_verify_keyblock(struct vb2_keyblock *block, uint32_t size,
const struct vb2_workbuf *wb);
/**
- * Check the sanity of a firmware preamble using a public key.
+ * Check the validity of a firmware preamble using a public key.
*
* The signature in the preamble is destroyed during the check.
*
diff --git a/firmware/lib/cgptlib/cgptlib.c b/firmware/lib/cgptlib/cgptlib.c
index 2cc77b4a..3fbb2fdc 100644
--- a/firmware/lib/cgptlib/cgptlib.c
+++ b/firmware/lib/cgptlib/cgptlib.c
@@ -19,9 +19,9 @@ int GptInit(GptData *gpt)
gpt->current_kernel = CGPT_KERNEL_ENTRY_NOT_FOUND;
gpt->current_priority = 999;
- retval = GptSanityCheck(gpt);
+ retval = GptValidityCheck(gpt);
if (GPT_SUCCESS != retval) {
- VB2_DEBUG("GptInit() failed sanity check\n");
+ VB2_DEBUG("GptInit() failed validity check\n");
return retval;
}
diff --git a/firmware/lib/cgptlib/cgptlib_internal.c b/firmware/lib/cgptlib/cgptlib_internal.c
index 593b1e2c..cb8ad2b9 100644
--- a/firmware/lib/cgptlib/cgptlib_internal.c
+++ b/firmware/lib/cgptlib/cgptlib_internal.c
@@ -237,7 +237,7 @@ int HeaderFieldsSame(GptHeader *h1, GptHeader *h2)
return 0;
}
-int GptSanityCheck(GptData *gpt)
+int GptValidityCheck(GptData *gpt)
{
int retval;
GptHeader *header1 = (GptHeader *)(gpt->primary_header);
diff --git a/firmware/lib/cgptlib/include/cgptlib_internal.h b/firmware/lib/cgptlib/include/cgptlib_internal.h
index cc01f4ca..10ffa392 100644
--- a/firmware/lib/cgptlib/include/cgptlib_internal.h
+++ b/firmware/lib/cgptlib/include/cgptlib_internal.h
@@ -129,11 +129,11 @@ int HeaderFieldsSame(GptHeader *h1, GptHeader *h2);
*
* On error, returns a GPT_ERROR_* return code.
*/
-int GptSanityCheck(GptData *gpt);
+int GptValidityCheck(GptData *gpt);
/**
* Repair GPT data by copying from one set of valid headers/entries to the
- * other. Assumes GptSanityCheck() has been run to determine which headers
+ * other. Assumes GptValidityCheck() has been run to determine which headers
* and/or entries are already valid.
*
* The caller must make sure that even if one of the entries table is invalid
diff --git a/firmware/lib/tpm_lite/tlcl.c b/firmware/lib/tpm_lite/tlcl.c
index 4b3714da..47f58dc6 100644
--- a/firmware/lib/tpm_lite/tlcl.c
+++ b/firmware/lib/tpm_lite/tlcl.c
@@ -257,8 +257,8 @@ static uint32_t AddRequestAuthBlock(struct auth_session* auth_session,
return TPM_E_AUTHFAIL;
}
- /* Sanity check to make sure the command buffer has sufficient space to
- * add the auth block at the end of the command. */
+ /* Validity check to make sure the command buffer has sufficient space
+ * to add the auth block at the end of the command. */
if (command_buffer_size < kTpmRequestHeaderLength) {
return TPM_E_BUFFER_SIZE;
}
diff --git a/firmware/lib/vboot_api_kernel.c b/firmware/lib/vboot_api_kernel.c
index 4ae52c57..eeabde8e 100644
--- a/firmware/lib/vboot_api_kernel.c
+++ b/firmware/lib/vboot_api_kernel.c
@@ -73,7 +73,7 @@ vb2_error_t VbTryLoadKernel(struct vb2_context *ctx, uint32_t get_info_flags)
for (i = 0; i < disk_count; i++) {
VB2_DEBUG("trying disk %d\n", (int)i);
/*
- * Sanity-check what we can. FWIW, VbTryLoadKernel() is always
+ * Validity-check what we can. FWIW, VbTryLoadKernel() is always
* called with only a single bit set in get_info_flags.
*
* Ensure that we got a partition with only the flags we asked
diff --git a/firmware/lib/vboot_kernel.c b/firmware/lib/vboot_kernel.c
index 50a4d062..6a0b0f37 100644
--- a/firmware/lib/vboot_kernel.c
+++ b/firmware/lib/vboot_kernel.c
@@ -626,10 +626,10 @@ vb2_error_t LoadKernel(struct vb2_context *ctx, LoadKernelParams *params)
VB2_DEBUG("Good partition %d\n", params->partition_number);
shcall.check_result = VBSD_LKC_CHECK_GOOD_PARTITION;
/*
- * Sanity check - only store a new TPM version if we found one.
- * If lowest_version is still at its initial value, we didn't
- * find one; for example, we're in developer mode and just
- * didn't look.
+ * Validity check - only store a new TPM version if we found
+ * one. If lowest_version is still at its initial value, we
+ * didn't find one; for example, we're in developer mode and
+ * just didn't look.
*/
if (lowest_version != LOWEST_TPM_VERSION &&
lowest_version > sd->kernel_version)
diff --git a/firmware/lib/vboot_ui_legacy_clamshell.c b/firmware/lib/vboot_ui_legacy_clamshell.c
index 47e6fdba..a1ffe5b0 100644
--- a/firmware/lib/vboot_ui_legacy_clamshell.c
+++ b/firmware/lib/vboot_ui_legacy_clamshell.c
@@ -300,7 +300,7 @@ static vb2_error_t vb2_developer_ui(struct vb2_context *ctx)
/* See if we should disable virtual dev-mode switch. */
VB2_DEBUG("sd->flags=%#x\n", sd->flags);
- /* Sanity check, should never fail. */
+ /* Validity check, should never fail. */
VB2_ASSERT(sd->flags & VB2_SD_FLAG_DEV_MODE_ENABLED);
/* Stop the countdown while we go ask... */
diff --git a/firmware/lib/vboot_ui_legacy_menu.c b/firmware/lib/vboot_ui_legacy_menu.c
index f5165ad7..4bad5648 100644
--- a/firmware/lib/vboot_ui_legacy_menu.c
+++ b/firmware/lib/vboot_ui_legacy_menu.c
@@ -389,7 +389,7 @@ static vb2_error_t altfw_action(struct vb2_context *ctx)
/* Action that enables developer mode and reboots. */
static vb2_error_t to_dev_action(struct vb2_context *ctx)
{
- /* Sanity check, should never happen. */
+ /* Validity check, should never happen. */
if ((vb2_get_sd(ctx)->flags & VB2_SD_FLAG_DEV_MODE_ENABLED) ||
!vb2_allow_recovery(ctx))
return VB2_REQUEST_UI_CONTINUE;
diff --git a/firmware/lib20/include/vb2_common.h b/firmware/lib20/include/vb2_common.h
index 20e0014d..53a077f3 100644
--- a/firmware/lib20/include/vb2_common.h
+++ b/firmware/lib20/include/vb2_common.h
@@ -48,7 +48,7 @@ vb2_error_t vb2_unpack_key(struct vb2_public_key *key,
/**
* Verify a keyblock using its hash.
*
- * Header fields are also checked for sanity. Does not verify key index or key
+ * Header fields are also checked for validity. Does not verify key index or key
* block flags. Use this for self-signed keyblocks in developer mode.
*
* @param block Keyblock to verify
@@ -62,7 +62,7 @@ vb2_error_t vb2_verify_keyblock_hash(const struct vb2_keyblock *block,
const struct vb2_workbuf *wb);
/**
- * Check the sanity of a kernel preamble using a public key.
+ * Check the validity of a kernel preamble using a public key.
*
* The signature in the preamble is destroyed during the check.
*
diff --git a/firmware/lib20/kernel.c b/firmware/lib20/kernel.c
index ed04c6f3..e1422a40 100644
--- a/firmware/lib20/kernel.c
+++ b/firmware/lib20/kernel.c
@@ -46,7 +46,7 @@ vb2_error_t vb2_verify_keyblock_hash(const struct vb2_keyblock *block,
uint8_t *digest;
uint32_t digest_size;
- /* Sanity check keyblock before attempting hash check of data */
+ /* Validity check keyblock before attempting hash check of data */
VB2_TRY(vb2_check_keyblock(block, size, sig));
VB2_DEBUG("Checking keyblock hash...\n");
diff --git a/firmware/lib20/packed_key.c b/firmware/lib20/packed_key.c
index 6d8fdebe..e2e9b22b 100644
--- a/firmware/lib20/packed_key.c
+++ b/firmware/lib20/packed_key.c
@@ -46,7 +46,7 @@ vb2_error_t vb2_unpack_key_buffer(struct vb2_public_key *key,
if (!vb2_aligned(buf32, sizeof(uint32_t)))
return VB2_ERROR_UNPACK_KEY_ALIGN;
- /* Sanity check key array size */
+ /* Validity check key array size */
key->arrsize = buf32[0];
if (key->arrsize * sizeof(uint32_t) != vb2_rsa_sig_size(key->sig_alg))
return VB2_ERROR_UNPACK_KEY_ARRAY_SIZE;
diff --git a/firmware/stub/tpm_lite_stub.c b/firmware/stub/tpm_lite_stub.c
index c77b82c3..b59db33d 100644
--- a/firmware/stub/tpm_lite_stub.c
+++ b/firmware/stub/tpm_lite_stub.c
@@ -273,7 +273,7 @@ uint32_t vb2ex_tpm_send_recv(const uint8_t* request, uint32_t request_length,
#endif
#ifndef NDEBUG
- /* sanity checks */
+ /* validity checks */
tag = TpmTag(request);
response_tag = TpmTag(response);
assert(