Libu2f-emu
0.0.0
Universal 2nd Factor (U2F) Emulation C Library
|
#include <fcntl.h>
#include <stdlib.h>
#include <stdio.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include "counter.h"
#include "utils.h"
Functions | |
static void | counter_increment (struct u2f_emu_vdev_counter *vdev_counter) |
Increment the counter of an U2F virtual device. More... | |
static uint32_t | counter_read (struct u2f_emu_vdev_counter *vdev_counter) |
Read the counter value of an U2F virtual device. More... | |
bool | counter_new_from_dir (const char *pathname, struct u2f_emu_vdev_counter **vdev_counter_ref) |
Create a new counter that sync with the counter file inside the setup directory. More... | |
bool | counter_new_epthemeral (struct u2f_emu_vdev_counter **vdev_counter_ref) |
Create a new ephemeral counter. More... | |
void | counter_free (struct u2f_emu_vdev_counter *vdev_counter) |
Release the ressources used by the counter. More... | |
void counter_free | ( | struct u2f_emu_vdev_counter * | vdev_counter | ) |
Release the ressources used by the counter.
vdev_counter | The virtual device counter to release. |
|
static |
Increment the counter of an U2F virtual device.
vdev_counter | The virtual device counter to increment. |
bool counter_new_epthemeral | ( | struct u2f_emu_vdev_counter ** | counter_ref | ) |
Create a new ephemeral counter.
counter_ref | The reference to the counter to create. |
bool counter_new_from_dir | ( | const char * | pathname, |
struct u2f_emu_vdev_counter ** | counter_ref | ||
) |
Create a new counter that sync with the counter file inside the setup directory.
pathname | The pathname of the setup directory. |
counter_ref | The reference to the counter to create. |
|
static |
Read the counter value of an U2F virtual device.
vdev_counter | The virtual device counter to read. |