Skip to content

Commit 983e1fc

Browse files
committed
As-published 1.4.18-preview2b
1 parent dc7d731 commit 983e1fc

File tree

7 files changed

+51
-43
lines changed

7 files changed

+51
-43
lines changed

ide/Espressif/ESP-IDF/examples/wolfssh_echoserver/components/wolfssh/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
# You should have received a copy of the GNU General Public License
1818
# along with wolfSSH. If not, see <http://www.gnu.org/licenses/>.
1919
#
20-
# cmake for WOLFSSH Espressif projects v5.6.6 r1
20+
# cmake for WOLFSSH Espressif projects v5.7.6 (template pr)
2121
#
2222
# See https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/build-system.html
2323
#

ide/Espressif/ESP-IDF/examples/wolfssh_echoserver/main/include/main.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,12 @@
2626
#include <esp_log.h>
2727

2828
/* wolfSSL */
29-
#include "user_settings.h" /* always include wolfSSL user_settings.h first */
29+
#include <wolfssl/wolfcrypt/settings.h> /* includes wolfSSL user-settings.h */
30+
#include <wolfssl/wolfcrypt/port/Espressif/esp32-crypt.h>
31+
#ifndef WOLFSSL_ESPIDF
32+
#warning "Problem with wolfSSL user_settings."
33+
#warning "Check components/wolfssl/include"
34+
#endif
3035
#include <wolfssl/wolfcrypt/port/Espressif/esp32-crypt.h>
3136
#include <wolfssl/version.h>
3237

ide/Espressif/ESP-IDF/examples/wolfssh_echoserver/main/include/time_helper.h

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,23 @@
3030
extern "C" {
3131
#endif
3232

33+
#include <esp_err.h>
34+
3335
/* a function to show the current data and time */
34-
int esp_show_current_datetime();
36+
esp_err_t esp_show_current_datetime();
3537

3638
/* worst case, if GitHub time not available, used fixed time */
37-
int set_fixed_default_time(void);
39+
esp_err_t set_fixed_default_time(void);
3840

3941
/* set time from string (e.g. GitHub commit time) */
40-
int set_time_from_string(char* time_buffer);
42+
esp_err_t set_time_from_string(const char* time_buffer);
4143

4244
/* set time from NTP servers,
4345
* also initially calls set_fixed_default_time or set_time_from_string */
44-
int set_time(void);
46+
esp_err_t set_time(void);
4547

4648
/* wait NTP_RETRY_COUNT seconds before giving up on NTP time */
47-
int set_time_wait_for_ntp(void);
49+
esp_err_t set_time_wait_for_ntp(void);
4850

4951
#ifdef __cplusplus
5052
} /* extern "C" */

ide/Espressif/ESP-IDF/examples/wolfssh_echoserver/main/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ static const char* const TAG = "My Project";
4646
void app_main(void)
4747
{
4848
func_args args = {0};
49-
int ret = ESP_OK;
49+
esp_err_t ret = ESP_OK;
5050

5151
ESP_LOGI(TAG, "------------ wolfSSL wolfSSH template Example ----------");
5252
ESP_LOGI(TAG, "--------------------------------------------------------");

ide/Espressif/ESP-IDF/examples/wolfssh_echoserver/main/time_helper.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ char* ntpServerList[NTP_SERVER_COUNT] = NTP_SERVER_LIST;
9191
extern char* ntpServerList[NTP_SERVER_COUNT];
9292

9393
/* Show the current date and time */
94-
int esp_show_current_datetime()
94+
esp_err_t esp_show_current_datetime()
9595
{
9696
time_t now;
9797
char strftime_buf[64];
@@ -108,7 +108,7 @@ int esp_show_current_datetime()
108108
}
109109

110110
/* the worst-case scenario is a hard-coded date/time */
111-
int set_fixed_default_time(void)
111+
esp_err_t set_fixed_default_time(void)
112112
{
113113
/* ideally, we'd like to set time from network,
114114
* but let's set a default time, just in case */
@@ -138,7 +138,7 @@ int set_fixed_default_time(void)
138138
*
139139
* returns 0 = success if able to set the time from the provided string
140140
* error for any other value, typically -1 */
141-
int set_time_from_string(char* time_buffer)
141+
esp_err_t set_time_from_string(const char* time_buffer)
142142
{
143143
/* expecting github default formatting: 'Thu Aug 31 12:41:45 2023 -0700' */
144144
const char *format = "%3s %3s %d %d:%d:%d %d %s";
@@ -222,7 +222,7 @@ int set_time_from_string(char* time_buffer)
222222
}
223223

224224
/* set time; returns 0 if succecssfully configured with NTP */
225-
int set_time(void)
225+
esp_err_t set_time(void)
226226
{
227227
#ifndef NTP_SERVER_COUNT
228228
ESP_LOGW(TAG, "Warning: no sntp server names defined. "
@@ -319,7 +319,7 @@ int set_time(void)
319319
}
320320

321321
/* wait for NTP to actually set the time */
322-
int set_time_wait_for_ntp(void)
322+
esp_err_t set_time_wait_for_ntp(void)
323323
{
324324
int ret = 0;
325325
#ifdef HAS_ESP_NETIF_SNTP

ide/Espressif/ESP-IDF/examples/wolfssh_template/components/wolfssh/CMakeLists.txt

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
# You should have received a copy of the GNU General Public License
1818
# along with wolfSSH. If not, see <http://www.gnu.org/licenses/>.
1919
#
20-
# cmake for WOLFSSH Espressif projects v5.6.6 r1
20+
# cmake for wolfssh Espressif projects v5.7.6 (template pr)
2121
#
2222
# See https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/build-system.html
2323
#
@@ -317,27 +317,27 @@ else()
317317
message(STATUS "************************************************************************************************")
318318
FIND_WOLFSSH_DIRECTORY(WOLFSSH_ROOT)
319319

320-
# Check to see if we're already in WOLFSSH, and only if WOLFSSH_ROOT not specified
320+
# Check to see if we're already in wolfssh, and only if WOLFSSH_ROOT not specified
321321
if ("${WOLFSSH_ROOT}" STREQUAL "")
322-
# WOLFSSH examples are 7 directories deep from WOLFSSH repo root
322+
# wolfssh examples are 7 directories deep from wolfssh repo root
323323
# 1 2 3 4 5 6 7
324324
set(THIS_RELATIVE_PATH "../../../../../../..")
325325
get_filename_component(THIS_SEARCH_PATH "${THIS_RELATIVE_PATH}" ABSOLUTE)
326326
message(STATUS "Searching in path = ${THIS_SEARCH_PATH}")
327327

328328
if (EXISTS "${THIS_SEARCH_PATH}/wolfcrypt/src")
329-
# we're already in WOLFSSH examples!
329+
# we're already in wolfssh examples!
330330
get_filename_component(WOLFSSH_ROOT "${THIS_SEARCH_PATH}" ABSOLUTE)
331-
message(STATUS "Using WOLFSSH example with root ${WOLFSSH_ROOT}")
331+
message(STATUS "Using wolfssh example with root ${WOLFSSH_ROOT}")
332332
else()
333333
# We're in some other repo such as wolfssh, so we'll search for an
334-
# adjacent-level directory for WOLFSSH. (8 directories up, then down one)
334+
# adjacent-level directory for wolfssh. (8 directories up, then down one)
335335
#
336-
# For example WOLFSSH examples:
337-
# C:\workspace\WOLFSSH-gojimmypi\IDE\Espressif\ESP-IDF\examples\WOLFSSH_benchmark\components\WOLFSSH
336+
# For example wolfssh examples:
337+
# C:\workspace\wolfssh-gojimmypi\IDE\Espressif\ESP-IDF\examples\wolfssh_benchmark\components\wolfssh
338338
#
339339
# For example wolfSSH examples:
340-
# C:\workspace\wolfssh-gojimmypi\ide\Espressif\ESP-IDF\examples\wolfssh_benchmark\components\WOLFSSH
340+
# C:\workspace\wolfssh-gojimmypi\ide\Espressif\ESP-IDF\examples\wolfssh_benchmark\components\wolfssh
341341
#
342342
# 1 2 3 4 5 6 7 8
343343
set(THIS_RELATIVE_PATH "../../../../../../../..")
@@ -356,7 +356,7 @@ else()
356356
get_filename_component(THIS_DIR "${CMAKE_CURRENT_SOURCE_DIR}" ABSOLUTE)
357357
message(STATUS "THIS_DIR = ${THIS_DIR}")
358358

359-
# find the user name to search for possible "WOLFSSH-username"
359+
# find the user name to search for possible "wolfssh-username"
360360
message(STATUS "USERNAME = $ENV{USERNAME}")
361361
if( "$ENV{USER}" STREQUAL "" ) # the bash user
362362
if( "$ENV{USERNAME}" STREQUAL "" ) # the Windows user
@@ -371,35 +371,35 @@ else()
371371
endif()
372372
message(STATUS "THIS_USER = ${THIS_USER}")
373373

374-
# This same makefile is used for both the WOLFSSH component, and other
375-
# components that may depend on WOLFSSH, such as wolfssh. Therefore
376-
# we need to determine if this makefile is in the WOLFSSH repo, or
374+
# This same makefile is used for both the wolfssh component, and other
375+
# components that may depend on wolfssh, such as wolfssh. Therefore
376+
# we need to determine if this makefile is in the wolfssh repo, or
377377
# some other repo.
378378

379379
if( "{THIS_USER}" STREQUAL "" )
380380
# This is highly unusual to not find a user name.
381-
# In this case, we'll just search for a "WOLFSSH" directory:
381+
# In this case, we'll just search for a "wolfssh" directory:
382382
message(STATUS "No username found!")
383-
get_filename_component(WOLFSSH_ROOT "${THIS_RELATIVE_PATH}/WOLFSSH" ABSOLUTE)
383+
get_filename_component(WOLFSSH_ROOT "${THIS_RELATIVE_PATH}/wolfssh" ABSOLUTE)
384384
else()
385385
# We found an environment USER name!
386-
# The first place to look for WOLFSSH will be in a user-clone called "WOLFSSH-[username]"
387-
message(STATUS "Using [THIS_USER = ${THIS_USER}] to see if there's a [relative path]/WOLFSSH-${THIS_USER} directory.")
388-
get_filename_component(WOLFSSH_ROOT "${THIS_RELATIVE_PATH}/WOLFSSH-${THIS_USER}" ABSOLUTE)
386+
# The first place to look for wolfssh will be in a user-clone called "wolfssh-[username]"
387+
message(STATUS "Using [THIS_USER = ${THIS_USER}] to see if there's a [relative path]/wolfssh-${THIS_USER} directory.")
388+
get_filename_component(WOLFSSH_ROOT "${THIS_RELATIVE_PATH}/wolfssh-${THIS_USER}" ABSOLUTE)
389389

390390
if( EXISTS "${WOLFSSH_ROOT}" )
391-
message(STATUS "Found WOLFSSH in user-suffix ${WOLFSSH_ROOT}")
391+
message(STATUS "Found wolfssh in user-suffix ${WOLFSSH_ROOT}")
392392
else()
393-
# If there's not a user-clone called "WOLFSSH-[username]",
394-
# perhaps there's simply a git clone called "WOLFSSH"?
395-
message(STATUS "Did not find WOLFSSH-${THIS_USER}; continuing search...")
396-
get_filename_component(WOLFSSH_ROOT "${THIS_RELATIVE_PATH}/WOLFSSH" ABSOLUTE)
393+
# If there's not a user-clone called "wolfssh-[username]",
394+
# perhaps there's simply a git clone called "wolfssh"?
395+
message(STATUS "Did not find wolfssh-${THIS_USER}; continuing search...")
396+
get_filename_component(WOLFSSH_ROOT "${THIS_RELATIVE_PATH}/wolfssh" ABSOLUTE)
397397

398398
if( EXISTS "${WOLFSSH_ROOT}" )
399-
message(STATUS "Found WOLFSSH in standard ${WOLFSSH_ROOT}")
399+
message(STATUS "Found wolfssh in standard ${WOLFSSH_ROOT}")
400400
else()
401401
# Things are looking pretty bleak. We'll likely not be able to compile.
402-
message(STATUS "Did not find WOLFSSH in ${WOLFSSH_ROOT}")
402+
message(STATUS "Did not find wolfssh in ${WOLFSSH_ROOT}")
403403
endif()
404404
endif()
405405
endif()
@@ -426,8 +426,8 @@ else()
426426
if( EXISTS "${WOLFSSH_ROOT}" )
427427
message(STATUS "WOLFSSH_ROOT = ${WOLFSSH_ROOT}")
428428
else()
429-
# Abort. We need WOLFSSH _somewhere_.
430-
message(FATAL_ERROR "Could not find WOLFSSH in ${WOLFSSH_ROOT}. Try setting environment variable or git clone.")
429+
# Abort. We need wolfssh _somewhere_.
430+
message(FATAL_ERROR "Could not find wolfssh in ${WOLFSSH_ROOT}. Try setting environment variable or git clone.")
431431
endif()
432432

433433

@@ -488,12 +488,12 @@ else()
488488
# We need to now determine if it is local and if so if it is part of the wolfssh repo,
489489
# or if wolfssh is simply installed as a local component.
490490
#
491-
491+
message(STATUS "Looking at WOLFSSH_PROJECT_DIR = '${WOLFSSH_PROJECT_DIR}'")
492492
if( EXISTS "${WOLFSSH_PROJECT_DIR}" )
493493
#
494494
# wolfssh found in local project.
495495
#
496-
if( EXISTS "${WOLFSSH_PROJECT_DIR}/wolfcrypt/" )
496+
if( EXISTS "${WOLFSSH_PROJECT_DIR}/wolfssh/" )
497497
message(STATUS "")
498498
message(STATUS "Using installed project ./components/wolfssh in CMAKE_HOME_DIRECTORY = ${CMAKE_HOME_DIRECTORY}")
499499
message(STATUS "")

wolfssh/test.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -949,7 +949,8 @@ static INLINE void WaitTcpReady(tcp_ready* ready)
949949
#ifdef WOLFSSH_TEST_THREADING
950950

951951

952-
#if !defined(WOLFSSH_OLD_THREADING) && !defined(WOLFSSH_OLDER_THREADING)
952+
#if !defined(WOLFSSH_OLD_THREADING) && !defined(WOLFSSH_OLDER_THREADING) && \
953+
!defined(SINGLE_THREADED)
953954

954955
static INLINE void ThreadStart(THREAD_CB fun, void* args, THREAD_TYPE* thread)
955956
{

0 commit comments

Comments
 (0)