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
20
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
042a9722
Commit
042a9722
authored
2 years ago
by
daniil.frolov
Committed by
Roman Khlopkov
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
hotfix-8340
parent
60d2aec4
No related branches found
No related tags found
1 merge request
!1044
hotfix-8340
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/common/dap_chain_datum.c
+2
-4
2 additions, 4 deletions
modules/common/dap_chain_datum.c
modules/common/dap_chain_datum_token.c
+16
-4
16 additions, 4 deletions
modules/common/dap_chain_datum_token.c
with
18 additions
and
8 deletions
modules/common/dap_chain_datum.c
+
2
−
4
View file @
042a9722
...
@@ -677,10 +677,8 @@ void dap_chain_datum_dump(dap_string_t *a_str_out, dap_chain_datum_t *a_datum, c
...
@@ -677,10 +677,8 @@ void dap_chain_datum_dump(dap_string_t *a_str_out, dap_chain_datum_t *a_datum, c
dap_string_append_printf
(
a_str_out
,
" Skip incorrect or illformed DATUM"
);
dap_string_append_printf
(
a_str_out
,
" Skip incorrect or illformed DATUM"
);
break
;
break
;
}
}
dap_chain_datum_token_certs_dump
(
a_str_out
,
l_emission
->
tsd_n_signs
+
l_emission
->
data
.
type_auth
.
tsd_total_size
,
l_emission
->
data
.
type_auth
.
size
-
l_emission
->
data
.
type_auth
.
tsd_total_size
,
a_hash_out_type
);
//dap_chain_datum_token_certs_dump(a_str_out, l_emission->tsd_n_signs + l_emission->data.type_auth.tsd_total_size,
// l_emission->data.type_auth.size - l_emission->data.type_auth.tsd_total_size, a_hash_out_type);
break
;
break
;
case
DAP_CHAIN_DATUM_TOKEN_EMISSION_TYPE_ALGO
:
case
DAP_CHAIN_DATUM_TOKEN_EMISSION_TYPE_ALGO
:
dap_string_append_printf
(
a_str_out
,
" codename: %s
\n
"
,
l_emission
->
data
.
type_algo
.
codename
);
dap_string_append_printf
(
a_str_out
,
" codename: %s
\n
"
,
l_emission
->
data
.
type_algo
.
codename
);
...
...
This diff is collapsed.
Click to expand it.
modules/common/dap_chain_datum_token.c
+
16
−
4
View file @
042a9722
...
@@ -50,6 +50,12 @@ const char *c_dap_chain_datum_token_flag_str[] = {
...
@@ -50,6 +50,12 @@ const char *c_dap_chain_datum_token_flag_str[] = {
[
DAP_CHAIN_DATUM_TOKEN_FLAG_ALL_RECEIVER_ALLOWED
]
=
"ALL_RECEIVER_ALLOWED"
,
[
DAP_CHAIN_DATUM_TOKEN_FLAG_ALL_RECEIVER_ALLOWED
]
=
"ALL_RECEIVER_ALLOWED"
,
[
DAP_CHAIN_DATUM_TOKEN_FLAG_ALL_RECEIVER_FROZEN
]
=
"ALL_RECEIVER_FROZEN"
,
[
DAP_CHAIN_DATUM_TOKEN_FLAG_ALL_RECEIVER_FROZEN
]
=
"ALL_RECEIVER_FROZEN"
,
[
DAP_CHAIN_DATUM_TOKEN_FLAG_ALL_RECEIVER_UNFROZEN
]
=
"ALL_RECEIVER_UNFROZEN"
,
[
DAP_CHAIN_DATUM_TOKEN_FLAG_ALL_RECEIVER_UNFROZEN
]
=
"ALL_RECEIVER_UNFROZEN"
,
[
DAP_CHAIN_DATUM_TOKEN_FLAG_STATIC_ALL
]
=
"STATIC_ALL"
,
[
DAP_CHAIN_DATUM_TOKEN_FLAG_STATIC_FLAGS
]
=
"STATIC_FLAGS"
,
[
DAP_CHAIN_DATUM_TOKEN_FLAG_STATIC_PERMISSIONS_ALL
]
=
"STATIC_PERMISSIONS_ALL"
,
[
DAP_CHAIN_DATUM_TOKEN_FLAG_STATIC_PERMISSIONS_DATUM_TYPE
]
=
"STATIC_PERMISSIONS_DATUM_TYPE"
,
[
DAP_CHAIN_DATUM_TOKEN_FLAG_STATIC_PERMISSIONS_TX_SENDER
]
=
"TATIC_PERMISSIONS_TX_SENDER"
,
[
DAP_CHAIN_DATUM_TOKEN_FLAG_STATIC_PERMISSIONS_TX_RECEIVER
]
=
"STATIC_PERMISSIONS_TX_RECEIVER"
,
};
};
/**
/**
...
@@ -176,13 +182,13 @@ void dap_chain_datum_token_flags_dump(dap_string_t * a_str_out, uint16_t a_flags
...
@@ -176,13 +182,13 @@ void dap_chain_datum_token_flags_dump(dap_string_t * a_str_out, uint16_t a_flags
return
;
return
;
}
}
bool
is_first
=
true
;
bool
is_first
=
true
;
for
(
uint16_t
i
=
0
;
i
<=
DAP_CHAIN_DATUM_TOKEN_FLAG_MAX
;
i
++
){
for
(
uint16_t
i
=
0
;
BIT
(
i
)
<=
DAP_CHAIN_DATUM_TOKEN_FLAG_MAX
;
i
++
){
if
(
a_flags
&
(
1
<<
i
)
){
if
(
a_flags
&
(
1
<<
i
)
){
if
(
is_first
)
if
(
is_first
)
is_first
=
false
;
is_first
=
false
;
else
else
dap_string_append_printf
(
a_str_out
,
", "
);
dap_string_append_printf
(
a_str_out
,
", "
);
dap_string_append_printf
(
a_str_out
,
"%s"
,
c_dap_chain_datum_token_flag_str
[
i
]);
dap_string_append_printf
(
a_str_out
,
"%s"
,
c_dap_chain_datum_token_flag_str
[
BIT
(
i
)
]);
}
}
if
(
i
==
DAP_CHAIN_DATUM_TOKEN_FLAG_MAX
)
if
(
i
==
DAP_CHAIN_DATUM_TOKEN_FLAG_MAX
)
dap_string_append_printf
(
a_str_out
,
"
\n
"
);
dap_string_append_printf
(
a_str_out
,
"
\n
"
);
...
@@ -215,6 +221,12 @@ void dap_chain_datum_token_certs_dump(dap_string_t * a_str_out, byte_t * a_data_
...
@@ -215,6 +221,12 @@ void dap_chain_datum_token_certs_dump(dap_string_t * a_str_out, byte_t * a_data_
continue
;
continue
;
}
}
if
(
l_sign
->
header
.
sign_size
>
a_certs_size
)
{
dap_string_append_printf
(
a_str_out
,
"<CORRUPTED - signature size is greater than a_certs_size>
\n
"
);
continue
;
}
dap_chain_hash_fast_t
l_pkey_hash
=
{
0
};
dap_chain_hash_fast_t
l_pkey_hash
=
{
0
};
if
(
dap_sign_get_pkey_hash
(
l_sign
,
&
l_pkey_hash
)
==
false
)
{
if
(
dap_sign_get_pkey_hash
(
l_sign
,
&
l_pkey_hash
)
==
false
)
{
dap_string_append_printf
(
a_str_out
,
"<CORRUPTED - can't calc hash>
\n
"
);
dap_string_append_printf
(
a_str_out
,
"<CORRUPTED - can't calc hash>
\n
"
);
...
@@ -429,9 +441,9 @@ dap_chain_datum_token_emission_t *dap_chain_datum_emission_add_sign(dap_enc_key_
...
@@ -429,9 +441,9 @@ dap_chain_datum_token_emission_t *dap_chain_datum_emission_add_sign(dap_enc_key_
if
(
!
l_new_sign
)
if
(
!
l_new_sign
)
return
NULL
;
return
NULL
;
size_t
l_emission_size
=
dap_chain_datum_emission_get_size
((
uint8_t
*
)
a_emission
);
size_t
l_emission_size
=
dap_chain_datum_emission_get_size
((
uint8_t
*
)
a_emission
);
dap_chain_datum_token_emission_t
*
l_ret
=
DAP_REALLOC
(
a_emission
,
l_emission_size
+
dap_sign_get_size
(
l_new_sign
));
dap_chain_datum_token_emission_t
*
l_ret
=
DAP_REALLOC
(
a_emission
,
l_emission_size
+
l_old_signs_size
+
dap_sign_get_size
(
l_new_sign
));
size_t
l_sign_size
=
dap_sign_get_size
(
l_new_sign
);
size_t
l_sign_size
=
dap_sign_get_size
(
l_new_sign
);
memcpy
(
l_ret
->
tsd_n_signs
+
l_ret
->
data
.
type_auth
.
size
,
l_new_sign
,
l_sign_size
);
memcpy
(
l_ret
->
tsd_n_signs
+
(
size_t
)
l_ret
->
data
.
type_auth
.
tsd_total_
size
,
l_new_sign
,
l_sign_size
);
DAP_DELETE
(
l_new_sign
);
DAP_DELETE
(
l_new_sign
);
l_old_signs_size
+=
l_sign_size
;
l_old_signs_size
+=
l_sign_size
;
l_signs_count
++
;
l_signs_count
++
;
...
...
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