summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorVadim Bendebury <vbendeb@chromium.org>2017-10-03 18:49:31 -0700
committerchrome-bot <chrome-bot@chromium.org>2017-10-04 15:52:15 -0700
commit12181aacdeed24db30241c597ea72259900b2e94 (patch)
tree17a857a82fc0c63633c882edd2b110147ab78af0 /test
parent04db902fee7dc7ae615fbb22454dc247a534c1f0 (diff)
downloadchrome-ec-12181aacdeed24db30241c597ea72259900b2e94.tar.gz
common: make rma_auth work with the server
A couple of bugs have crept in with the latest series of patches: - the board ID value endianness does not have to be changed - the test RMA server public key value is wrong BRANCH=cr50 BUG=b:67007905 TEST=the generated challenge is now accepted by the server, and the generated auth code matches between the server and the Cr50. Change-Id: I18f413ab0bcc14d9cc50b115ac3784fdfcd5851c Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/700798 Reviewed-by: Michael Tang <ntang@chromium.org>
Diffstat (limited to 'test')
-rw-r--r--test/rma_auth.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/test/rma_auth.c b/test/rma_auth.c
index 1ff0c63ea5..ced910d778 100644
--- a/test/rma_auth.c
+++ b/test/rma_auth.c
@@ -63,7 +63,6 @@ int rma_server_side(char *out_auth_code, const char *challenge)
uint8_t hmac[32];
struct rma_challenge c;
uint8_t *cptr = (uint8_t *)&c;
- uint32_t inverted_board_id;
/* Convert the challenge back into binary */
if (base32_decode(cptr, 8 * sizeof(c), challenge, 9) != 8 * sizeof(c)) {
@@ -102,9 +101,7 @@ int rma_server_side(char *out_auth_code, const char *challenge)
* Since this is just a test, here we'll just make sure the BoardID
* and DeviceID match what we expected.
*/
- memcpy(&inverted_board_id, dummy_board_id, sizeof(inverted_board_id));
- inverted_board_id = be32toh(inverted_board_id);
- if (memcmp(c.board_id, &inverted_board_id, sizeof(c.board_id))) {
+ if (memcmp(c.board_id, dummy_board_id, sizeof(c.board_id))) {
printf("BoardID mismatch\n");
return -1;
}