Skip to content

Commit 7416b81

Browse files
committed
Misc fixes in SHE server
1 parent 0507f33 commit 7416b81

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/wh_server_she.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@ static int _SetUid(whServerContext* server, uint16_t magic, uint16_t req_size,
214214

215215
resp.rc = ret;
216216
(void)wh_MessageShe_TranslateSetUidResponse(magic, &resp, resp_packet);
217+
*out_resp_size = sizeof(resp);
217218

218219
return ret;
219220
}
@@ -749,7 +750,7 @@ static int _ExportRamKey(whServerContext* server, uint16_t magic,
749750
/* set the counter, flags and ram key */
750751
memset(resp.messageTwo, 0, sizeof(resp.messageTwo));
751752
/* set count to 1 */
752-
counter_val = (wh_Utils_htonl(1) << 4);
753+
counter_val = wh_Utils_htonl(1 << 4);
753754
memcpy(resp.messageTwo, &counter_val, sizeof(uint32_t));
754755
keySz = WH_SHE_KEY_SZ;
755756
ret = wh_Server_KeystoreReadKey(
@@ -819,7 +820,7 @@ static int _ExportRamKey(whServerContext* server, uint16_t magic,
819820
if (ret == 0) {
820821
memset(resp.messageFour, 0, sizeof(resp.messageFour));
821822
/* set counter to 1, pad with 1 bit */
822-
counter_val = (wh_Utils_htonl(1) << 4);
823+
counter_val = wh_Utils_htonl(1 << 4);
823824
memcpy(resp.messageFour + WH_SHE_KEY_SZ, &counter_val,
824825
sizeof(uint32_t));
825826
resp.messageFour[WH_SHE_KEY_SZ + 3] |= 0x08;
@@ -1403,7 +1404,10 @@ static int _VerifyMac(whServerContext* server, uint16_t magic,
14031404
resp.status = 0;
14041405
}
14051406
else {
1407+
/* Verify mac is allowed to fail, per SHE spec.
1408+
Capture status, but return success. */
14061409
resp.status = 1;
1410+
ret = 0;
14071411
}
14081412
}
14091413
else {

0 commit comments

Comments
 (0)