Skip to content

Commit

Permalink
Remove unnecessary check
Browse files Browse the repository at this point in the history
  • Loading branch information
aveenismail committed Sep 4, 2024
1 parent e23eaa7 commit ed3d659
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions common/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ bool read_ed25519_key(uint8_t *in, size_t in_len, uint8_t *out,
if(in_len < (sizeof(PEM_private_header) + sizeof(PEM_private_trailer)-3)) {
return false;
}
if (memcmp(in, PEM_private_header, sizeof(PEM_private_header)-1) != 0 ||
memcmp(in + in_len - sizeof(PEM_private_header), PEM_private_trailer,
sizeof(PEM_private_header) - 2) != 0) {
if (memcmp(in, PEM_private_header, sizeof(PEM_private_header) - 1) != 0 ||
memcmp(in + in_len - (sizeof(PEM_private_trailer) - 1),
PEM_private_trailer, sizeof(PEM_private_trailer) - 2) != 0) {
return false;
}

Expand Down Expand Up @@ -107,7 +107,7 @@ bool read_ed25519_key(uint8_t *in, size_t in_len, uint8_t *out,

BIO_free_all(b64);

if (ret <= 0 || ret != 48) {
if (ret != 48) {
return false;
}

Expand Down

0 comments on commit ed3d659

Please sign in to comment.