mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
zkey: Fix APQN validation routine
When a zkey generate or change command is used to associate one or multiple APQNs the command succeeds, but no key is generated and no APQNs are associated, because the return code returned by _keystore_apqn_check() is wrong. 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
d6a96f07c1
commit
344965bd29
@@ -986,6 +986,7 @@ static int _keystore_apqn_check(const char *apqn, bool remove,
|
||||
}
|
||||
|
||||
if (sscanf(apqn, "%x.%x", &card, &domain) != 2) {
|
||||
warnx("the APQN '%s' is not valid", apqn);
|
||||
rc = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
@@ -1003,6 +1004,8 @@ static int _keystore_apqn_check(const char *apqn, bool remove,
|
||||
rc == -1 ? "not a CCA card" : "not online");
|
||||
rc = -EIO;
|
||||
goto out;
|
||||
} else {
|
||||
rc = 0;
|
||||
}
|
||||
|
||||
out:
|
||||
|
||||
Reference in New Issue
Block a user