Skip to content

Commit

Permalink
Revert format changes
Browse files Browse the repository at this point in the history
  • Loading branch information
aveenismail committed Mar 21, 2024
1 parent 6d775f5 commit 7be67d3
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/yubihsm.c
Original file line number Diff line number Diff line change
Expand Up @@ -431,8 +431,7 @@ static yh_rc send_encrypted_msg(Scp_ctx *session, yh_cmd cmd,

// Outer command { cmd | cmd_len | sid | encrypted payload | mac }
if (3 + 1 + len + SCP_MAC_LEN > SCP_MSG_BUF_SIZE) {
DBG_ERR("%s: %u", yh_strerror(YHR_BUFFER_TOO_SMALL),
3 + 1 + len + SCP_MAC_LEN);
DBG_ERR("%s: %u", yh_strerror(YHR_BUFFER_TOO_SMALL), 3 + 1 + len + SCP_MAC_LEN);
return YHR_BUFFER_TOO_SMALL;
}

Expand Down Expand Up @@ -1029,8 +1028,7 @@ yh_rc yh_finish_create_session(yh_session *session, const uint8_t *key_senc,
return yrc;
}

// Verify card cryptogram (after sending response, so we clean up the hsm
// session on failure)
// Verify card cryptogram (after sending response, so we clean up the hsm session on failure)
if (memcmp(card_cryptogram, computed_cryptogram, SCP_CARD_CRYPTO_LEN)) {
DBG_ERR("%s", yh_strerror(YHR_CRYPTOGRAM_MISMATCH));
return YHR_CRYPTOGRAM_MISMATCH;
Expand Down

0 comments on commit 7be67d3

Please sign in to comment.