Missing error status when retries are exhausted #795

Closed
opened 2026-08-19 03:32:40 -05:00 by headscott · 0 comments
headscott commented 2026-08-19 03:32:40 -05:00 (Migrated from github.com)

Affected Code:

src/pk/ecc/ecc_sign_hash_internal.c:102

   if (max_iterations == 0) {
      goto errnokey;
   }

When all LTC_PK_MAX_RETRIES attempts are exhausted without producing a valid signature, the code jumps to errnokey without setting err. This can cause the function to incorrectly return CRYPT_OK.

Suggested fix:

   if (max_iterations == 0) {
      err = CRYPT_ERROR;
      goto errnokey;
   }
### Affected Code: **src/pk/ecc/ecc_sign_hash_internal.c:102** ``` if (max_iterations == 0) { goto errnokey; } ``` When all `LTC_PK_MAX_RETRIES` attempts are exhausted without producing a valid signature, the code jumps to `errnokey` without setting `err`. This can cause the function to incorrectly return `CRYPT_OK`. ### Suggested fix: ``` if (max_iterations == 0) { err = CRYPT_ERROR; goto errnokey; } ```
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-libtom/libtomcrypt#795
No description provided.