summaryrefslogtreecommitdiff
path: root/tests/vb2_api_tests.c
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2014-11-04 16:45:37 -0800
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-11-06 02:28:16 +0000
commita063a43ad776c9831051e62565c0136ce36d0b09 (patch)
tree9bef87d76bd7c5730d353cec1626cf613b0ff8c7 /tests/vb2_api_tests.c
parentad105edeb2ff0f2fbafd15655d351e8bb7522a21 (diff)
downloadvboot-a063a43ad776c9831051e62565c0136ce36d0b09.tar.gz
vboot2: pass const work buffers, and clarify min_offset output
When a work buffer is passed to a function, and duplicated inside that function, allocations made against the duplicate are automatically freed when the duplicate goes out of scope. Make that explicit in the comments. And pass in const struct workbuf * instead of struct workbuf *, to make it clear that the passed-in work buffer pointer is not being altered by the function. Also, comment that the value of min_offset becomes undefined if vb2_verify_common_member() or vb2_verify_common_subobject() fails. BUG=chromium:423882 BRANCH=none TEST=VBOOT2=1 make runtests Change-Id: Icc6010e6ef786f78cd2176a59d4d0e6e14905a11 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/227524 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Diffstat (limited to 'tests/vb2_api_tests.c')
-rw-r--r--tests/vb2_api_tests.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/vb2_api_tests.c b/tests/vb2_api_tests.c
index cf706d46..5d667663 100644
--- a/tests/vb2_api_tests.c
+++ b/tests/vb2_api_tests.c
@@ -182,7 +182,7 @@ uint32_t vb2_rsa_sig_size(enum vb2_signature_algorithm sig_alg)
int vb2_rsa_verify_digest(const struct vb2_public_key *key,
uint8_t *sig,
const uint8_t *digest,
- struct vb2_workbuf *wb)
+ const struct vb2_workbuf *wb)
{
return retval_vb2_verify_digest;
}