warning fixes and windows build

pull/506/head
JacobBarthelmeh 2023-03-31 08:54:23 -07:00
parent a9224993fd
commit 5971e8a4fa
7 changed files with 36 additions and 6 deletions

View File

@ -509,6 +509,9 @@ THREAD_RETURN WOLFSSH_THREAD client_test(void* args)
break;
case 'p':
if (myoptarg == NULL) {
err_sys("port number cannot be NULL");
}
port = (word16)atoi(myoptarg);
#if !defined(NO_MAIN_DRIVER) || defined(USE_WINDOWS_API)
if (port == 0)
@ -603,7 +606,10 @@ THREAD_RETURN WOLFSSH_THREAD client_test(void* args)
err_sys("If setting priv key, need pub key.");
}
ClientSetPrivateKey(privKeyName, userEcc);
ret = ClientSetPrivateKey(privKeyName, userEcc);
if (ret != 0) {
err_sys("Error setting private key");
}
#ifdef WOLFSSH_CERTS
/* passed in certificate to use */
@ -613,7 +619,10 @@ THREAD_RETURN WOLFSSH_THREAD client_test(void* args)
else
#endif
{
ClientUsePubKey(pubKeyName, userEcc);
ret = ClientUsePubKey(pubKeyName, userEcc);
}
if (ret != 0) {
err_sys("Error setting public key");
}
ctx = wolfSSH_CTX_new(WOLFSSH_ENDPOINT_CLIENT, NULL);

View File

@ -606,6 +606,8 @@ int ClientSetEcho(int type)
}
/* Set certificate to use and public key.
* returns 0 on success */
int ClientUseCert(const char* certName)
{
int ret = 0;
@ -626,6 +628,8 @@ int ClientUseCert(const char* certName)
}
/* Reads the private key to use from file name privKeyName.
* returns 0 on success */
int ClientSetPrivateKey(const char* privKeyName, int userEcc)
{
int ret;
@ -666,6 +670,8 @@ int ClientSetPrivateKey(const char* privKeyName, int userEcc)
}
/* Set public key to use
* returns 0 on success */
int ClientUsePubKey(const char* pubKeyName, int userEcc)
{
int ret;

View File

@ -216,7 +216,10 @@ THREAD_RETURN WOLFSSH_THREAD scp_client(void* args)
err_sys("Empty path values");
}
ClientSetPrivateKey(privKeyName, 0);
ret = ClientSetPrivateKey(privKeyName, 0);
if (ret != 0) {
err_sys("Error setting private key");
}
#ifdef WOLFSSH_CERTS
/* passed in certificate to use */
@ -226,7 +229,10 @@ THREAD_RETURN WOLFSSH_THREAD scp_client(void* args)
else
#endif
{
ClientUsePubKey(pubKeyName, 0);
ret = ClientUsePubKey(pubKeyName, 0);
}
if (ret != 0) {
err_sys("Error setting public key");
}
ctx = wolfSSH_CTX_new(WOLFSSH_ENDPOINT_CLIENT, NULL);

View File

@ -1197,7 +1197,10 @@ THREAD_RETURN WOLFSSH_THREAD sftpclient_test(void* args)
}
#endif
ClientSetPrivateKey(privKeyName, 0);
ret = ClientSetPrivateKey(privKeyName, 0);
if (ret != 0) {
err_sys("Error setting private key");
}
#ifdef WOLFSSH_CERTS
/* passed in certificate to use */
@ -1207,7 +1210,10 @@ THREAD_RETURN WOLFSSH_THREAD sftpclient_test(void* args)
else
#endif
{
ClientUsePubKey(pubKeyName, 0);
ret = ClientUsePubKey(pubKeyName, 0);
}
if (ret != 0) {
err_sys("Error setting public key");
}
ctx = wolfSSH_CTX_new(WOLFSSH_ENDPOINT_CLIENT, NULL);

View File

@ -36,6 +36,7 @@
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\examples\client\client.c" />
<ClCompile Include="..\..\..\examples\client\common.c" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\wolfssh\wolfssh.vcxproj">

View File

@ -35,6 +35,7 @@
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\examples\client\common.c" />
<ClCompile Include="..\..\..\examples\client\client.c" />
<ClCompile Include="..\..\..\examples\echoserver\echoserver.c" />
<ClCompile Include="..\..\..\tests\testsuite.c" />

View File

@ -35,6 +35,7 @@
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\examples\client\common.c" />
<ClCompile Include="..\..\..\examples\sftpclient\sftpclient.c" />
</ItemGroup>
<ItemGroup>