diff options
author | Andrey Pronin <apronin@chromium.org> | 2019-06-26 10:15:47 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-06-27 20:43:55 +0000 |
commit | b7aba9d023d3c7273904860cb81bd7d3bd12e47f (patch) | |
tree | fdc7bae071dd0a3b62ea9467cccab44db323fb97 /include/rma_auth.h | |
parent | 753f005e03ea655d382eea07516f96d7ff02fae3 (diff) | |
download | chrome-ec-b7aba9d023d3c7273904860cb81bd7d3bd12e47f.tar.gz |
rma: extract getting RMA Dev ID into a separate method
This CL extracts get_rma_device_id() that can be used by rma_auth and
other cr50 components.
BRANCH=none
BUG=b:136091350
TEST=Verify that RSU Device ID reported through vNVRAM that uses this
new method mathes the same ID calculated from device ID in G2FA
certificate. See CL:1677238 for the exact method.
Change-Id: I08f58dbd8f838f1e595601ec4532792acda62428
Signed-off-by: Andrey Pronin <apronin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1677237
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Diffstat (limited to 'include/rma_auth.h')
-rw-r--r-- | include/rma_auth.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/include/rma_auth.h b/include/rma_auth.h index 698f4a71e9..0a4d7c7e71 100644 --- a/include/rma_auth.h +++ b/include/rma_auth.h @@ -21,6 +21,8 @@ #define RMA_CHALLENGE_GET_VERSION(vkidbyte) ((vkidbyte) >> 6) #define RMA_CHALLENGE_GET_KEY_ID(vkidbyte) ((vkidbyte) & 0x3f) +#define RMA_DEVICE_ID_SIZE 8 + struct __packed rma_challenge { /* Top 2 bits are protocol version; bottom 6 are server KeyID */ uint8_t version_key_id; @@ -32,7 +34,7 @@ struct __packed rma_challenge { uint8_t board_id[4]; /* Device ID */ - uint8_t device_id[8]; + uint8_t device_id[RMA_DEVICE_ID_SIZE]; }; /* Size of encoded challenge and response, and buffer sizes to hold them */ @@ -68,4 +70,12 @@ const char *rma_get_challenge(void); */ int rma_try_authcode(const char *code); +/** + * Get the device ID returned in RMA response. + * + * @param rma_device_id Pointer to the buffer that will be filled with + * the ID. The buffer must be of size RMA_DEVICE_ID_SIZE. + */ +void get_rma_device_id(uint8_t rma_device_id[RMA_DEVICE_ID_SIZE]); + #endif |