mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-20 06:28:09 +00:00
fix(core/optiga): add correct key usage to OID_PIN_CMAC
This commit is contained in:
parent
3c413ecf02
commit
240f4f56cd
@ -293,6 +293,7 @@ static bool optiga_pin_init_metadata(void) {
|
|||||||
metadata.change = OPTIGA_META_ACCESS_ALWAYS;
|
metadata.change = OPTIGA_META_ACCESS_ALWAYS;
|
||||||
metadata.read = OPTIGA_META_ACCESS_NEVER;
|
metadata.read = OPTIGA_META_ACCESS_NEVER;
|
||||||
metadata.execute = ACCESS_PIN_STRETCH_COUNTER;
|
metadata.execute = ACCESS_PIN_STRETCH_COUNTER;
|
||||||
|
metadata.key_usage = OPTIGA_META_KEY_USE_ENC;
|
||||||
if (!optiga_set_metadata(OID_PIN_CMAC, &metadata)) {
|
if (!optiga_set_metadata(OID_PIN_CMAC, &metadata)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -42,6 +42,8 @@ const optiga_metadata_item OPTIGA_META_ACCESS_ALWAYS = {
|
|||||||
(const uint8_t[]){OPTIGA_ACCESS_COND_ALW}, 1};
|
(const uint8_t[]){OPTIGA_ACCESS_COND_ALW}, 1};
|
||||||
const optiga_metadata_item OPTIGA_META_ACCESS_NEVER = {
|
const optiga_metadata_item OPTIGA_META_ACCESS_NEVER = {
|
||||||
(const uint8_t[]){OPTIGA_ACCESS_COND_NEV}, 1};
|
(const uint8_t[]){OPTIGA_ACCESS_COND_NEV}, 1};
|
||||||
|
const optiga_metadata_item OPTIGA_META_KEY_USE_ENC = {
|
||||||
|
(const uint8_t[]){OPTIGA_KEY_USAGE_ENC}, 1};
|
||||||
const optiga_metadata_item OPTIGA_META_KEY_USE_KEYAGREE = {
|
const optiga_metadata_item OPTIGA_META_KEY_USE_KEYAGREE = {
|
||||||
(const uint8_t[]){OPTIGA_KEY_USAGE_KEYAGREE}, 1};
|
(const uint8_t[]){OPTIGA_KEY_USAGE_KEYAGREE}, 1};
|
||||||
static const optiga_metadata_item OPTIGA_META_VERSION_DEFAULT = {
|
static const optiga_metadata_item OPTIGA_META_VERSION_DEFAULT = {
|
||||||
|
@ -137,6 +137,7 @@ typedef struct {
|
|||||||
extern const optiga_metadata_item OPTIGA_META_LCS_OPERATIONAL;
|
extern const optiga_metadata_item OPTIGA_META_LCS_OPERATIONAL;
|
||||||
extern const optiga_metadata_item OPTIGA_META_ACCESS_ALWAYS;
|
extern const optiga_metadata_item OPTIGA_META_ACCESS_ALWAYS;
|
||||||
extern const optiga_metadata_item OPTIGA_META_ACCESS_NEVER;
|
extern const optiga_metadata_item OPTIGA_META_ACCESS_NEVER;
|
||||||
|
extern const optiga_metadata_item OPTIGA_META_KEY_USE_ENC;
|
||||||
extern const optiga_metadata_item OPTIGA_META_KEY_USE_KEYAGREE;
|
extern const optiga_metadata_item OPTIGA_META_KEY_USE_KEYAGREE;
|
||||||
|
|
||||||
optiga_result optiga_parse_metadata(const uint8_t *serialized,
|
optiga_result optiga_parse_metadata(const uint8_t *serialized,
|
||||||
|
Loading…
Reference in New Issue
Block a user