From 6de1230e6b100704d7c6225dd2d0e54724eb6c6c Mon Sep 17 00:00:00 2001 From: Juliusz Sosinowicz Date: Fri, 31 May 2024 17:06:34 +0200 Subject: [PATCH] scpclient.c: correct call to wolfSSH_SetPublicKeyCheckCtx --- examples/scpclient/scpclient.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/scpclient/scpclient.c b/examples/scpclient/scpclient.c index c0cc7602b..1392b2006 100644 --- a/examples/scpclient/scpclient.c +++ b/examples/scpclient/scpclient.c @@ -253,13 +253,13 @@ THREAD_RETURN WOLFSSH_THREAD scp_client(void* args) #endif /* WOLFSSH_CERTS */ wolfSSH_CTX_SetPublicKeyCheck(ctx, ClientPublicKeyCheck); - wolfSSH_SetPublicKeyCheckCtx(ssh, (void*)host); - ssh = wolfSSH_new(ctx); if (ssh == NULL) err_sys("Couldn't create wolfSSH session."); + wolfSSH_SetPublicKeyCheckCtx(ssh, (void*)host); + if (password != NULL) wolfSSH_SetUserAuthCtx(ssh, (void*)password);