summaryrefslogtreecommitdiff
path: root/ssh-sk.c
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2020-01-28 08:01:34 +0000
committerDamien Miller <djm@mindrot.org>2020-01-29 18:52:55 +1100
commit24c0f752adf9021277a7b0a84931bb5fe48ea379 (patch)
treecd1b9474e73ad7647b4ad88775365e7430d3fe64 /ssh-sk.c
parent156bef36f93a48212383235bb8e3d71eaf2b2777 (diff)
upstream: changes to support FIDO attestation
Allow writing to disk the attestation certificate that is generated by the FIDO token at key enrollment time. These certificates may be used by an out-of-band workflow to prove that a particular key is held in trustworthy hardware. Allow passing in a challenge that will be sent to the card during key enrollment. These are needed to build an attestation workflow that resists replay attacks. ok markus@ OpenBSD-Commit-ID: 457dc3c3d689ba39eed328f0817ed9b91a5f78f6
Diffstat (limited to 'ssh-sk.c')
-rw-r--r--ssh-sk.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/ssh-sk.c b/ssh-sk.c
index a8d4de832..3e88aafff 100644
--- a/ssh-sk.c
+++ b/ssh-sk.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssh-sk.c,v 1.25 2020/01/25 23:13:09 djm Exp $ */ 1/* $OpenBSD: ssh-sk.c,v 1.26 2020/01/28 08:01:34 djm Exp $ */
2/* 2/*
3 * Copyright (c) 2019 Google LLC 3 * Copyright (c) 2019 Google LLC
4 * 4 *
@@ -504,14 +504,14 @@ sshsk_enroll(int type, const char *provider_path, const char *device,
504 504
505 /* Optionally fill in the attestation information */ 505 /* Optionally fill in the attestation information */
506 if (attest != NULL) { 506 if (attest != NULL) {
507 if ((r = sshbuf_put_cstring(attest, "sk-attest-v00")) != 0 || 507 if ((r = sshbuf_put_cstring(attest,
508 (r = sshbuf_put_u32(attest, 1)) != 0 || /* XXX U2F ver */ 508 "ssh-sk-attest-v00")) != 0 ||
509 (r = sshbuf_put_string(attest, 509 (r = sshbuf_put_string(attest,
510 resp->attestation_cert, resp->attestation_cert_len)) != 0 || 510 resp->attestation_cert, resp->attestation_cert_len)) != 0 ||
511 (r = sshbuf_put_string(attest, 511 (r = sshbuf_put_string(attest,
512 resp->signature, resp->signature_len)) != 0 || 512 resp->signature, resp->signature_len)) != 0 ||
513 (r = sshbuf_put_u32(attest, flags)) != 0 || /* XXX right? */ 513 (r = sshbuf_put_u32(attest, 0)) != 0 || /* resvd flags */
514 (r = sshbuf_put_string(attest, NULL, 0)) != 0) { 514 (r = sshbuf_put_string(attest, NULL, 0)) != 0 /* resvd */) {
515 error("%s: buffer error: %s", __func__, ssh_err(r)); 515 error("%s: buffer error: %s", __func__, ssh_err(r));
516 goto out; 516 goto out;
517 } 517 }