/* Flags */
#define SSH_SK_USER_PRESENCE_REQD 0x01
+ #define SSH_SK_USER_VERIFICATION_REQD 0x04
+ #define SSH_SK_RESIDENT_KEY 0x20
/* Algs */
#define SSH_SK_ECDSA 0x00
-/* $OpenBSD: sk-api.h,v 1.2 2019/11/12 19:32:30 markus Exp $ */
+/* $OpenBSD: sk-api.h,v 1.3 2019/12/30 09:19:52 djm Exp $ */
/*
* Copyright (c) 2019 Google LLC
*
/* Flags */
#define SSH_SK_USER_PRESENCE_REQD 0x01
+#define SSH_SK_USER_VERIFICATION_REQD 0x04
+#define SSH_SK_RESIDENT_KEY 0x20
/* Algs */
#define SSH_SK_ECDSA 0x00
#define SK_VERSION_MAJOR 0x00020000 /* current API version */
/* Flags */
-#define SK_USER_PRESENCE_REQD 0x01
+#define SK_USER_PRESENCE_REQD 0x01
+#define SK_USER_VERIFICATION_REQD 0x04
+#define SK_RESIDENT_KEY 0x20
/* Algs */
#define SK_ECDSA 0x00
int r;
char *device = NULL;
- (void)flags; /* XXX; unused */
#ifdef SK_DEBUG
fido_init(FIDO_DEBUG);
#endif
fido_strerr(r));
goto out;
}
+ if ((r = fido_cred_set_rk(cred, (flags & SK_RESIDENT_KEY) != 0 ?
+ FIDO_OPT_TRUE : FIDO_OPT_OMIT)) != FIDO_OK) {
+ skdebug(__func__, "fido_cred_set_rk: %s", fido_strerr(r));
+ goto out;
+ }
if ((r = fido_cred_set_user(cred, user_id, sizeof(user_id),
"openssh", "openssh", NULL)) != FIDO_OK) {
skdebug(__func__, "fido_cred_set_user: %s", fido_strerr(r));
-/* $OpenBSD: ssh-keygen.c,v 1.376 2019/12/30 03:30:09 djm Exp $ */
+/* $OpenBSD: ssh-keygen.c,v 1.377 2019/12/30 09:19:52 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1994 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
fatal("Missing security key flags");
if (strcasecmp(optarg, "no-touch-required") == 0)
sk_flags &= ~SSH_SK_USER_PRESENCE_REQD;
+ else if (strcasecmp(optarg, "resident") == 0)
+ sk_flags |= SSH_SK_RESIDENT_KEY;
else {
ull = strtoull(optarg, &ep, 0);
if (*ep != '\0')