Fix agent test setup

Instantiate a wolfSSH_AGENT_CTX before invoking wolfSSH_AGENT_SignRequest so the regression tests exercise the intended paths instead of failing with WS_AGENT_NULL_E.
pull/845/head
Andrew Hutchings 2025-10-22 15:30:59 +01:00
parent 662247394f
commit 190dda3aa9
1 changed files with 1 additions and 0 deletions

View File

@ -964,6 +964,7 @@ static void setup_agent_test(WOLFSSH_CTX** ctx, WOLFSSH** ssh, AgentTestCtx* io)
AssertIntEQ(wolfSSH_CTX_set_agent_cb(*ctx, test_agent_cb,
test_agent_io_cb), WS_SUCCESS);
AssertNotNull(*ssh = wolfSSH_new(*ctx));
AssertNotNull((*ssh)->agent = wolfSSH_AGENT_new((*ctx)->heap));
AssertIntEQ(wolfSSH_set_agent_cb_ctx(*ssh, io), WS_SUCCESS);
AssertIntEQ(wolfSSH_AGENT_enable(*ssh, 1), WS_SUCCESS);
}