Skip to content

Commit 190dda3

Browse files
committed
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.
1 parent 6622473 commit 190dda3

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

tests/api.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -964,6 +964,7 @@ static void setup_agent_test(WOLFSSH_CTX** ctx, WOLFSSH** ssh, AgentTestCtx* io)
964964
AssertIntEQ(wolfSSH_CTX_set_agent_cb(*ctx, test_agent_cb,
965965
test_agent_io_cb), WS_SUCCESS);
966966
AssertNotNull(*ssh = wolfSSH_new(*ctx));
967+
AssertNotNull((*ssh)->agent = wolfSSH_AGENT_new((*ctx)->heap));
967968
AssertIntEQ(wolfSSH_set_agent_cb_ctx(*ssh, io), WS_SUCCESS);
968969
AssertIntEQ(wolfSSH_AGENT_enable(*ssh, 1), WS_SUCCESS);
969970
}

0 commit comments

Comments
 (0)