FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
SecureGen/include/device_static_key.h at master · makepkg/SecureGen · GitHub
makepkg
/
SecureGen
Public
Uh oh!
There was an error while loading.
Please reload this page
.
Notifications
You must be signed in to change notification settings
Fork
14
Star
91
Code
Issues
2
Pull requests
0
Discussions
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
SecureGen
/
include
/
device_static_key.h
Copy path
More file actions
More file actions
Latest commit
History
History
History
60 lines (47 loc) · 1.99 KB
Breadcrumbs
SecureGen
/
include
/
device_static_key.h
Copy path
File metadata and controls
60 lines (47 loc) · 1.99 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#
ifndef
DEVICE_STATIC_KEY_H
#
define
DEVICE_STATIC_KEY_H
#
include
<
Arduino.h
>
#
include
"
crypto_manager.h
"
#
include
"
log_manager.h
"
/*
*
* @brief DeviceStaticKey - Генерация уникального статичного ключа на основе ESP32 hardware
*
* Используется для защиты ECDH handshake через Password-Based Key Wrapping.
* Ключ генерируется из уникальных характеристик ESP32 чипа и остается постоянным
* для конкретного устройства на протяжении всего жизненного цикла.
*/
class
DeviceStaticKey
{
public:
static
DeviceStaticKey&
getInstance
();
//
Инициализация и генерация device key
bool
begin
();
//
Получение device static key (Base64 encoded SHA256 hash)
String
getDeviceStaticKey
();
//
Проверка валидности device key
bool
isKeyInitialized
()
const
;
//
Принудительная регенерация ключа (только для отладки)
void
regenerateKey
();
//
Получение отладочной информации о hardware
String
getHardwareInfo
();
private:
DeviceStaticKey
();
~DeviceStaticKey
();
DeviceStaticKey
(
const
DeviceStaticKey&) =
delete
;
DeviceStaticKey&
operator
=(
const
DeviceStaticKey&) =
delete
;
//
Генерация device-specific ключа
String
generateDeviceStaticKey
();
//
Сбор ESP32 hardware identifiers
void
collectHardwareIdentifiers
(
uint8_t
* buffer,
size_t
bufferSize);
//
Внутреннее состояние
String deviceStaticKey;
bool
keyInitialized;
//
Hardware info для отладки
struct
HardwareInfo
{
uint64_t
chipId;
uint32_t
flashId;
uint32_t
chipRevision;
String chipModel;
uint32_t
flashSize;
} hardwareInfo;
};
#
endif
//
DEVICE_STATIC_KEY_H
Back
|
FazBrowse Home
|
New Git URL