Virgil IoT KIT
trust_list.h
Go to the documentation of this file.
1 // Copyright (C) 2015-2020 Virgil Security, Inc.
2 //
3 // All rights reserved.
4 //
5 // Redistribution and use in source and binary forms, with or without
6 // modification, are permitted provided that the following conditions are
7 // met:
8 //
9 // (1) Redistributions of source code must retain the above copyright
10 // notice, this list of conditions and the following disclaimer.
11 //
12 // (2) Redistributions in binary form must reproduce the above copyright
13 // notice, this list of conditions and the following disclaimer in
14 // the documentation and/or other materials provided with the
15 // distribution.
16 //
17 // (3) Neither the name of the copyright holder nor the names of its
18 // contributors may be used to endorse or promote products derived from
19 // this software without specific prior written permission.
20 //
21 // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR
22 // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
23 // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24 // DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
25 // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
26 // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27 // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
29 // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
30 // IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31 // POSSIBILITY OF SUCH DAMAGE.
32 //
33 // Lead Maintainer: Virgil Security Inc. <support@virgilsecurity.com>
34 
112 #ifndef TRUST_LIST_H
113 #define TRUST_LIST_H
114 
115 #include <stdint.h>
116 #include <stdbool.h>
122 
123 #ifdef __cplusplus
124 namespace VirgilIoTKit {
125 extern "C" {
126 #endif
127 
141 
151 vs_tl_deinit(void);
152 
164 vs_tl_save_part(vs_tl_element_info_t *element_info, const uint8_t *in_data, uint16_t data_sz);
165 
178 vs_tl_load_part(vs_tl_element_info_t *element_info, uint8_t *out_data, uint16_t buf_sz, uint16_t *out_sz);
179 
187 vs_tl_update_ctx(void);
188 
195 const vs_update_file_type_t *
197 
205 void
206 vs_tl_header_to_host(const vs_tl_header_t *src_data, vs_tl_header_t *dst_data);
207 
215 void
216 vs_tl_header_to_net(const vs_tl_header_t *src_data, vs_tl_header_t *dst_data);
217 
218 #ifdef __cplusplus
219 } // extern "C"
220 } // namespace VirgilIoTKit
221 #endif
222 
223 #endif // TRUST_LIST_H
vs_update_file_type_t
File type information.
Definition: update.h:70
vs_secmodule_impl_t
Security Module implementation.
Definition: secmodule.h:458
vs_tl_deinit
vs_status_e vs_tl_deinit(void)
Trust List destruction.
vs_status_e
vs_status_e
Status code.
Definition: status_code.h:77
vs_tl_init
vs_status_e vs_tl_init(vs_storage_op_ctx_t *op_ctx, vs_secmodule_impl_t *secmodule, vs_file_ver_info_cb_t ver_info_cb)
Trust List initialization.
tl_structs.h
Trust List structures.
vs_tl_update_ctx
vs_update_interface_t * vs_tl_update_ctx(void)
Update interface for Trust List.
update.h
Update interface for files downloading.
vs_file_ver_info_cb_t
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_tl_header_to_net
void vs_tl_header_to_net(const vs_tl_header_t *src_data, vs_tl_header_t *dst_data)
Convert Trust List header to network.
status_code.h
Status codes and macroses.
vs_tl_update_file_type
const vs_update_file_type_t * vs_tl_update_file_type(void)
Trust List file type.
vs_tl_header_t
Trust List header.
Definition: tl_structs.h:62
vs_storage_op_ctx_t
Storage element context.
Definition: storage_hal.h:221
vs_tl_save_part
vs_status_e vs_tl_save_part(vs_tl_element_info_t *element_info, const uint8_t *in_data, uint16_t data_sz)
Trust List element saving.
storage_hal.h
Storage HAL interface.
vs_update_interface_t
Update interface context.
Definition: update.h:284
vs_tl_header_to_host
void vs_tl_header_to_host(const vs_tl_header_t *src_data, vs_tl_header_t *dst_data)
Convert Trust List header to host.
secmodule.h
Security Module implementations signatures.
vs_tl_load_part
vs_status_e vs_tl_load_part(vs_tl_element_info_t *element_info, uint8_t *out_data, uint16_t buf_sz, uint16_t *out_sz)
Trust List element loading.