summaryrefslogtreecommitdiff
path: root/ssh-sk.h
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2021-10-28 02:54:18 +0000
committerDamien Miller <djm@mindrot.org>2021-10-28 13:56:59 +1100
commit0001d04e55802d5bd9d6dece1081a99aa4ba2828 (patch)
tree9744b3ef6c10636866d1c304846a182451010155 /ssh-sk.h
parentd4bed5445646e605c383a4374fa962e23bf9e3a3 (diff)
downloadopenssh-git-0001d04e55802d5bd9d6dece1081a99aa4ba2828.tar.gz
upstream: When downloading resident keys from a FIDO token, pass
back the user ID that was used when the key was created and append it to the filename the key is written to (if it is not the default). Avoids keys being clobbered if the user created multiple resident keys with the same application string but different user IDs. feedback Pedro Martelletto; ok markus NB. increments SSH_SK_VERSION_MAJOR OpenBSD-Commit-ID: dbd658b5950f583106d945641a634bc6562dd3a3
Diffstat (limited to 'ssh-sk.h')
-rw-r--r--ssh-sk.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/ssh-sk.h b/ssh-sk.h
index 0f566bbc..89d1b662 100644
--- a/ssh-sk.h
+++ b/ssh-sk.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh-sk.h,v 1.10 2020/01/10 23:43:26 djm Exp $ */
+/* $OpenBSD: ssh-sk.h,v 1.11 2021/10/28 02:54:18 djm Exp $ */
/*
* Copyright (c) 2019 Google LLC
*
@@ -31,6 +31,12 @@ struct sk_option;
#define SSH_SK_HELPER_ENROLL 2
#define SSH_SK_HELPER_LOAD_RESIDENT 3
+struct sshsk_resident_key {
+ struct sshkey *key;
+ uint8_t *user_id;
+ size_t user_id_len;
+};
+
/*
* Enroll (generate) a new security-key hosted private key of given type
* via the specified provider middleware.
@@ -63,7 +69,11 @@ int sshsk_sign(const char *provider_path, struct sshkey *key,
* Returns 0 on success or a ssherr.h error code on failure.
*/
int sshsk_load_resident(const char *provider_path, const char *device,
- const char *pin, struct sshkey ***keysp, size_t *nkeysp);
+ const char *pin, u_int flags, struct sshsk_resident_key ***srksp,
+ size_t *nsrksp);
+
+/* Free an array of sshsk_resident_key (as returned from sshsk_load_resident) */
+void sshsk_free_resident_keys(struct sshsk_resident_key **srks, size_t nsrks);
#endif /* _SSH_SK_H */