Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
celllframe-node
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Code
Merge requests
0
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
Dmitry Puzyrkov
celllframe-node
Commits
f6316111
Commit
f6316111
authored
4 years ago
by
Roman Khlopkov
🔜
Browse files
Options
Downloads
Patches
Plain Diff
[+] Metadata read & tool
parent
5f76340a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cellframe-sdk
+1
-1
1 addition, 1 deletion
cellframe-sdk
sources/main_node_tool.c
+23
-5
23 additions, 5 deletions
sources/main_node_tool.c
with
24 additions
and
6 deletions
cellframe-sdk
@
ca871a2b
Compare
c7d8dc24
...
ca871a2b
Subproject commit c
7d8dc243f489bdd3e95df9f45c41f89a1f7df7c
Subproject commit c
a871a2bf1a314d0672cd11a0d8e6e3e3eec3d62
This diff is collapsed.
Click to expand it.
sources/main_node_tool.c
+
23
−
5
View file @
f6316111
...
...
@@ -283,13 +283,11 @@ int main(int argc, const char **argv)
exit
(
-
7021
);
}
}
}
else
if
(
strcmp
(
argv
[
2
],
"create"
)
==
0
)
{
}
else
if
(
strcmp
(
argv
[
2
],
"create"
)
==
0
)
{
if
(
argc
<
5
)
{
s_help
();
exit
(
-
500
);
}
size_t
l_key_length
=
0
;
const
char
*
l_cert_name
=
argv
[
3
];
size_t
l_cert_path_length
=
strlen
(
argv
[
3
])
+
8
+
strlen
(
s_system_ca_dir
);
char
*
l_cert_path
=
DAP_NEW_Z_SIZE
(
char
,
l_cert_path_length
);
...
...
@@ -316,7 +314,6 @@ int main(int argc, const char **argv)
}
if
(
l_key_type
!=
DAP_ENC_KEY_TYPE_NULL
)
{
int
l_key_length
=
argc
>=
6
?
atoi
(
argv
[
5
])
:
0
;
dap_cert_t
*
l_cert
=
dap_cert_generate
(
l_cert_name
,
l_cert_path
,
l_key_type
);
// key length ignored!
if
(
l_cert
==
NULL
){
log_it
(
L_ERROR
,
"Can't create %s"
,
l_cert_path
);
...
...
@@ -328,7 +325,28 @@ int main(int argc, const char **argv)
exit
(
-
500
);
}
DAP_DELETE
(
l_cert_path
);
}
else
if
(
strcmp
(
argv
[
2
],
"add_meta"
)
==
0
)
{
if
(
argc
>=
5
)
{
const
char
*
l_cert_name
=
argv
[
3
];
dap_cert_t
*
l_cert
=
dap_cert_add_file
(
l_cert_name
,
s_system_ca_dir
);
if
(
l_cert
)
{
char
**
l_params
=
dap_strsplit
(
argv
[
3
],
":"
,
4
);
dap_cert_metadata_type_t
l_type
=
(
dap_cert_metadata_type_t
)
atoi
(
l_params
[
1
]);
if
(
l_type
==
DAP_CERT_META_STRING
||
l_type
==
DAP_CERT_META_SIGN
||
l_type
==
DAP_CERT_META_CUSTOM
)
{
dap_cert_add_meta
(
l_cert
,
l_params
[
0
],
l_type
,
(
void
*
)
l_params
[
3
],
strtoul
(
l_params
[
2
],
NULL
,
10
));
}
else
{
dap_cert_add_meta_scalar
(
l_cert
,
l_params
[
0
],
l_type
,
strtoull
(
l_params
[
3
],
NULL
,
10
),
strtoul
(
l_params
[
2
],
NULL
,
10
));
}
dap_strfreev
(
l_params
);
dap_cert_save_to_folder
(
l_cert
,
s_system_ca_dir
);
dap_cert_delete_by_name
(
l_cert_name
);
ret
=
0
;
}
else
{
exit
(
-
800
);
}
}
}
else
{
log_it
(
L_ERROR
,
"Wrong params"
);
s_help
();
...
...
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