summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVadim Bendebury <vbendeb@chromium.org>2018-04-04 13:00:15 -0700
committerchrome-bot <chrome-bot@chromium.org>2018-04-05 22:12:13 -0700
commit8f27e60d82915ca4690e66deb918222509f6bd22 (patch)
treedb9dd565af283a2a4b6a1c806e5aca970a3ef7c4
parent9e50bb04730c312f2f950963d8bce89aa4dab0bc (diff)
downloadchrome-ec-8f27e60d82915ca4690e66deb918222509f6bd22.tar.gz
rma: mark key ID volatile so that it can be replaced post compilation
Swapping binary blobs in the image post compilation/linking is not working quite as expected, because some of the const data values seem to be inlined by the compiler, the values are not looked up at run time. This happens to the RMA public key ID field, which is just one byte in size. Marking the field 'volatile' seems to be fixing the issue. BRANCH=cr50, cr50-mp BUG=b:73296144 TEST=with the rest of the patches applied public key substitution between test and prod works as expected. Change-Id: I12d5d1243e7988ab59bf3bba8cdfa46f27116bd2 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/996513 Reviewed-by: Mary Ruthven <mruthven@chromium.org> Reviewed-by: Andrey Pronin <apronin@chromium.org>
-rw-r--r--common/rma_auth.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/common/rma_auth.c b/common/rma_auth.c
index f5217b3938..51516966b8 100644
--- a/common/rma_auth.c
+++ b/common/rma_auth.c
@@ -46,7 +46,7 @@ static const struct {
uint8_t raw_blob[33];
struct {
uint8_t server_pub_key[32];
- uint8_t server_key_id;
+ volatile uint8_t server_key_id;
};
};
} __packed rma_key_blob = {