From 27120f28247635b85e0d484e63c49e8a98f9209c Mon Sep 17 00:00:00 2001 From: Marc Hartmayer Date: Thu, 24 Jun 2021 16:03:55 +0000 Subject: [PATCH] genprotimg: rename PV_CFLAG_NO_DECRYPTION to PV_PCF_NO_DECRYPTION MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The new name reflects that it's a plaintext control flag. While at it, use a left shift operation to calculate the value. Acked-by: Viktor Mihajlovski Signed-off-by: Marc Hartmayer Signed-off-by: Jan Höppner --- genprotimg/src/include/pv_hdr_def.h | 4 ++-- genprotimg/src/pv/pv_hdr.c | 2 +- genprotimg/src/pv/pv_image.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/genprotimg/src/include/pv_hdr_def.h b/genprotimg/src/include/pv_hdr_def.h index 850ed267..2e0a15aa 100644 --- a/genprotimg/src/include/pv_hdr_def.h +++ b/genprotimg/src/include/pv_hdr_def.h @@ -24,8 +24,8 @@ #define PV_MAGIC_NUMBER 0x49424d5365634578ULL #define PV_VERSION_1 0x00000100U -/* prevent Ultravisor decryption during unpack operation */ -#define PV_CFLAG_NO_DECRYPTION 0x10000000ULL +/* Plaintext control flags */ +#define PV_PCF_NO_DECRYPTION (1ULL << 28) /* prevent Ultravisor decryption during unpack operation */ /* maxima for the PV version 1 */ #define PV_V1_IPIB_MAX_SIZE PAGE_SIZE diff --git a/genprotimg/src/pv/pv_hdr.c b/genprotimg/src/pv/pv_hdr.c index e46e1761..f2ac90cf 100644 --- a/genprotimg/src/pv/pv_hdr.c +++ b/genprotimg/src/pv/pv_hdr.c @@ -41,7 +41,7 @@ uint32_t pv_hdr_size(const PvHdr *hdr) gboolean pv_hdr_uses_encryption(const PvHdr *hdr) { - return !(GUINT64_FROM_BE(hdr->head.pcf) & PV_CFLAG_NO_DECRYPTION); + return !(GUINT64_FROM_BE(hdr->head.pcf) & PV_PCF_NO_DECRYPTION); } uint64_t pv_hdr_enc_size(const PvHdr *hdr) diff --git a/genprotimg/src/pv/pv_image.c b/genprotimg/src/pv/pv_image.c index 375e40f6..a0dd8fb4 100644 --- a/genprotimg/src/pv/pv_image.c +++ b/genprotimg/src/pv/pv_image.c @@ -61,7 +61,7 @@ static gint pv_img_prepare_component(const PvImage *img, PvComponent *comp, void *opaque = NULL; gint rc; - if (img->pcf & PV_CFLAG_NO_DECRYPTION) { + if (img->pcf & PV_PCF_NO_DECRYPTION) { /* we only need to align the components */ func = pv_component_align; opaque = NULL;