Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cellframe-sdk
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Code
Merge requests
16
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cellframe
cellframe-sdk
Commits
34080aa4
Commit
34080aa4
authored
3 years ago
by
Dmitriy Gerasimov
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of
https://gitlab.demlabs.net/cellframe/cellframe-sdk
parents
4deea1d3
f48f8419
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#8105
passed with stage
Stage: analyze
in 3 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dap-sdk/crypto/src/dap_cert_file.c
+37
-8
37 additions, 8 deletions
dap-sdk/crypto/src/dap_cert_file.c
with
37 additions
and
8 deletions
dap-sdk/crypto/src/dap_cert_file.c
+
37
−
8
View file @
34080aa4
...
...
@@ -39,8 +39,9 @@ static const char s_key_inheritor[] = "Inheritor";
* @brief dap_cert_file_save
* @param a_cert
* @param a_cert_file_path
* @return
* @return
int
*/
int
dap_cert_file_save
(
dap_cert_t
*
a_cert
,
const
char
*
a_cert_file_path
)
{
char
*
l_file_dir
=
dap_path_get_dirname
(
a_cert_file_path
);
...
...
@@ -72,6 +73,15 @@ int dap_cert_file_save(dap_cert_t * a_cert, const char * a_cert_file_path)
}
// balance the binary tree
/**
* @brief s_balance_the_tree
*
* @param a_reorder
* @param a_left_idx
* @param a_right_idx
*/
void
s_balance_the_tree
(
dap_cert_file_aux_t
*
a_reorder
,
size_t
a_left_idx
,
size_t
a_right_idx
)
{
if
(
a_left_idx
==
a_right_idx
)
{
...
...
@@ -86,6 +96,14 @@ void s_balance_the_tree(dap_cert_file_aux_t *a_reorder, size_t a_left_idx, size_
}
}
/**
* @brief dap_cert_deserialize_meta
*
* @param a_cert
* @param a_data
* @param a_size
*/
void
dap_cert_deserialize_meta
(
dap_cert_t
*
a_cert
,
const
uint8_t
*
a_data
,
size_t
a_size
)
{
dap_cert_metadata_t
**
l_meta_arr
=
NULL
;
...
...
@@ -152,6 +170,14 @@ void dap_cert_deserialize_meta(dap_cert_t *a_cert, const uint8_t *a_data, size_t
DAP_DELETE
(
l_meta_arr
);
}
/**
* @brief dap_cert_serialize_meta
*
* @param a_cert
* @param a_buflen_out
* @return uint8_t*
*/
uint8_t
*
dap_cert_serialize_meta
(
dap_cert_t
*
a_cert
,
size_t
*
a_buflen_out
)
{
if
(
!
a_cert
)
{
...
...
@@ -218,11 +244,12 @@ uint8_t *dap_cert_serialize_meta(dap_cert_t *a_cert, size_t *a_buflen_out)
}
/**
* @brief dap_cert_
file
_save
_to_mem
* @brief dap_cert_
mem
_save
* @param a_cert
* @param a_cert_size_out
* @return
* @return
uint8_t*
*/
uint8_t
*
dap_cert_mem_save
(
dap_cert_t
*
a_cert
,
uint32_t
*
a_cert_size_out
)
{
dap_cert_file_hdr_t
l_hdr
=
{
0
};
...
...
@@ -306,8 +333,8 @@ lb_exit:
/**
* @brief dap_cert_file_load
* @param a_cert_file_path
* @return
* @param a_cert_file_path
: path to certificate, for example "{PREFIX}/var/lib/ca/node-addr.dcert"
* @return
dap_cert_t
*/
dap_cert_t
*
dap_cert_file_load
(
const
char
*
a_cert_file_path
)
...
...
@@ -338,10 +365,12 @@ lb_exit:
/**
* @brief dap_cert_mem_load
* @param a_data
* @param a_data_size
* @return
*
* @param a_data - pointer to buffer with certificate, early loaded from filesystem
* @param a_data_size - size of certificate
* @return dap_cert_t*
*/
dap_cert_t
*
dap_cert_mem_load
(
const
void
*
a_data
,
size_t
a_data_size
)
{
dap_cert_t
*
l_ret
=
NULL
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment