CDC Badge OS
Firmware for the CDC Badge v1.0 hardware security key
Loading...
Searching...
No Matches
FactoryReset.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <cstdint>
4
#include "esp_err.h"
5
#include "
cdc_hal/ISecureElement.h
"
6
7
namespace
cdc::core
{
8
13
inline
constexpr
const
char
*
kBootProfileNs
=
"boot_profile"
;
14
inline
constexpr
const
char
*
kBootProfileKey
=
"profile"
;
15
16
struct
TropicWipeResult
{
17
uint16_t
eccDeleted
= 0;
18
uint16_t
rmemDeleted
= 0;
19
bool
sessionReady
=
false
;
20
};
21
35
TropicWipeResult
wipeTropic
(
hal::ISecureElement
* se,
36
uint16_t progressEvery = 0,
37
void
(*onRmemProgress)(uint16_t current, uint16_t total) =
nullptr
);
38
43
esp_err_t
wipeNvs
();
44
53
[[noreturn]]
void
selfDestruct
();
54
55
}
// namespace cdc::core
ISecureElement.h
cdc::hal::ISecureElement
Definition
ISecureElement.h:58
cdc::core
Definition
AttestationKeyService.h:7
cdc::core::wipeNvs
esp_err_t wipeNvs()
Erases the NVS partition and re-initializes it blank.
Definition
FactoryReset.cpp:46
cdc::core::wipeTropic
TropicWipeResult wipeTropic(hal::ISecureElement *se, uint16_t progressEvery=0, void(*onRmemProgress)(uint16_t current, uint16_t total)=nullptr)
Iterates every TROPIC01 ECC slot (0..ECC_SLOT_COUNT-1) and R-Memory slot (0..RMEM_SLOT_COUNT-1),...
Definition
FactoryReset.cpp:11
cdc::core::selfDestruct
void selfDestruct()
Triggers a full factory wipe on the next boot and restarts.
Definition
FactoryReset.cpp:60
cdc::core::kBootProfileNs
constexpr const char * kBootProfileNs
Definition
FactoryReset.h:13
cdc::core::kBootProfileKey
constexpr const char * kBootProfileKey
Definition
FactoryReset.h:14
cdc::core::TropicWipeResult
Definition
FactoryReset.h:16
cdc::core::TropicWipeResult::eccDeleted
uint16_t eccDeleted
Definition
FactoryReset.h:17
cdc::core::TropicWipeResult::sessionReady
bool sessionReady
Definition
FactoryReset.h:19
cdc::core::TropicWipeResult::rmemDeleted
uint16_t rmemDeleted
Definition
FactoryReset.h:18
components
cdc_core
include
cdc_core
FactoryReset.h
Generated by
1.16.1