Skip to content

Commit 803e013

Browse files
committed
make key_lookup compatible with winhello
1 parent ca9f04b commit 803e013

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

contrib/win32/openssh/config.h.vs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@
151151
#define HAVE_FIDO_DEV_GET_TOUCH_STATUS
152152
#define HAVE_FIDO_CRED_SET_CLIENTDATA
153153
#define HAVE_FIDO_ASSERT_SET_CLIENTDATA
154+
#define HAVE_FIDO_DEV_IS_WINHELLO
154155

155156
/* File names may not contain backslash characters */
156157
/* #undef FILESYSTEM_NO_BACKSLASH */
@@ -1736,3 +1737,4 @@
17361737
#define HAVE_KILLPG 1
17371738

17381739

1740+

sk-usbhid.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -780,7 +780,10 @@ static int
780780
key_lookup(fido_dev_t *dev, const char *application, const uint8_t *user_id,
781781
size_t user_id_len, const char *pin)
782782
{
783-
fido_assert_t *assert = NULL;
783+
#ifdef HAVE_FIDO_DEV_IS_WINHELLO
784+
return FIDO_OK;
785+
#else
786+
fido_assert_t* assert = NULL;
784787
uint8_t message[32];
785788
int r = FIDO_ERR_INTERNAL;
786789
int sk_supports_uv, uv;
@@ -809,33 +812,32 @@ key_lookup(fido_dev_t *dev, const char *application, const uint8_t *user_id,
809812
}
810813
uv = FIDO_OPT_OMIT;
811814
if (pin == NULL && check_sk_options(dev, "uv", &sk_supports_uv) == 0 &&
812-
sk_supports_uv != -1)
815+
sk_supports_uv != -1)
813816
uv = FIDO_OPT_TRUE;
814817
if ((r = fido_assert_set_uv(assert, uv)) != FIDO_OK) {
815818
skdebug(__func__, "fido_assert_set_uv: %s", fido_strerr(r));
816819
goto out;
817820
}
818-
#ifndef WINDOWS
819821
if ((r = fido_dev_get_assert(dev, assert, pin)) != FIDO_OK) {
820822
skdebug(__func__, "fido_dev_get_assert: %s", fido_strerr(r));
821823
goto out;
822824
}
823-
#endif
824825
r = FIDO_ERR_NO_CREDENTIALS;
825826
skdebug(__func__, "%zu signatures returned", fido_assert_count(assert));
826827
for (i = 0; i < fido_assert_count(assert); i++) {
827828
if (fido_assert_user_id_len(assert, i) == user_id_len &&
828-
memcmp(fido_assert_user_id_ptr(assert, i), user_id,
829-
user_id_len) == 0) {
829+
memcmp(fido_assert_user_id_ptr(assert, i), user_id,
830+
user_id_len) == 0) {
830831
skdebug(__func__, "credential exists");
831832
r = FIDO_OK;
832833
goto out;
833834
}
834835
}
835-
out:
836+
out:
836837
fido_assert_free(&assert);
837838

838839
return r;
840+
#endif /* HAVE_FIDO_DEV_IS_WINHELLO */
839841
}
840842

841843
int

0 commit comments

Comments
 (0)