Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions examples/echoserver/echoserver.c
Original file line number Diff line number Diff line change
Expand Up @@ -3159,13 +3159,13 @@ THREAD_RETURN WOLFSSH_THREAD echoserver_test(void* args)

case 'p':
if (myoptarg == NULL) {
ES_ERROR("NULL port value");
ES_ERROR("NULL port value\n");
}
else {
port = (word16)atoi(myoptarg);
#if !defined(NO_MAIN_DRIVER)
if (port == 0) {
ES_ERROR("port number cannot be 0");
ES_ERROR("port number cannot be 0\n");
}
#endif
}
Expand Down Expand Up @@ -3397,20 +3397,20 @@ THREAD_RETURN WOLFSSH_THREAD echoserver_test(void* args)
kbAuthData.promptLanguageSz = 0;
kbAuthData.prompts = (byte**)WMALLOC(sizeof(byte*), NULL, 0);
if (kbAuthData.prompts == NULL) {
ES_ERROR("Error allocating prompts");
ES_ERROR("Error allocating prompts\n");
}
kbAuthData.promptLengths = (word32*)WMALLOC(sizeof(word32), NULL, 0);
if (kbAuthData.promptLengths == NULL) {
WFREE(kbAuthData.prompts, NULL, 0);
ES_ERROR("Error allocating promptLengths");
ES_ERROR("Error allocating promptLengths\n");
}
kbAuthData.prompts[0] = (byte*)"KB Auth Password: ";
kbAuthData.promptLengths[0] = 18;
kbAuthData.promptEcho = (byte*)WMALLOC(sizeof(byte), NULL, 0);
if (kbAuthData.promptEcho == NULL) {
WFREE(kbAuthData.prompts, NULL, 0);
WFREE(kbAuthData.promptLengths, NULL, 0);
ES_ERROR("Error allocating promptEcho");
ES_ERROR("Error allocating promptEcho\n");
}
kbAuthData.promptEcho[0] = 0;
LoadKeyboardList(keyboardList, &pwMapList, &kbAuthData);
Expand All @@ -3432,7 +3432,7 @@ THREAD_RETURN WOLFSSH_THREAD echoserver_test(void* args)
keyLoadBuf = (byte*)WMALLOC(EXAMPLE_KEYLOAD_BUFFER_SZ,
NULL, 0);
if (keyLoadBuf == NULL) {
ES_ERROR("Error allocating keyLoadBuf");
ES_ERROR("Error allocating keyLoadBuf\n");
}
#else
keyLoadBuf = buf;
Expand Down Expand Up @@ -3788,7 +3788,7 @@ THREAD_RETURN WOLFSSH_THREAD echoserver_test(void* args)
&clientAddrSz);
#endif
if (clientFd == -1) {
ES_ERROR("tcp accept failed");
ES_ERROR("tcp accept failed\n");
}

if (nonBlock)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2658,13 +2658,13 @@ THREAD_RETURN WOLFSSH_THREAD echoserver_test(void* args)

case 'p':
if (myoptarg == NULL) {
ES_ERROR("NULL port value");
ES_ERROR("NULL port value\n");
}
else {
port = (word16)atoi(myoptarg);
#if !defined(NO_MAIN_DRIVER) || defined(USE_WINDOWS_API)
if (port == 0) {
ES_ERROR("port number cannot be 0");
ES_ERROR("port number cannot be 0\n");
}
#endif
}
Expand Down Expand Up @@ -2748,7 +2748,7 @@ THREAD_RETURN WOLFSSH_THREAD echoserver_test(void* args)

#ifdef WOLFSSH_TEST_BLOCK
if (!nonBlock) {
ES_ERROR("Use -N when testing forced non blocking");
ES_ERROR("Use -N when testing forced non blocking\n");
}
#endif

Expand Down Expand Up @@ -2881,20 +2881,20 @@ THREAD_RETURN WOLFSSH_THREAD echoserver_test(void* args)
kbAuthData.promptLanguageSz = 0;
kbAuthData.prompts = (byte**)WMALLOC(sizeof(byte*), NULL, 0);
if (kbAuthData.prompts == NULL) {
ES_ERROR("Error allocating prompts");
ES_ERROR("Error allocating prompts\n");
}
kbAuthData.promptLengths = (word32*)WMALLOC(sizeof(word32), NULL, 0);
if (kbAuthData.promptLengths == NULL) {
WFREE(kbAuthData.prompts, NULL, 0);
ES_ERROR("Error allocating promptLengths");
ES_ERROR("Error allocating promptLengths\n");
}
kbAuthData.prompts[0] = (byte*)"KB Auth Password: ";
kbAuthData.promptLengths[0] = 18;
kbAuthData.promptEcho = (byte*)WMALLOC(sizeof(byte), NULL, 0);
if (kbAuthData.promptEcho == NULL) {
WFREE(kbAuthData.prompts, NULL, 0);
WFREE(kbAuthData.promptLengths, NULL, 0);
ES_ERROR("Error allocating promptEcho");
ES_ERROR("Error allocating promptEcho\n");
}
kbAuthData.promptEcho[0] = 0;
wolfSSH_SetKeyboardAuthPrompts(ctx, keyboardCallback);
Expand All @@ -2913,7 +2913,7 @@ THREAD_RETURN WOLFSSH_THREAD echoserver_test(void* args)
keyLoadBuf = (byte*)WMALLOC(EXAMPLE_KEYLOAD_BUFFER_SZ,
NULL, 0);
if (keyLoadBuf == NULL) {
ES_ERROR("Error allocating keyLoadBuf");
ES_ERROR("Error allocating keyLoadBuf\n");
}
#else
keyLoadBuf = buf;
Expand Down Expand Up @@ -3200,7 +3200,7 @@ THREAD_RETURN WOLFSSH_THREAD echoserver_test(void* args)
&clientAddrSz);
#endif
if (clientFd == -1) {
ES_ERROR("tcp accept failed");
ES_ERROR("tcp accept failed\n");
}

if (nonBlock)
Expand Down
12 changes: 6 additions & 6 deletions tests/auth.c
Original file line number Diff line number Diff line change
Expand Up @@ -1814,20 +1814,20 @@ static THREAD_RETURN WOLFSSH_THREAD server_thread(void* args)
promptData.prompts =
(byte**)WMALLOC(sizeof(byte*) * kbResponseCount, NULL, 0);
if (promptData.prompts == NULL) {
ES_ERROR("Could not allocate prompts");
ES_ERROR("Could not allocate prompts\n");
}
promptData.promptLengths =
(word32*)WMALLOC(sizeof(word32) * kbResponseCount, NULL, 0);
if (promptData.promptLengths == NULL) {
WFREE(promptData.prompts, NULL, 0);
ES_ERROR("Could not allocate promptLengths");
ES_ERROR("Could not allocate promptLengths\n");
}
promptData.promptEcho =
(byte*)WMALLOC(sizeof(byte) * kbResponseCount, NULL, 0);
if (promptData.promptEcho == NULL) {
WFREE(promptData.prompts, NULL, 0);
WFREE(promptData.promptLengths, NULL, 0);
ES_ERROR("Could not allocate promptEcho");
ES_ERROR("Could not allocate promptEcho\n");
}
for (word32 prompt = 0; prompt < kbResponseCount; prompt++) {
promptData.prompts[prompt] = (byte*)"Password: ";
Expand Down Expand Up @@ -1870,13 +1870,13 @@ static THREAD_RETURN WOLFSSH_THREAD server_thread(void* args)

clientFd = accept(listenFd, (struct sockaddr*)&clientAddr, &clientAddrSz);
if (clientFd == -1) {
ES_ERROR("tcp accept failed");
ES_ERROR("tcp accept failed\n");
}
wolfSSH_set_fd(ssh, (int)clientFd);

ret = wolfSSH_accept(ssh);
if (ret && !unbalanced) {
ES_ERROR("wolfSSH Accept Error");
ES_ERROR("wolfSSH Accept Error\n");
}

ret = wolfSSH_shutdown(ssh);
Expand All @@ -1900,7 +1900,7 @@ static THREAD_RETURN WOLFSSH_THREAD server_thread(void* args)
wolfSSH_CTX_free(ctx);

if (ret) {
ES_ERROR("wolfSSH Shutdown Error");
ES_ERROR("wolfSSH Shutdown Error\n");
}

WOLFSSL_RETURN_FROM_THREAD(0);
Expand Down
Loading