diff options
author | markus@openbsd.org <markus@openbsd.org> | 2019-11-12 19:32:30 +0000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2019-11-13 08:49:59 +1100 |
commit | fd1a3b5e38721b1d69aae2d9de1a1d9155dfa5c7 (patch) | |
tree | d476e8a0e827faa17ae0f8d036102c5810c28f35 /sk-api.h | |
parent | 7c32b51edbed5bd57870249c0a45dffd06be0002 (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.h | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -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 | |||
29 | struct sk_enroll_response { | 33 | struct 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 */ |
53 | uint32_t sk_api_version(void); | 57 | uint32_t sk_api_version(void); |
54 | 58 | ||
55 | /* Enroll a U2F key (private key generation) */ | 59 | /* Enroll a U2F key (private key generation) */ |
56 | int sk_enroll(const uint8_t *challenge, size_t challenge_len, | 60 | int 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 */ |
61 | int sk_sign(const uint8_t *message, size_t message_len, | 65 | int 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 | ||