Skip to content

Commit

Permalink
[libfko] < 0 checks not needed for size_t vars which are unsigned
Browse files Browse the repository at this point in the history
  • Loading branch information
mrash committed Dec 31, 2013
1 parent 297d7d0 commit 5022bea
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 15 deletions.
3 changes: 0 additions & 3 deletions lib/cipher_funcs.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,6 @@ get_random_data(unsigned char *data, const size_t len)
int do_time = 0;
size_t amt_read;

if(len < 0)
return;

/* Attempt to read seed data from /dev/urandom. If that does not
* work, then fall back to a time-based method (less secure, but
* probably more portable).
Expand Down
12 changes: 0 additions & 12 deletions lib/fko_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,6 @@ digest_inttostr(int digest, char* digest_str, size_t digest_size)
{
short digest_not_valid = 0;

if(digest_size < 0)
return -1;

memset(digest_str, 0, digest_size);

switch (digest)
Expand Down Expand Up @@ -303,9 +300,6 @@ hmac_digest_inttostr(int digest, char* digest_str, size_t digest_size)
{
short digest_not_valid = 0;

if(digest_size < 0)
return -1;

memset(digest_str, 0, digest_size);

switch (digest)
Expand Down Expand Up @@ -396,9 +390,6 @@ enc_mode_inttostr(int enc_mode, char* enc_mode_str, size_t enc_mode_size)
unsigned char ndx_enc_mode;
fko_enc_mode_str_t *enc_mode_str_pt;

if(enc_mode_size < 0)
return enc_mode_error;

/* Initialize the protocol string */
memset(enc_mode_str, 0, enc_mode_size);

Expand Down Expand Up @@ -650,9 +641,6 @@ dump_ctx_to_buffer(fko_ctx_t ctx, char *dump_buf, size_t dump_buf_len)
int encryption_mode = -1;
int client_timeout = -1;

if(dump_buf_len < 0)
return err;

/* Zero-ed the buffer */
memset(dump_buf, 0, dump_buf_len);

Expand Down

0 comments on commit 5022bea

Please sign in to comment.