Replace original token activation retcode -EAGAIN with -ENOANO.

crypt_activate_by_token (and _pin variant) now returns -ENOANO
instead -EAGAIN in case token handler identifies specific token
requires PIN to sucessfully complete token based activation.

-EAGAIN is now used for special case when additional system
resources are missing (HW token, other device, system daemon,
etc).
This commit is contained in:
Ondrej Kozina
2021-05-21 15:39:54 +02:00
parent 2f320f3148
commit 877afd2281
2 changed files with 33 additions and 7 deletions

View File

@@ -1538,7 +1538,7 @@ static int action_open_luks(void)
tools_keyslot_msg(r, UNLOCKED);
/* Token requires PIN, but ask only there will be no password query later */
if (ARG_SET(OPT_TOKEN_ONLY_ID) && r == -EAGAIN) {
if (ARG_SET(OPT_TOKEN_ONLY_ID) && r == -ENOANO) {
r = tools_get_key(_("Enter token PIN:"), &password, &passwordLen, 0, 0, NULL,
ARG_UINT32(OPT_TIMEOUT_ID), _verify_passphrase(0), 0, cd);
if (r < 0)