Skip to content

Commit 9cb4b92

Browse files
committed
Misc fixes in SHE server
1 parent 52fd0b6 commit 9cb4b92

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
@@ -787,7 +787,7 @@ static int _ExportRamKey(whServerContext* server, uint16_t magic,
787787
/* set the counter, flags and ram key */
788788
memset(resp.messageTwo, 0, sizeof(resp.messageTwo));
789789
/* set count to 1 */
790-
counter_val = (wh_Utils_htonl(1) << 4);
790+
counter_val = wh_Utils_htonl(1 << 4);
791791
memcpy(resp.messageTwo, &counter_val, sizeof(uint32_t));
792792
keySz = WH_SHE_KEY_SZ;
793793
ret = wh_Server_KeystoreReadKey(
@@ -857,7 +857,7 @@ static int _ExportRamKey(whServerContext* server, uint16_t magic,
857857
if (ret == 0) {
858858
memset(resp.messageFour, 0, sizeof(resp.messageFour));
859859
/* set counter to 1, pad with 1 bit */
860-
counter_val = (wh_Utils_htonl(1) << 4);
860+
counter_val = wh_Utils_htonl(1 << 4);
861861
memcpy(resp.messageFour + WH_SHE_KEY_SZ, &counter_val,
862862
sizeof(uint32_t));
863863
resp.messageFour[WH_SHE_KEY_SZ + 3] |= 0x08;
@@ -1523,6 +1523,10 @@ static int _VerifyMac(whServerContext* server, uint16_t magic,
15231523
}
15241524
else {
15251525
mac = message + req.messageLen;
1526+
/* Verify mac is allowed to fail, per SHE spec.
1527+
Capture status, but return success. */
1528+
resp.status = 1;
1529+
ret = 0;
15261530
}
15271531
}
15281532

0 commit comments

Comments
 (0)