#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include "u2f-emu-types.h"
Go to the source code of this file.
|
const char * | u2f_emu_strerror (u2f_emu_rc rc) |
| Get the error description specific to a return code. More...
|
|
u2f_emu_rc | u2f_emu_vdev_new_from_dir (u2f_emu_vdev **vdev_ref, const char *pathname) |
| Instantiate a new U2F virtual emulated device from a setup dir. More...
|
|
u2f_emu_rc | u2f_emu_vdev_new_ephemeral (u2f_emu_vdev **vdev_ref) |
| Instantiate a new ephemeral U2F virtual emulated device. More...
|
|
u2f_emu_rc | u2f_emu_vdev_new (u2f_emu_vdev **vdev_ref, const struct u2f_emu_vdev_setup *info) |
| Instantiate a new U2F virtual emulated device. More...
|
|
u2f_emu_rc | u2f_emu_vdev_set_apdu (u2f_emu_vdev *vdev, u2f_emu_transport transport_type, u2f_emu_apdu apdu) |
| Set the apdu length of an U2F virtual emultated device on a transport. More...
|
|
void | u2f_emu_vdev_free (u2f_emu_vdev *vdev) |
| Free an U2F virtual emulated device. More...
|
|
u2f_emu_rc | u2f_emu_vdev_send (u2f_emu_vdev *vdev, u2f_emu_transport transport_type, const void *data, size_t size) |
| Ask an U2F virtual emulated device to process input data from a transport. More...
|
|
bool | u2f_emu_vdev_has_response (u2f_emu_vdev *vdev, u2f_emu_transport transport_type) |
| Check if an U2F virtual emulated device has response data on a transport to a previous processed data. More...
|
|
size_t | u2f_emu_vdev_get_response (u2f_emu_vdev *vdev, u2f_emu_transport transport_type, uint8_t **data) |
| Get a response from an U2F virtual emulated device on a transport. More...
|
|
void | u2f_emu_vdev_free_response (uint8_t *data) |
| Free a response from an U2F virtual emulated device. More...
|
|
Get the error description specific to a return code.
- Parameters
-
- Returns
- The respective error description.
Free an U2F virtual emulated device.
- Parameters
-
void u2f_emu_vdev_free_response |
( |
uint8_t * |
data | ) |
|
Free a response from an U2F virtual emulated device.
- Parameters
-
data | The data buffer of the response. |
Get a response from an U2F virtual emulated device on a transport.
- Parameters
-
vdev | The virtual device. |
transport_type | The associated transport. |
data | The data ref buffer to put the response. |
- Returns
- The size of the allocated data.
Check if an U2F virtual emulated device has response data on a transport to a previous processed data.
- Parameters
-
vdev | The virtual device. |
transport_type | The associated transport. |
- Returns
- Has response: true. Has not response: false.
Instantiate a new U2F virtual emulated device.
- Parameters
-
vdev_ref | The virtual device reference. |
info | The setup structure for device configuration. |
- Returns
- Success: U2F_EMU_OK. Failure: - memory allocation: U2F_EMU_MEMORY_ERROR.
- not supported: U2F_EMU_SUPPORTED_ERROR.
Instantiate a new ephemeral U2F virtual emulated device.
- Parameters
-
vdev_ref | The virtual device reference. |
- Returns
- Success: U2F_EMU_OK. Failure: - memory allocation: U2F_EMU_MEMORY_ERROR.
- not supported: U2F_EMU_SUPPORTED_ERROR.
Instantiate a new U2F virtual emulated device from a setup dir.
- Parameters
-
vdev_ref | The virtual device reference. |
pathname | The pathname of the setup dir for the device configuration. |
- Returns
- Success: U2F_EMU_OK. Failure: - memory allocation: U2F_EMU_MEMORY_ERROR.
- not supported: U2F_EMU_SUPPORTED_ERROR.
Ask an U2F virtual emulated device to process input data from a transport.
- Parameters
-
vdev | The virtual device. |
transport_type | The associated transport. |
data | The input data to process. |
size | The size of the input data in bytes. |
- Returns
- Success: U2F_EMU_OK. Failure: - transport does not exist, or is not implemented: U2F_EMU_SUPPORTED_ERROR:.
Set the apdu length of an U2F virtual emultated device on a transport.
- Parameters
-
vdev | The virtual device. |
transport_type | The associated transport. |
apdu | The apdu length. |
- Returns
- Success: U2F_EMU_OK. Failure: not allowed: U2F_EMU_PERMISSION_ERROR