aboutsummaryrefslogtreecommitdiff
path: root/tests/qtest/tpm-util.c
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <philmd@redhat.com>2020-09-02 10:09:09 +0200
committerThomas Huth <thuth@redhat.com>2020-09-03 12:47:33 +0200
commited943cc934a82fd78102f0df2084a8f3c556716f (patch)
tree4ecdd681a510997b7584fe3efbd09a5e70316b25 /tests/qtest/tpm-util.c
parentdf1a312fea58bb3f83b5d7eba0946d43cb16675f (diff)
downloadqemu-ed943cc934a82fd78102f0df2084a8f3c556716f.zip
qemu-ed943cc934a82fd78102f0df2084a8f3c556716f.tar.gz
qemu-ed943cc934a82fd78102f0df2084a8f3c556716f.tar.bz2
tests/qtest/tpm: Declare input buffers const and static
The functions using these arrays expect a "const unsigned char *" argument, it is safe to declare these as 'static const'. Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20200902080909.161034-1-philmd@redhat.com> Reviewed-by: Darren Kenny <darren.kenny@oracle.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'tests/qtest/tpm-util.c')
-rw-r--r--tests/qtest/tpm-util.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/qtest/tpm-util.c b/tests/qtest/tpm-util.c
index e2b29ef..3ed6c85 100644
--- a/tests/qtest/tpm-util.c
+++ b/tests/qtest/tpm-util.c
@@ -98,9 +98,9 @@ void tpm_util_tis_transfer(QTestState *s,
void tpm_util_startup(QTestState *s, tx_func *tx)
{
unsigned char buffer[1024];
- unsigned char tpm_startup[] =
+ static const unsigned char tpm_startup[] =
"\x80\x01\x00\x00\x00\x0c\x00\x00\x01\x44\x00\x00";
- unsigned char tpm_startup_resp[] =
+ static const unsigned char tpm_startup_resp[] =
"\x80\x01\x00\x00\x00\x0a\x00\x00\x00\x00";
tx(s, tpm_startup, sizeof(tpm_startup), buffer, sizeof(buffer));
@@ -112,14 +112,14 @@ void tpm_util_startup(QTestState *s, tx_func *tx)
void tpm_util_pcrextend(QTestState *s, tx_func *tx)
{
unsigned char buffer[1024];
- unsigned char tpm_pcrextend[] =
+ static const unsigned char tpm_pcrextend[] =
"\x80\x02\x00\x00\x00\x41\x00\x00\x01\x82\x00\x00\x00\x0a\x00\x00"
"\x00\x09\x40\x00\x00\x09\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00"
"\x0b\x74\x65\x73\x74\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00";
- unsigned char tpm_pcrextend_resp[] =
+ static const unsigned char tpm_pcrextend_resp[] =
"\x80\x02\x00\x00\x00\x13\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x01\x00\x00";
@@ -133,7 +133,7 @@ void tpm_util_pcrread(QTestState *s, tx_func *tx,
const unsigned char *exp_resp, size_t exp_resp_size)
{
unsigned char buffer[1024];
- unsigned char tpm_pcrread[] =
+ static const unsigned char tpm_pcrread[] =
"\x80\x01\x00\x00\x00\x14\x00\x00\x01\x7e\x00\x00\x00\x01\x00\x0b"
"\x03\x00\x04\x00";