Skip to content

Commit

Permalink
PR Review
Browse files Browse the repository at this point in the history
1. Change the block size in the key decoding to a named constant rather
   than a bare number.
2. Change the comparison from a difference of two unsigned values
   against zero to comparing them directly.
  • Loading branch information
ejohnstown committed Nov 3, 2023
1 parent 40537d7 commit 29ee170
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/internal.c
Original file line number Diff line number Diff line change
Expand Up @@ -1238,8 +1238,8 @@ static int GetOpenSshKey(WS_KeySignature *key,
* and the length of the comment delimit the end of the
* encrypted blob. No added padding required. */
if (ret == WS_SUCCESS) {
if (strSz % 8 == 0) {
if (strSz - subIdx > 0) {
if (strSz % MIN_BLOCK_SZ == 0) {
if (strSz > subIdx) {
/* The padding starts at 1. */
check2 = strSz - subIdx;
for (check1 = 1;
Expand Down

0 comments on commit 29ee170

Please sign in to comment.