Libu2f-emu
0.0.0
Universal 2nd Factor (U2F) Emulation C Library
|
Macros | |
#define | U2F_CHA_PARAM_SIZE 32 |
#define | U2F_APP_PARAM_SIZE 32 |
Functions | |
struct registration_params | __attribute__ ((__packed__)) |
static void | register_response_reserved (struct payload *payload) |
Add reserved byte to the register response payload. More... | |
static void | register_response_pubkey (struct payload *payload, const EC_KEY *pubkey) |
Add pubkey bytes to the register response. More... | |
static void | register_response_key_handle (struct payload *payload, const uint8_t *key_handle_cipher, size_t key_handle_cipher_size) |
Add ciphered key handle to the register response payload. More... | |
static void | register_reponse_x509 (struct payload *payload, const uint8_t *x509_buffer, size_t x509_buffer_size) |
Add x509 bytes to the register response payload. More... | |
static void | register_response_signature (struct crypto_core *crypto_core, struct payload *payload, const uint8_t *key_handle_cipher, size_t key_handle_cipher_size, const EC_KEY *pubkey, const struct registration_params *params) |
Add signature to the register response. More... | |
static void | register_response_sw (struct payload *payload, uint32_t status) |
Add status code to the authentification response payload. More... | |
static uint8_t * | register_build_plain_key_handle (EC_KEY *privkey, const struct registration_params *params, size_t *size) |
Build the plain key handle. More... | |
static uint8_t * | register_encrypt_key_handle (struct crypto_core *crypto_core, const uint8_t *key_handle, size_t key_handle_size, size_t *size) |
Encrypt the key handle. More... | |
struct payload * | raw_register (u2f_emu_vdev *vdev, const uint8_t *apdu, size_t size) |
Handle registration request. More... | |
Variables | |
uint8_t | challenge_param [32] |
uint8_t | application_param [32] |
#define U2F_APP_PARAM_SIZE 32 |
#define U2F_CHA_PARAM_SIZE 32 |
struct registration_params __attribute__ | ( | (__packed__) | ) |
struct payload* raw_register | ( | u2f_emu_vdev * | vdev, |
const uint8_t * | apdu, | ||
size_t | size | ||
) |
Handle registration request.
vdev | The virtual device. |
apdu | The apdu data. |
size | The apdu data size. |
|
static |
Build the plain key handle.
privkey | The private key. |
params | The register params. |
size | The ref size of the plain key handle. |
|
static |
Encrypt the key handle.
crypto_core | The crypto core. |
key_handle | The key handle. |
key_handle_size | The key handle size. |
size | The ref size of the ciphered key handle. |
|
static |
Add x509 bytes to the register response payload.
payload | The response payload. |
x509_buffer | The x509 buffer. |
x509_buffer_size | The x509 buffer size. |
|
static |
Add ciphered key handle to the register response payload.
payload | The response payload. |
key_handle_cipher | The ciphered key handle |
key_handle_cipher_size | The ciphered key handle size |
|
static |
Add pubkey bytes to the register response.
payload | The response payload. |
pubkey | The pubkey. |
|
static |
Add reserved byte to the register response payload.
payload | The response payload. |
|
static |
Add signature to the register response.
crypto_core | The crypto core. |
payload | The response payload. |
key_handle_cipher | The ciphered key handle. |
key_handle_cipher_size | The ciphered key handle size. |
pubkey | The pubkey. |
params | The register params. |
|
static |
Add status code to the authentification response payload.
payload | The response payload. |
status | The status code. |
uint8_t application_param[32] |
SHA-256 App Id
uint8_t challenge_param[32] |
SHA-256 client data