Skip to content

Commit

Permalink
Code refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
aveenismail committed Dec 6, 2023
1 parent f7c1834 commit b1bcc74
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -1494,10 +1494,11 @@ uint32_t ykpiv_util_slot_object(uint8_t slot) {

// calculate the required length of the encoded object
buf_len = 1 /* cert tag */ + 3 /* compression tag + data*/ + 2 /* lrc */;
buf_len += get_length_size(rawdata_len);
buf_len += rawdata_len;
buf_len += len_bytes + rawdata_len;

if (buf_len > *certdata_len) {
DBG("Buffer too small");
*certdata_len = 0;
return YKPIV_SIZE_ERROR;
}

Expand Down

0 comments on commit b1bcc74

Please sign in to comment.