CDC Badge OS
Firmware for the CDC Badge v1.0 hardware security key
Loading...
Searching...
No Matches
pin_storage_c.cpp
Go to the documentation of this file.
1
5
8
9extern "C" {
10
14
15bool pin_storage_openpgp_verify_pw1(const char *pin) {
17}
18
19bool pin_storage_openpgp_verify_pw3(const char *pin) {
21}
22
23bool pin_storage_openpgp_change_pw1(const char *new_pin) {
25}
26
27bool pin_storage_openpgp_change_pw3(const char *new_pin) {
29}
30
34
38
42
46
50
54
57 bool ok1 = pm.setPW1(cdc::core::PinManager::DEFAULT_PW1);
58 bool ok3 = pm.setPW3(cdc::core::PinManager::DEFAULT_PW3);
59 pm.resetPW1Retries();
60 pm.resetPW3Retries();
61 return ok1 && ok3;
62}
63
66 pm.init();
67 return pm.isPinSet();
68}
69
72 pm.init();
74 return pm.getBadgePinHash(hash);
75}
76
77bool pin_storage_get_fido2_hash(uint8_t* hash_out) {
79 pm.init();
80 return pm.getBadgePinHash(hash_out);
81}
82
83bool pin_storage_verify_fido2_hash(const uint8_t* hash_in) {
85 pm.init();
86 return pm.verifyBadgePinHash(hash_in);
87}
88
89} // extern "C"
bool verifyPW1(const char *pin)
OpenPGP PW1 (user PIN) workflow.
void resetPW1Retries()
Resets PW1 retry counter to maximum.
bool setPW3(const char *newPin)
Sets PW3 directly and refreshes salt/hash material.
uint8_t getPW1Retries() const
Definition PinManager.h:111
static constexpr uint8_t BADGE_HASH_SIZE
Definition PinManager.h:64
static constexpr const char * DEFAULT_PW1
Definition PinManager.h:75
void resetPW3Retries()
Resets PW3 retry counter to maximum.
static constexpr const char * DEFAULT_PW3
Definition PinManager.h:76
bool isPW1Blocked() const
Definition PinManager.h:112
uint8_t getPW3Retries() const
Definition PinManager.h:121
static PinManager & instance()
Returns singleton PIN manager instance.
bool isPW3Blocked() const
Definition PinManager.h:122
bool setPW1(const char *newPin)
Sets PW1 directly and refreshes salt/hash material.
bool init()
Initializes PIN state from secure storage or defaults.
bool verifyPW3(const char *pin)
OpenPGP PW3 (admin PIN) workflow.
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)
bool pin_storage_openpgp_change_pw3(const char *new_pin)
uint8_t pin_storage_openpgp_pw3_retries(void)
bool pin_storage_openpgp_verify_pw1(const char *pin)
void pin_storage_openpgp_init(void)
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)