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
07a228ce
Commit
07a228ce
authored
Jun 22, 2020
by
Brendan Moran
Browse files
Provide public to key to signature verifiers rather than key ID
parent
34b32d83
Changes
3
Hide whitespace changes
Inline
Side-by-side
source/main.cpp
View file @
07a228ce
...
...
@@ -49,6 +49,8 @@ const uint8_t public_key[] = {
0x39
,
0x91
,
0xdb
,
0x73
,
0x38
,
0xb4
,
0xa8
,
0x96
,
};
const
size_t
public_key_size
=
sizeof
(
public_key
);
const
entrypoint_t
entrypoints
[]
=
{
{
SUIT_BOOTLOADER_SLOT_A_OFFSET
+
SUIT_BOOTLOADER_HEADER_SIZE
,
...
...
source/suit_bootloader.c
View file @
07a228ce
...
...
@@ -109,14 +109,12 @@ int suit_platform_verify_digest(int alg, const uint8_t *exp, size_t exp_len, con
int
ES256_verify
(
const
uint8_t
*
msg
,
size_t
msg_len
,
const
uint8_t
*
sig
,
size_t
sig_len
,
const
uint8_t
*
kid
,
size_t
kid
_len
)
const
uint8_t
*
pub
,
size_t
pub
_len
)
{
//TODO: SHA
uint8_t
hash
[
32
]
=
{
0
};
compute_sha256
(
hash
,
msg
,
msg_len
);
//TODO: Lookup public key by key-id
if
(
uECC_verify
(
public_key
,
hash
,
sig
))
{
if
(
uECC_verify
(
pub
,
hash
,
sig
))
{
return
CBOR_ERR_NONE
;
}
else
{
...
...
@@ -131,12 +129,13 @@ int COSEAuthVerify(
int
alg
)
{
int
rc
;
//TODO: Lookup public key by key-id
switch
(
alg
)
{
case
COSE_ES256
:
rc
=
ES256_verify
(
msg
,
msg_len
,
sig
,
sig_len
,
kid
,
kid_len
);
public_key
,
public_key_size
);
break
;
default:
SET_ERROR
(
rc
,
CBOR_ERR_UNIMPLEMENTED
);
...
...
source/suit_bootloader.h
View file @
07a228ce
...
...
@@ -33,6 +33,7 @@ typedef struct entrypoint_s {
}
entrypoint_t
;
extern
const
uint8_t
public_key
[];
extern
const
size_t
public_key_size
;
extern
const
uint8_t
class_id
[
16
];
extern
const
uint8_t
vendor_id
[
16
];
extern
const
entrypoint_t
entrypoints
[];
...
...
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