diff options
Diffstat (limited to 'chip/g/signed_header.h')
-rw-r--r-- | chip/g/signed_header.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/chip/g/signed_header.h b/chip/g/signed_header.h index 5f274f3a0b..26a85aebf3 100644 --- a/chip/g/signed_header.h +++ b/chip/g/signed_header.h @@ -67,4 +67,15 @@ BUILD_ASSERT(sizeof(struct SignedHeader) == 1024); BUILD_ASSERT(offsetof(struct SignedHeader, info_chk_) == 1020); #define TOP_IMAGE_SIZE_BIT (1 << \ (sizeof(((struct SignedHeader *)0)->image_size) * 8 - 1)) + +/* + * It is a mere convention, but all prod keys are required to have key IDs + * such, that bit D2 is set, and all dev keys are required to have key IDs + * such, that bit D2 is not set. + * + * This convention is enforced at the key generation time. + */ +#define G_SIGNED_FOR_PROD(h) ((h)->keyid & (1 << 2)) + + #endif /* __CROS_EC_SIGNED_HEADER_H */ |