CDC Badge OS
Firmware for the CDC Badge v1.0 hardware security key
Loading...
Searching...
No Matches
pin_storage_c.h
Go to the documentation of this file.
1#pragma once
2
3#include <stdbool.h>
4#include <stddef.h>
5#include <stdint.h>
6
7#ifdef __cplusplus
8extern "C" {
9#endif
10
11/* OpenPGP password management (PW1/PW3). */
13bool pin_storage_openpgp_verify_pw1(const char *pin);
14bool pin_storage_openpgp_verify_pw3(const char *pin);
15bool pin_storage_openpgp_change_pw1(const char *new_pin);
16bool pin_storage_openpgp_change_pw3(const char *new_pin);
17
18/* OpenPGP KDF-DO path: PW1/PW3 references are host-supplied pre-hashes. */
19bool pin_storage_openpgp_verify_pw1_raw(const uint8_t *data, size_t len);
20bool pin_storage_openpgp_verify_pw3_raw(const uint8_t *data, size_t len);
21bool pin_storage_openpgp_set_pw1_raw(const uint8_t *data, size_t len);
22bool pin_storage_openpgp_set_pw3_raw(const uint8_t *data, size_t len);
30
31/* Badge PIN status (shared between modules). */
32bool pin_storage_is_set(void);
33
34/* FIDO2 ClientPIN support backed by the badge PIN hash. */
36bool pin_storage_get_fido2_hash(uint8_t* hash_out);
37bool pin_storage_verify_fido2_hash(const uint8_t* hash_in);
38
39/* CTAP2 setMinPINLength policy floor applied to the badge PIN. */
40void pin_storage_set_min_pin_floor(uint8_t min_len);
42
43#ifdef __cplusplus
44}
45#endif
uint8_t pin_storage_openpgp_pw1_retries(void)
bool pin_storage_verify_fido2_hash(const uint8_t *hash_in)
bool pin_storage_openpgp_reset(void)
void pin_storage_openpgp_reset_pw1_retries(void)
bool pin_storage_fido2_available(void)
bool pin_storage_is_set(void)
bool pin_storage_openpgp_pw1_blocked(void)
uint8_t pin_storage_get_min_pin_floor(void)
bool pin_storage_openpgp_set_pw1_raw(const uint8_t *data, size_t len)
bool pin_storage_openpgp_verify_pw3_raw(const uint8_t *data, size_t len)
bool pin_storage_openpgp_change_pw3(const char *new_pin)
void pin_storage_set_min_pin_floor(uint8_t min_len)
uint8_t pin_storage_openpgp_pw3_retries(void)
bool pin_storage_openpgp_verify_pw1_raw(const uint8_t *data, size_t len)
bool pin_storage_openpgp_verify_pw1(const char *pin)
void pin_storage_openpgp_init(void)
bool pin_storage_openpgp_set_pw3_raw(const uint8_t *data, size_t len)
bool pin_storage_get_fido2_hash(uint8_t *hash_out)
bool pin_storage_openpgp_verify_pw3(const char *pin)
bool pin_storage_openpgp_change_pw1(const char *new_pin)
bool pin_storage_openpgp_pw3_blocked(void)
void pin_storage_openpgp_reset_pw3_retries(void)