fido2: implement the default sk_callbacks for FIDO2/U2F keys using the usb-hid protocol

Signed-off-by: Praneeth Sarode <praneethsarode@gmail.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Eshan Kelkar <eshankelkar@galorithm.com>
This commit is contained in:
Praneeth Sarode
2025-08-17 01:56:25 +05:30
parent c1dd30b47b
commit 50ee6411f2
4 changed files with 2297 additions and 0 deletions

View File

@@ -23,9 +23,14 @@
#include <stdlib.h>
#include <string.h>
#include "libssh/callbacks.h"
#include "libssh/priv.h"
#include "libssh/sk_common.h"
#ifdef HAVE_LIBFIDO2
#include "libssh/sk_usbhid.h"
#endif
const char *ssh_sk_err_to_string(int sk_err)
{
switch (sk_err) {
@@ -274,3 +279,12 @@ bool sk_callbacks_check_compatibility(
return true;
}
const struct ssh_sk_callbacks_struct *ssh_sk_get_default_callbacks(void)
{
#ifdef HAVE_LIBFIDO2
return ssh_sk_get_usbhid_callbacks();
#else
return NULL;
#endif /* HAVE_LIBFIDO2 */
}