mirror of
git://anongit.mindrot.org/openssh.git
synced 2024-12-18 08:04:40 +00:00
upstream: skip a bit more FIDO token selection logic when only a
single token is attached. with Pedro Martelletto OpenBSD-Commit-ID: e4a324bd9814227ec1faa8cb619580e661cca9ac
This commit is contained in:
parent
744df42a12
commit
b969072cc3
@ -367,8 +367,13 @@ sk_select_by_cred(const fido_dev_info_t *devlist, size_t ndevs,
|
||||
skdebug(__func__, "sk_openv failed");
|
||||
return NULL;
|
||||
}
|
||||
if (skvcnt == 1) {
|
||||
sk = skv[0];
|
||||
skv[0] = NULL;
|
||||
goto out;
|
||||
}
|
||||
sk = NULL;
|
||||
for (i = 0; i < skvcnt; i++)
|
||||
for (i = 0; i < skvcnt; i++) {
|
||||
if (sk_try(skv[i], application, key_handle,
|
||||
key_handle_len) == 0) {
|
||||
sk = skv[i];
|
||||
@ -376,6 +381,8 @@ sk_select_by_cred(const fido_dev_info_t *devlist, size_t ndevs,
|
||||
skdebug(__func__, "found key in %s", sk->path);
|
||||
break;
|
||||
}
|
||||
}
|
||||
out:
|
||||
sk_closev(skv, skvcnt);
|
||||
return sk;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user