Skip to content

Commit 6547f04

Browse files
committed
Fix digest comparison in FindKeyId to use id->id field
WMEMCMP was comparing the computed SHA-256 digest against the WOLFSSH_AGENT_ID struct pointer instead of the id field within the struct, causing key lookups by digest to never match.
1 parent 0728d9c commit 6547f04

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/agent.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ static WOLFSSH_AGENT_ID* FindKeyId(WOLFSSH_AGENT_ID* id,
660660

661661
if (ret == WS_SUCCESS) {
662662
while (id != NULL &&
663-
WMEMCMP(digest, id, WC_SHA256_DIGEST_SIZE) != 0 &&
663+
WMEMCMP(digest, id->id, WC_SHA256_DIGEST_SIZE) != 0 &&
664664
WMEMCMP(keyBlob, id->keyBlob, keyBlobSz)) {
665665
id = id->next;
666666
}

0 commit comments

Comments
 (0)