mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
zkey: Fix display of XTS attribute for validate command
Use after free causes the XTS attribute to be displayed wrongly.
Fixes: 298fab68fe ("zkey: Preparations for introducing a new key type")
Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
committed by
Jan Höppner
parent
729a98fcb3
commit
f75f4aff8f
@@ -2539,7 +2539,7 @@ static int _keystore_process_validate(struct keystore *keystore,
|
||||
size_t secure_key_size;
|
||||
u8 mkvp[MKVP_LENGTH];
|
||||
char *apqns = NULL;
|
||||
u8 *secure_key;
|
||||
u8 *secure_key = NULL;
|
||||
int is_old_mk;
|
||||
int rc, valid;
|
||||
|
||||
@@ -2572,8 +2572,7 @@ static int _keystore_process_validate(struct keystore *keystore,
|
||||
|
||||
rc = get_master_key_verification_pattern(secure_key, secure_key_size,
|
||||
mkvp, keystore->verbose);
|
||||
free(secure_key);
|
||||
if (rc)
|
||||
if (rc != 0)
|
||||
goto out;
|
||||
|
||||
_keystore_print_record(info->rec, name, properties, 1,
|
||||
@@ -2599,6 +2598,8 @@ static int _keystore_process_validate(struct keystore *keystore,
|
||||
info->num_warnings++;
|
||||
|
||||
out:
|
||||
if (secure_key != NULL)
|
||||
free(secure_key);
|
||||
if (apqns != NULL)
|
||||
free(apqns);
|
||||
if (apqn_list != NULL)
|
||||
|
||||
Reference in New Issue
Block a user