zkey/kmip: Fix 'assignment discards 'const' qualifier' warnings

Fix compile warnings like

   warning: assignment discards 'const' qualifier from pointer target type
                                                   [-Wdiscarded-qualifiers]

by declaring the variables as const or cast appropriately.

Reviewed-by: Finn Callies <fcallies@linux.ibm.com>
Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Ingo Franzki
2026-06-08 09:19:36 +02:00
committed by Jan Höppner
parent 27f20495a7
commit d04d331673
2 changed files with 4 additions and 3 deletions

View File

@@ -115,11 +115,11 @@ int profile_read(struct plugin_handle *ph, const char *profile_dir,
prof = util_zalloc(sizeof(struct kmip_profile));
tok = strrchr(profile_file, '/');
tok = (char *)strrchr(profile_file, '/');
if (tok == NULL)
tok = (char *)profile_file;
prof->name = util_strdup(tok);
tok = strchr(prof->name, '.');
tok = (char *)strchr(prof->name, '.');
if (tok != NULL)
*tok = 0;

View File

@@ -4740,7 +4740,8 @@ out:
static char *_parse_label(struct plugin_handle *ph, const char *label,
enum kms_key_mode key_mode)
{
char *tok, *ret = NULL;
char *ret = NULL;
const char *tok;
tok = strchr(label, ':');