summaryrefslogtreecommitdiff
path: root/sk-api.h
diff options
context:
space:
mode:
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