Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/wh_server_she.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ static int _SetUid(whServerContext* server, uint16_t magic, uint16_t req_size,

resp.rc = ret;
(void)wh_MessageShe_TranslateSetUidResponse(magic, &resp, resp_packet);
*out_resp_size = sizeof(resp);

return ret;
}
Expand Down Expand Up @@ -749,7 +750,7 @@ static int _ExportRamKey(whServerContext* server, uint16_t magic,
/* set the counter, flags and ram key */
memset(resp.messageTwo, 0, sizeof(resp.messageTwo));
/* set count to 1 */
counter_val = (wh_Utils_htonl(1) << 4);
counter_val = wh_Utils_htonl(1 << 4);
memcpy(resp.messageTwo, &counter_val, sizeof(uint32_t));
keySz = WH_SHE_KEY_SZ;
ret = wh_Server_KeystoreReadKey(
Expand Down Expand Up @@ -819,7 +820,7 @@ static int _ExportRamKey(whServerContext* server, uint16_t magic,
if (ret == 0) {
memset(resp.messageFour, 0, sizeof(resp.messageFour));
/* set counter to 1, pad with 1 bit */
counter_val = (wh_Utils_htonl(1) << 4);
counter_val = wh_Utils_htonl(1 << 4);
memcpy(resp.messageFour + WH_SHE_KEY_SZ, &counter_val,
sizeof(uint32_t));
resp.messageFour[WH_SHE_KEY_SZ + 3] |= 0x08;
Expand Down Expand Up @@ -1403,7 +1404,10 @@ static int _VerifyMac(whServerContext* server, uint16_t magic,
resp.status = 0;
}
else {
/* Verify mac is allowed to fail, per SHE spec.
Capture status, but return success. */
resp.status = 1;
ret = 0;
}
}
else {
Expand Down
Loading