Go to the documentation of this file.
75 #ifndef VS_IOT_PROVISION_STRUCTS_H
76 #define VS_IOT_PROVISION_STRUCTS_H
79 #include <trust_list-config.h>
82 namespace VirgilIoTKit {
86 #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
87 #define HTONL_IN_COMPILE_TIME(val) \
88 (uint32_t)(((uint32_t)val & 0xFF) << 24 | ((uint32_t)val & 0xFF00) << 8 | ((uint32_t)val & 0xFF0000) >> 8 | \
89 ((uint32_t)val & 0xFF000000) >> 24)
91 #define HTONL_IN_COMPILE_TIME(val) (val)
95 #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
96 #define HTONS_IN_COMPILE_TIME(val) (uint16_t)(((uint16_t)val & 0xFF) << 8 | ((uint16_t)val & 0xFF00) >> 8)
98 #define HTONS_IN_COMPILE_TIME(val) (val)
105 #define VS_START_EPOCH (1420070400)
108 #define VS_DEVICE_SERIAL_SIZE (32)
111 #define VS_DEVICE_MANUFACTURE_ID_SIZE (16)
114 #define VS_DEVICE_TYPE_SIZE (4)
136 #pragma GCC diagnostic push
137 #pragma GCC diagnostic ignored "-Wmultichar"
161 #pragma GCC diagnostic pop
192 typedef struct __attribute__((__packed__)) {
196 uint8_t raw_sign_pubkey[];
201 typedef struct __attribute__((__packed__)) {
205 uint8_t meta_and_pubkey[];
209 typedef struct __attribute__((__packed__)) {
216 typedef struct __attribute__((__packed__)) {
225 typedef struct __attribute__((__packed__)) {
263 #endif // VS_IOT_PROVISION_STRUCTS_H
uint8_t vs_device_manufacture_id_t[VS_DEVICE_MANUFACTURE_ID_SIZE]
Manufacture ID type.
Definition: provision-structs.h:120
@ VS_PRVS_SGNP
Signature of own public key (by private key VS_PRVS_PBDM)
Definition: provision-structs.h:145
@ VS_PRVS_PBF2
Set Firmware Key 2.
Definition: provision-structs.h:153
@ VS_PRVS_DNID
Discover Not Initialized Devices.
Definition: provision-structs.h:144
Public key with date information.
Definition: provision-structs.h:209
@ VS_PRVS_ASGN
Action SiGN data.
Definition: provision-structs.h:159
@ VS_PRVS_TLH
Set Trust List Header.
Definition: provision-structs.h:154
vs_key_type_e key_type
Definition: provision-structs.h:238
@ VS_PROVISION_PBT1
Definition: provision-structs.h:170
vs_file_ver_info_cb_t tl_ver_info_cb
Definition: provision-structs.h:255
vs_key_type_e
Key type.
Definition: provision-structs.h:177
vs_snap_prvs_element_e
Provision operations.
Definition: provision-structs.h:143
uint8_t ec_type
vs_secmodule_keypair_type_e
Definition: provision-structs.h:203
File information.
Definition: provision-structs.h:225
@ VS_KEY_FIRMWARE
Firmware key.
Definition: provision-structs.h:181
@ VS_PRVS_TLF
Set Trust List Footer.
Definition: provision-structs.h:156
@ VS_PROVISION_PBF1
Definition: provision-structs.h:172
@ VS_PRVS_PBR2
Set Recovery Key 2.
Definition: provision-structs.h:147
@ VS_PRVS_PBA2
Set Auth Key 2.
Definition: provision-structs.h:149
@ VS_PROVISION_PBR2
Definition: provision-structs.h:167
#define VS_DEVICE_MANUFACTURE_ID_SIZE
Manufacture ID size.
Definition: provision-structs.h:111
@ VS_PROVISION_SGNP
Definition: provision-structs.h:165
uint32_t expire_date
Expiration date.
Definition: provision-structs.h:211
#define VS_DEVICE_TYPE_SIZE
Device type size.
Definition: provision-structs.h:114
@ VS_PRVS_DEVI
Get DEVice Info.
Definition: provision-structs.h:157
@ VS_PRVS_PBF1
Set Firmware Key 1.
Definition: provision-structs.h:152
vs_prvs_t
PRVS SNAP service code.
Definition: provision-structs.h:140
@ VS_PRVS_PBT2
Set Trust List 2.
Definition: provision-structs.h:151
File version information.
Definition: provision-structs.h:216
vs_device_type_t device_type
Device type.
Definition: provision-structs.h:227
@ VS_KEY_FIRMWARE_INTERNAL
Firmware internal key.
Definition: provision-structs.h:185
uint8_t vs_device_type_t[VS_DEVICE_TYPE_SIZE]
Device type.
Definition: provision-structs.h:127
void(* vs_file_ver_info_cb_t)(vs_file_version_t ver)
Callback function to inform system about current version of file.
Definition: provision-structs.h:248
@ VS_KEY_RECOVERY
Recovery key.
Definition: provision-structs.h:178
@ VS_PRVS_PBA1
Set Auth Key 1.
Definition: provision-structs.h:148
uint8_t signer_type
vs_key_type_e
Definition: provision-structs.h:193
@ VS_KEY_IOT_DEVICE
Key of IoT device.
Definition: provision-structs.h:183
vs_pubkey_t pubkey
Public key.
Definition: provision-structs.h:212
@ VS_KEY_AUTH
Authentication key.
Definition: provision-structs.h:179
Status codes and macroses.
vs_file_version_t version
File version.
Definition: provision-structs.h:228
uint8_t ec_type
vs_secmodule_keypair_type_e
Definition: provision-structs.h:194
Find context.
Definition: provision-structs.h:236
uint8_t hash_type
vs_secmodule_hash_type_e
Definition: provision-structs.h:195
@ VS_PRVS_PBT1
Set Trust List Key 1.
Definition: provision-structs.h:150
@ VS_KEY_AUTH_INTERNAL
Authentication internal key.
Definition: provision-structs.h:186
@ VS_PRVS_PBR1
Set Recovery Key 1.
Definition: provision-structs.h:146
@ VS_PROVISION_PBA1
Definition: provision-structs.h:168
#define HTONL_IN_COMPILE_TIME(val)
Definition: provision-structs.h:87
uint8_t patch
Patch number.
Definition: provision-structs.h:219
@ VS_KEY_TRUSTLIST
Trust List key.
Definition: provision-structs.h:180
int last_pos
Definition: provision-structs.h:237
@ VS_KEY_CLOUD
Cloud key.
Definition: provision-structs.h:187
uint8_t key_type
vs_key_type_e
Definition: provision-structs.h:202
@ VS_PROVISION_PBT2
Definition: provision-structs.h:171
@ VS_PROVISION_PBA2
Definition: provision-structs.h:169
vs_device_manufacture_id_t manufacture_id
Manufacture ID.
Definition: provision-structs.h:226
@ VS_KEY_USER_DEVICE
Key ofr user device.
Definition: provision-structs.h:184
uint32_t start_date
Start date.
Definition: provision-structs.h:210
vs_provision_element_id_e
Element ID.
Definition: provision-structs.h:164
#define VS_TL_STORAGE_MAX_PART_SIZE
Maximum size of each part of TrustList.
Definition: config/pc/trust_list-config.h:58
uint32_t timestamp
The number of seconds since VS_START_EPOCH.
Definition: provision-structs.h:221
@ VS_KEY_UNSUPPORTED
Unsupported key.
Definition: provision-structs.h:188
@ VS_KEY_FACTORY
Factory key.
Definition: provision-structs.h:182
@ VS_PRVS_ASAV
Action SAVe provision.
Definition: provision-structs.h:158
Container of pointers to callback functions for Provision Events.
Definition: provision-structs.h:254
uint16_t meta_data_sz
Meta data size.
Definition: provision-structs.h:204
Public key type.
Definition: provision-structs.h:201
#define VS_DEVICE_SERIAL_SIZE
Device serial ID size.
Definition: provision-structs.h:108
uint8_t major
Major version number.
Definition: provision-structs.h:217
@ VS_PROVISION_PBR1
Definition: provision-structs.h:166
Signature type.
Definition: provision-structs.h:192
@ VS_PROVISION_PBF2
Definition: provision-structs.h:173
@ VS_PRVS_SERVICE_ID
Definition: provision-structs.h:140
uint32_t build
Build number.
Definition: provision-structs.h:220
uint8_t vs_device_serial_t[VS_DEVICE_SERIAL_SIZE]
Device serial number type.
Definition: provision-structs.h:134
uint8_t minor
Minor version number.
Definition: provision-structs.h:218
@ VS_PRVS_TLC
Set Trust List Chunk.
Definition: provision-structs.h:155