diff options
Diffstat (limited to 'src/extern.h')
-rw-r--r-- | src/extern.h | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/src/extern.h b/src/extern.h index c35af58..fc0a49d 100644 --- a/src/extern.h +++ b/src/extern.h | |||
@@ -7,6 +7,15 @@ | |||
7 | #ifndef _EXTERN_H | 7 | #ifndef _EXTERN_H |
8 | #define _EXTERN_H | 8 | #define _EXTERN_H |
9 | 9 | ||
10 | #include <stdint.h> | ||
11 | |||
12 | #include "fido/types.h" | ||
13 | #include "blob.h" | ||
14 | |||
15 | #ifdef __cplusplus | ||
16 | extern "C" { | ||
17 | #endif /* __cplusplus */ | ||
18 | |||
10 | /* aes256 */ | 19 | /* aes256 */ |
11 | int aes256_cbc_dec(const fido_blob_t *, const fido_blob_t *, fido_blob_t *); | 20 | int aes256_cbc_dec(const fido_blob_t *, const fido_blob_t *, fido_blob_t *); |
12 | int aes256_cbc_enc(const fido_blob_t *, const fido_blob_t *, fido_blob_t *); | 21 | int aes256_cbc_enc(const fido_blob_t *, const fido_blob_t *, fido_blob_t *); |
@@ -16,7 +25,7 @@ cbor_item_t *cbor_flatten_vector(cbor_item_t **, size_t); | |||
16 | cbor_item_t *cbor_encode_assert_options(fido_opt_t, fido_opt_t); | 25 | cbor_item_t *cbor_encode_assert_options(fido_opt_t, fido_opt_t); |
17 | cbor_item_t *cbor_encode_change_pin_auth(const fido_blob_t *, | 26 | cbor_item_t *cbor_encode_change_pin_auth(const fido_blob_t *, |
18 | const fido_blob_t *, const fido_blob_t *); | 27 | const fido_blob_t *, const fido_blob_t *); |
19 | cbor_item_t *cbor_encode_extensions(int); | 28 | cbor_item_t *cbor_encode_extensions(const fido_cred_ext_t *); |
20 | cbor_item_t *cbor_encode_hmac_secret_param(const fido_blob_t *, | 29 | cbor_item_t *cbor_encode_hmac_secret_param(const fido_blob_t *, |
21 | const es256_pk_t *, const fido_blob_t *); | 30 | const es256_pk_t *, const fido_blob_t *); |
22 | cbor_item_t *cbor_encode_options(fido_opt_t, fido_opt_t); | 31 | cbor_item_t *cbor_encode_options(fido_opt_t, fido_opt_t); |
@@ -35,7 +44,7 @@ cbor_item_t *es256_pk_encode(const es256_pk_t *, int); | |||
35 | /* cbor decoding functions */ | 44 | /* cbor decoding functions */ |
36 | int cbor_decode_attstmt(const cbor_item_t *, fido_attstmt_t *); | 45 | int cbor_decode_attstmt(const cbor_item_t *, fido_attstmt_t *); |
37 | int cbor_decode_cred_authdata(const cbor_item_t *, int, fido_blob_t *, | 46 | int cbor_decode_cred_authdata(const cbor_item_t *, int, fido_blob_t *, |
38 | fido_authdata_t *, fido_attcred_t *, int *); | 47 | fido_authdata_t *, fido_attcred_t *, fido_cred_ext_t *); |
39 | int cbor_decode_assert_authdata(const cbor_item_t *, fido_blob_t *, | 48 | int cbor_decode_assert_authdata(const cbor_item_t *, fido_blob_t *, |
40 | fido_authdata_t *, int *, fido_blob_t *); | 49 | fido_authdata_t *, int *, fido_blob_t *); |
41 | int cbor_decode_cred_id(const cbor_item_t *, fido_blob_t *); | 50 | int cbor_decode_cred_id(const cbor_item_t *, fido_blob_t *); |
@@ -77,8 +86,8 @@ int fido_buf_write(unsigned char **, size_t *, const void *, size_t); | |||
77 | /* hid i/o */ | 86 | /* hid i/o */ |
78 | void *fido_hid_open(const char *); | 87 | void *fido_hid_open(const char *); |
79 | void fido_hid_close(void *); | 88 | void fido_hid_close(void *); |
80 | int fido_hid_read(void *, unsigned char *, size_t, int); | 89 | int fido_hid_read(void *, unsigned char *, size_t, int); |
81 | int fido_hid_write(void *, const unsigned char *, size_t); | 90 | int fido_hid_write(void *, const unsigned char *, size_t); |
82 | 91 | ||
83 | /* generic i/o */ | 92 | /* generic i/o */ |
84 | int fido_rx_cbor_status(fido_dev_t *, int); | 93 | int fido_rx_cbor_status(fido_dev_t *, int); |
@@ -109,6 +118,7 @@ int u2f_authenticate(fido_dev_t *, fido_assert_t *, int); | |||
109 | 118 | ||
110 | /* unexposed fido ops */ | 119 | /* unexposed fido ops */ |
111 | int fido_dev_authkey(fido_dev_t *, es256_pk_t *); | 120 | int fido_dev_authkey(fido_dev_t *, es256_pk_t *); |
121 | int fido_dev_get_cbor_info_wait(fido_dev_t *, fido_cbor_info_t *, int); | ||
112 | int fido_dev_get_pin_token(fido_dev_t *, const char *, const fido_blob_t *, | 122 | int fido_dev_get_pin_token(fido_dev_t *, const char *, const fido_blob_t *, |
113 | const es256_pk_t *, fido_blob_t *); | 123 | const es256_pk_t *, fido_blob_t *); |
114 | int fido_do_ecdh(fido_dev_t *, es256_pk_t **, fido_blob_t **); | 124 | int fido_do_ecdh(fido_dev_t *, es256_pk_t **, fido_blob_t **); |
@@ -128,5 +138,19 @@ int fido_verify_sig_rs256(const fido_blob_t *, const rs256_pk_t *, | |||
128 | const fido_blob_t *); | 138 | const fido_blob_t *); |
129 | int fido_verify_sig_eddsa(const fido_blob_t *, const eddsa_pk_t *, | 139 | int fido_verify_sig_eddsa(const fido_blob_t *, const eddsa_pk_t *, |
130 | const fido_blob_t *); | 140 | const fido_blob_t *); |
141 | int fido_get_signed_hash(int, fido_blob_t *, const fido_blob_t *, | ||
142 | const fido_blob_t *); | ||
143 | |||
144 | /* hid device manifest */ | ||
145 | int fido_hid_manifest(fido_dev_info_t *, size_t, size_t *); | ||
146 | |||
147 | /* device manifest registration */ | ||
148 | typedef int (*dev_manifest_func_t)(fido_dev_info_t *, size_t, size_t *); | ||
149 | int fido_dev_register_manifest_func(const dev_manifest_func_t); | ||
150 | void fido_dev_unregister_manifest_func(const dev_manifest_func_t); | ||
151 | |||
152 | #ifdef __cplusplus | ||
153 | } /* extern "C" */ | ||
154 | #endif /* __cplusplus */ | ||
131 | 155 | ||
132 | #endif /* !_EXTERN_H */ | 156 | #endif /* !_EXTERN_H */ |