xen/vmac: Const the key parameter of vmac_set_key()

ECLAIR reports that tboot_gen_domain_integrity() is casting away
constness (Rule 11.8 violation).

vmac_set_key() doesn't modify the user_key parameter, so it can become const,
removing the need to cast.

No functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
This commit is contained in:
Andrew Cooper committed 2026-02-25 16:06:04 +00:00
1 parent 44416a8431
commit 619d317cec
3 files changed
+5 -5

No files matched your search

+3 -3
View File
@@ -202,7 +202,7 @@ static void tboot_gen_domain_integrity(const uint8_t key[TB_KEY_SIZE],
uint8_t nonce[16] = {};
vmac_ctx_t ctx;
vmac_set_key((uint8_t *)key, &ctx);
vmac_set_key(key, &ctx);
for_each_domain( d )
{
if ( !(d->options & XEN_DOMCTL_CDF_s3_integrity) )
@@ -241,7 +241,7 @@ static void tboot_gen_xenheap_integrity(const uint8_t key[TB_KEY_SIZE],
uint8_t nonce[16] = {};
vmac_ctx_t ctx;
vmac_set_key((uint8_t *)key, &ctx);
vmac_set_key(key, &ctx);
for ( mfn = 0; mfn < max_page; mfn++ )
{
struct page_info *page = mfn_to_page(_mfn(mfn));
@@ -272,7 +272,7 @@ static void tboot_gen_frametable_integrity(const uint8_t key[TB_KEY_SIZE],
uint8_t nonce[16] = {};
vmac_ctx_t ctx;
vmac_set_key((uint8_t *)key, &ctx);
vmac_set_key(key, &ctx);
for ( sidx = 0; ; sidx = nidx )
{
eidx = find_next_zero_bit(pdx_group_valid, max_idx, sidx);
+1 -1
View File
@@ -924,7 +924,7 @@ uint64_t vmac(unsigned char m[],
/* ----------------------------------------------------------------------- */
void vmac_set_key(unsigned char user_key[], vmac_ctx_t *ctx)
void vmac_set_key(const unsigned char user_key[], vmac_ctx_t *ctx)
{
uint64_t in[2] = {0}, out[2];
unsigned i;
+1 -1
View File
@@ -161,7 +161,7 @@ uint64_t vhash(unsigned char m[],
* When passed a VMAC_KEY_LEN bit user_key, this function initialazies ctx.
* ----------------------------------------------------------------------- */
void vmac_set_key(unsigned char user_key[], vmac_ctx_t *ctx);
void vmac_set_key(const unsigned char user_key[], vmac_ctx_t *ctx);
/* --------------------------------------------------------------------- */
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.