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:
Ingo Franzki
2018-06-15 07:48:46 +02:00
committed by Jan Höppner
parent d6a96f07c1
commit 344965bd29
+3
View File
@@ -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: