summaryrefslogtreecommitdiff
path: root/sk-api.h
diff options
context:
space:
mode:
authormarkus@openbsd.org <markus@openbsd.org>2019-11-12 19:32:30 +0000
committerDamien Miller <djm@mindrot.org>2019-11-13 08:49:59 +1100
commitfd1a3b5e38721b1d69aae2d9de1a1d9155dfa5c7 (patch)
treed476e8a0e827faa17ae0f8d036102c5810c28f35 /sk-api.h
parent7c32b51edbed5bd57870249c0a45dffd06be0002 (diff)
upstream: update sk-api to version 2 for ed25519 support; ok djm
OpenBSD-Commit-ID: 77aa4d5b6ab17987d8a600907b49573940a0044a
Diffstat (limited to 'sk-api.h')
-rw-r--r--sk-api.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/sk-api.h b/sk-api.h
index 2af0ef6f0..5ada30a3d 100644
--- a/sk-api.h
+++ b/sk-api.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: sk-api.h,v 1.1 2019/10/31 21:16:20 djm Exp $ */ 1/* $OpenBSD: sk-api.h,v 1.2 2019/11/12 19:32:30 markus Exp $ */
2/* 2/*
3 * Copyright (c) 2019 Google LLC 3 * Copyright (c) 2019 Google LLC
4 * 4 *
@@ -26,6 +26,10 @@
26/* Flags */ 26/* Flags */
27#define SSH_SK_USER_PRESENCE_REQD 0x01 27#define SSH_SK_USER_PRESENCE_REQD 0x01
28 28
29/* Algs */
30#define SSH_SK_ECDSA 0x00
31#define SSH_SK_ED25519 0x01
32
29struct sk_enroll_response { 33struct sk_enroll_response {
30 uint8_t *public_key; 34 uint8_t *public_key;
31 size_t public_key_len; 35 size_t public_key_len;
@@ -46,19 +50,19 @@ struct sk_sign_response {
46 size_t sig_s_len; 50 size_t sig_s_len;
47}; 51};
48 52
49#define SSH_SK_VERSION_MAJOR 0x00010000 /* current API version */ 53#define SSH_SK_VERSION_MAJOR 0x00020000 /* current API version */
50#define SSH_SK_VERSION_MAJOR_MASK 0xffff0000 54#define SSH_SK_VERSION_MAJOR_MASK 0xffff0000
51 55
52/* Return the version of the middleware API */ 56/* Return the version of the middleware API */
53uint32_t sk_api_version(void); 57uint32_t sk_api_version(void);
54 58
55/* Enroll a U2F key (private key generation) */ 59/* Enroll a U2F key (private key generation) */
56int sk_enroll(const uint8_t *challenge, size_t challenge_len, 60int sk_enroll(int alg, const uint8_t *challenge, size_t challenge_len,
57 const char *application, uint8_t flags, 61 const char *application, uint8_t flags,
58 struct sk_enroll_response **enroll_response); 62 struct sk_enroll_response **enroll_response);
59 63
60/* Sign a challenge */ 64/* Sign a challenge */
61int sk_sign(const uint8_t *message, size_t message_len, 65int sk_sign(int alg, const uint8_t *message, size_t message_len,
62 const char *application, const uint8_t *key_handle, size_t key_handle_len, 66 const char *application, const uint8_t *key_handle, size_t key_handle_len,
63 uint8_t flags, struct sk_sign_response **sign_response); 67 uint8_t flags, struct sk_sign_response **sign_response);
64 68