From 23a9bb82a0518037c6d84d9a1f3dce7859d38f69 Mon Sep 17 00:00:00 2001 From: John Safranek Date: Fri, 3 Nov 2023 14:24:28 -0700 Subject: [PATCH] PR Review 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. --- src/internal.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/internal.c b/src/internal.c index b9e33888..00ccf877 100644 --- a/src/internal.c +++ b/src/internal.c @@ -1239,8 +1239,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;