Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Research
ietf-suit
pull-cbor
Commits
debfa49b
Commit
debfa49b
authored
Jul 01, 2020
by
Brendan Moran
Browse files
Improve digest handling
parent
8e0d7e8c
Changes
1
Hide whitespace changes
Inline
Side-by-side
source/suit_parser.c
View file @
debfa49b
...
...
@@ -636,11 +636,18 @@ CBOR_KPARSE_ELEMENT_LIST(suit_digest_elements,
CBOR_KPARSE_ELEMENT_EX
(
0
,
CBOR_TYPE_NINT
,
&
exp_digest_alg
,
"SUIT Digest Algorithm"
),
CBOR_KPARSE_ELEMENT_EX
(
1
,
CBOR_TYPE_BSTR
,
&
exp_digest
,
"SUIT Digest Bytes"
),
);
CBOR_KPARSE_ELEMENT_LIST
(
suit_digest_container
,
CBOR_KPARSE_ELEMENT_C
(
0
,
CBOR_TYPE_LIST
,
&
suit_digest_elements
,
"SUIT Digest"
),
CBOR_KPARSE_ELEMENT_C_BWRAP
(
0
,
CBOR_TYPE_LIST
,
&
suit_digest_elements
,
"SUIT Digest Wrapped"
),
);
int
suit_check_digest
(
suit_reference_t
*
expected_digest
,
const
uint8_t
*
data
,
size_t
data_len
)
{
const
uint8_t
*
p
=
expected_digest
->
ptr
;
const
uint8_t
*
end
=
expected_digest
->
end
;
int
rc
=
suit_process_kv
(
&
p
,
end
,
NULL
,
&
suit_digest_elements
.
elements
,
CBOR_TYPE_LIST
);
int
rc
=
handle_keyed_element
(
&
p
,
end
,
NULL
,
&
suit_digest_container
.
elements
,
0
);
// int rc = suit_process_kv(&p, end, NULL, &suit_digest_elements.elements, CBOR_TYPE_LIST);
if
(
rc
!=
CBOR_ERR_NONE
)
{
return
rc
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment