Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
celllframe-node
Manage
Activity
Members
Labels
Plan
Issues
5
Issue boards
Milestones
Code
Merge requests
17
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
celllframe-node
Commits
6b6a6b46
Commit
6b6a6b46
authored
3 years ago
by
Dmitriy Naidolinskiy
Committed by
Roman Khlopkov
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Feature 5173
parent
22279d81
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!459
Release 5.1
,
!275
Feature 5173
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
cellframe-sdk
+1
-1
1 addition, 1 deletion
cellframe-sdk
python-cellframe
+1
-1
1 addition, 1 deletion
python-cellframe
sources/main_node_tool.c
+21
-22
21 additions, 22 deletions
sources/main_node_tool.c
with
23 additions
and
24 deletions
cellframe-sdk
@
8cdb1a3c
Compare
828a6b42
...
8cdb1a3c
Subproject commit 8
28a6b42ed4ec9f6cfdf33a01cf6c6bc573ed03b
Subproject commit 8
cdb1a3cc280386ef982943ed14fe266c11aad57
This diff is collapsed.
Click to expand it.
python-cellframe
@
37c95060
Compare
6a774f3a
...
37c95060
Subproject commit
6a774f3a8f73ff8bf5c29d802728799f7a616c48
Subproject commit
37c95060177e9d6822756ed9667c24f240a0208a
This diff is collapsed.
Click to expand it.
sources/main_node_tool.c
+
21
−
22
View file @
6b6a6b46
...
...
@@ -217,29 +217,26 @@ int main(int argc, const char **argv)
}*/
}
// wallet
else
if
(
strcmp
(
argv
[
1
],
"cert"
)
==
0
)
{
if
(
argc
==
3
)
{
if
(
strcmp
(
argv
[
2
],
"create_pkey_hash"
)
==
0
)
{
dap_config_t
*
l_config
=
dap_config_open
(
"network/private"
);
if
(
!
l_config
)
{
log_it
(
L_ERROR
,
"Not found a private config - private.cfg"
);
exit
(
-
111
);
}
uint16_t
ui_acl_list_len
;
dap_cert_t
*
l_cert
=
NULL
;
l_cert
=
dap_cert_find_by_name
(
dap_config_get_item_str
(
l_config
,
"general"
,
"auth_cert"
));
size_t
st_size
=
sizeof
(
dap_hash_fast_t
);
unsigned
char
*
l_data
=
DAP_NEW_Z_SIZE
(
unsigned
char
,
st_size
+
1
);
s_fill_hash_key_for_data
(
l_cert
->
enc_key
,
l_data
);
for
(
int
i
=
0
;
i
<
st_size
;
i
++
)
{
printf
(
"%02x"
,
l_data
[
i
]);
}
printf
(
"
\n
"
);
exit
(
0
);
}
}
if
(
argc
>=
3
)
{
if
(
argc
>=
5
)
{
if
(
strcmp
(
argv
[
2
],
"pkey"
)
==
0
&&
strcmp
(
argv
[
3
],
"show"
)
==
0
)
{
dap_cert_t
*
l_cert
=
dap_cert_find_by_name
(
argv
[
4
]);
if
(
!
l_cert
)
{
printf
(
"Not found cert: %s
\n
"
,
argv
[
4
]);
exit
(
-
134
);
}
size_t
l_buf_len
;
uint8_t
*
l_pub_enc_key
=
dap_enc_key_serealize_pub_key
(
l_cert
->
enc_key
,
&
l_buf_len
);
dap_hash_fast_t
l_hash
;
dap_hash_fast
(
l_pub_enc_key
,
l_buf_len
,
&
l_hash
);
char
*
l_hash_str
=
dap_chain_hash_fast_to_str_new
(
&
l_hash
);
printf
(
"%s
\n
"
,
l_hash_str
);
exit
(
0
);
}
}
if
(
strcmp
(
argv
[
2
],
"dump"
)
==
0
){
if
(
argc
>=
4
)
{
const
char
*
l_cert_name
=
argv
[
3
];
...
...
@@ -586,4 +583,6 @@ static void s_help()
printf
(
" * Add metadata item to <cert name>
\n
"
);
printf
(
"
\t
%s cert add_metadata <cert name> <key:type:length:value>
\n\n
"
,
dap_get_appname
());
printf
(
" * Print hash of cert <cert name>
\n
"
);
printf
(
"
\t
%s cert pkey show <cert name>
\n\n
"
,
dap_get_appname
());
}
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