From 23972128ed371da6719e2cb8fb5b1fbce50637b5 Mon Sep 17 00:00:00 2001 From: gojimmypi Date: Thu, 6 Feb 2025 08:13:24 -0800 Subject: [PATCH] Espressif Managed Component wolfSSH 1.4.18 post-release update --- .github/workflows/zephyr.yml | 2 + .../wolfssh_echoserver/CMakeLists.txt | 2 +- .../components/wolfssh/CMakeLists.txt | 2 +- .../wolfssh_echoserver/main/include/main.h | 7 ++- .../main/include/time_helper.h | 12 ++-- .../examples/wolfssh_echoserver/main/main.c | 2 +- .../wolfssh_echoserver/main/time_helper.c | 10 ++-- .../components/wolfssh/CMakeLists.txt | 58 +++++++++---------- ide/include.am | 24 ++++---- 9 files changed, 64 insertions(+), 55 deletions(-) diff --git a/.github/workflows/zephyr.yml b/.github/workflows/zephyr.yml index 26750fcc..c3bc8820 100644 --- a/.github/workflows/zephyr.yml +++ b/.github/workflows/zephyr.yml @@ -14,6 +14,8 @@ jobs: config: - zephyr-ref: v3.4.0 zephyr-sdk: 0.16.1 + + if: github.repository_owner == 'wolfssl' runs-on: ubuntu-latest # This should be a safe limit for the tests to run. timeout-minutes: 20 diff --git a/ide/Espressif/ESP-IDF/examples/wolfssh_echoserver/CMakeLists.txt b/ide/Espressif/ESP-IDF/examples/wolfssh_echoserver/CMakeLists.txt index db489578..299b9546 100644 --- a/ide/Espressif/ESP-IDF/examples/wolfssh_echoserver/CMakeLists.txt +++ b/ide/Espressif/ESP-IDF/examples/wolfssh_echoserver/CMakeLists.txt @@ -17,7 +17,7 @@ # You should have received a copy of the GNU General Public License # along with wolfSSH. If not, see . # -# cmake for WOLFSSH Espressif projects +# cmake for WOLFSSH Espressif projects (echoserver) # # See https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/build-system.html diff --git a/ide/Espressif/ESP-IDF/examples/wolfssh_echoserver/components/wolfssh/CMakeLists.txt b/ide/Espressif/ESP-IDF/examples/wolfssh_echoserver/components/wolfssh/CMakeLists.txt index d5d20c62..a02cde87 100644 --- a/ide/Espressif/ESP-IDF/examples/wolfssh_echoserver/components/wolfssh/CMakeLists.txt +++ b/ide/Espressif/ESP-IDF/examples/wolfssh_echoserver/components/wolfssh/CMakeLists.txt @@ -17,7 +17,7 @@ # You should have received a copy of the GNU General Public License # along with wolfSSH. If not, see . # -# cmake for WOLFSSH Espressif projects v5.6.6 r1 +# cmake for WOLFSSH Espressif projects v5.7.6 (template pr) # # See https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/build-system.html # diff --git a/ide/Espressif/ESP-IDF/examples/wolfssh_echoserver/main/include/main.h b/ide/Espressif/ESP-IDF/examples/wolfssh_echoserver/main/include/main.h index 8a66a193..538c5b37 100644 --- a/ide/Espressif/ESP-IDF/examples/wolfssh_echoserver/main/include/main.h +++ b/ide/Espressif/ESP-IDF/examples/wolfssh_echoserver/main/include/main.h @@ -26,7 +26,12 @@ #include /* wolfSSL */ -#include "user_settings.h" /* always include wolfSSL user_settings.h first */ +#include /* includes wolfSSL user-settings.h */ +#include +#ifndef WOLFSSL_ESPIDF + #warning "Problem with wolfSSL user_settings." + #warning "Check components/wolfssl/include" +#endif #include #include diff --git a/ide/Espressif/ESP-IDF/examples/wolfssh_echoserver/main/include/time_helper.h b/ide/Espressif/ESP-IDF/examples/wolfssh_echoserver/main/include/time_helper.h index b4774188..6e9f6b9d 100644 --- a/ide/Espressif/ESP-IDF/examples/wolfssh_echoserver/main/include/time_helper.h +++ b/ide/Espressif/ESP-IDF/examples/wolfssh_echoserver/main/include/time_helper.h @@ -30,21 +30,23 @@ extern "C" { #endif +#include + /* a function to show the current data and time */ -int esp_show_current_datetime(); +esp_err_t esp_show_current_datetime(); /* worst case, if GitHub time not available, used fixed time */ -int set_fixed_default_time(void); +esp_err_t set_fixed_default_time(void); /* set time from string (e.g. GitHub commit time) */ -int set_time_from_string(char* time_buffer); +esp_err_t set_time_from_string(const char* time_buffer); /* set time from NTP servers, * also initially calls set_fixed_default_time or set_time_from_string */ -int set_time(void); +esp_err_t set_time(void); /* wait NTP_RETRY_COUNT seconds before giving up on NTP time */ -int set_time_wait_for_ntp(void); +esp_err_t set_time_wait_for_ntp(void); #ifdef __cplusplus } /* extern "C" */ diff --git a/ide/Espressif/ESP-IDF/examples/wolfssh_echoserver/main/main.c b/ide/Espressif/ESP-IDF/examples/wolfssh_echoserver/main/main.c index 4912da33..1806d9fc 100644 --- a/ide/Espressif/ESP-IDF/examples/wolfssh_echoserver/main/main.c +++ b/ide/Espressif/ESP-IDF/examples/wolfssh_echoserver/main/main.c @@ -46,7 +46,7 @@ static const char* const TAG = "My Project"; void app_main(void) { func_args args = {0}; - int ret = ESP_OK; + esp_err_t ret = ESP_OK; ESP_LOGI(TAG, "------------ wolfSSL wolfSSH template Example ----------"); ESP_LOGI(TAG, "--------------------------------------------------------"); diff --git a/ide/Espressif/ESP-IDF/examples/wolfssh_echoserver/main/time_helper.c b/ide/Espressif/ESP-IDF/examples/wolfssh_echoserver/main/time_helper.c index 85dae5b7..012aa10c 100644 --- a/ide/Espressif/ESP-IDF/examples/wolfssh_echoserver/main/time_helper.c +++ b/ide/Espressif/ESP-IDF/examples/wolfssh_echoserver/main/time_helper.c @@ -91,7 +91,7 @@ char* ntpServerList[NTP_SERVER_COUNT] = NTP_SERVER_LIST; extern char* ntpServerList[NTP_SERVER_COUNT]; /* Show the current date and time */ -int esp_show_current_datetime() +esp_err_t esp_show_current_datetime() { time_t now; char strftime_buf[64]; @@ -108,7 +108,7 @@ int esp_show_current_datetime() } /* the worst-case scenario is a hard-coded date/time */ -int set_fixed_default_time(void) +esp_err_t set_fixed_default_time(void) { /* ideally, we'd like to set time from network, * but let's set a default time, just in case */ @@ -138,7 +138,7 @@ int set_fixed_default_time(void) * * returns 0 = success if able to set the time from the provided string * error for any other value, typically -1 */ -int set_time_from_string(char* time_buffer) +esp_err_t set_time_from_string(const char* time_buffer) { /* expecting github default formatting: 'Thu Aug 31 12:41:45 2023 -0700' */ const char *format = "%3s %3s %d %d:%d:%d %d %s"; @@ -222,7 +222,7 @@ int set_time_from_string(char* time_buffer) } /* set time; returns 0 if succecssfully configured with NTP */ -int set_time(void) +esp_err_t set_time(void) { #ifndef NTP_SERVER_COUNT ESP_LOGW(TAG, "Warning: no sntp server names defined. " @@ -319,7 +319,7 @@ int set_time(void) } /* wait for NTP to actually set the time */ -int set_time_wait_for_ntp(void) +esp_err_t set_time_wait_for_ntp(void) { int ret = 0; #ifdef HAS_ESP_NETIF_SNTP diff --git a/ide/Espressif/ESP-IDF/examples/wolfssh_template/components/wolfssh/CMakeLists.txt b/ide/Espressif/ESP-IDF/examples/wolfssh_template/components/wolfssh/CMakeLists.txt index d5d20c62..41080b2f 100644 --- a/ide/Espressif/ESP-IDF/examples/wolfssh_template/components/wolfssh/CMakeLists.txt +++ b/ide/Espressif/ESP-IDF/examples/wolfssh_template/components/wolfssh/CMakeLists.txt @@ -17,7 +17,7 @@ # You should have received a copy of the GNU General Public License # along with wolfSSH. If not, see . # -# cmake for WOLFSSH Espressif projects v5.6.6 r1 +# cmake for wolfssh Espressif projects v5.7.6 (template pr) # # See https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/build-system.html # @@ -317,27 +317,27 @@ else() message(STATUS "************************************************************************************************") FIND_WOLFSSH_DIRECTORY(WOLFSSH_ROOT) - # Check to see if we're already in WOLFSSH, and only if WOLFSSH_ROOT not specified + # Check to see if we're already in wolfssh, and only if WOLFSSH_ROOT not specified if ("${WOLFSSH_ROOT}" STREQUAL "") - # WOLFSSH examples are 7 directories deep from WOLFSSH repo root + # wolfssh examples are 7 directories deep from wolfssh repo root # 1 2 3 4 5 6 7 set(THIS_RELATIVE_PATH "../../../../../../..") get_filename_component(THIS_SEARCH_PATH "${THIS_RELATIVE_PATH}" ABSOLUTE) message(STATUS "Searching in path = ${THIS_SEARCH_PATH}") if (EXISTS "${THIS_SEARCH_PATH}/wolfcrypt/src") - # we're already in WOLFSSH examples! + # we're already in wolfssh examples! get_filename_component(WOLFSSH_ROOT "${THIS_SEARCH_PATH}" ABSOLUTE) - message(STATUS "Using WOLFSSH example with root ${WOLFSSH_ROOT}") + message(STATUS "Using wolfssh example with root ${WOLFSSH_ROOT}") else() # We're in some other repo such as wolfssh, so we'll search for an - # adjacent-level directory for WOLFSSH. (8 directories up, then down one) + # adjacent-level directory for wolfssh. (8 directories up, then down one) # - # For example WOLFSSH examples: - # C:\workspace\WOLFSSH-gojimmypi\IDE\Espressif\ESP-IDF\examples\WOLFSSH_benchmark\components\WOLFSSH + # For example wolfssh examples: + # C:\workspace\wolfssh-gojimmypi\IDE\Espressif\ESP-IDF\examples\wolfssh_benchmark\components\wolfssh # # For example wolfSSH examples: - # C:\workspace\wolfssh-gojimmypi\ide\Espressif\ESP-IDF\examples\wolfssh_benchmark\components\WOLFSSH + # C:\workspace\wolfssh-gojimmypi\ide\Espressif\ESP-IDF\examples\wolfssh_benchmark\components\wolfssh # # 1 2 3 4 5 6 7 8 set(THIS_RELATIVE_PATH "../../../../../../../..") @@ -356,7 +356,7 @@ else() get_filename_component(THIS_DIR "${CMAKE_CURRENT_SOURCE_DIR}" ABSOLUTE) message(STATUS "THIS_DIR = ${THIS_DIR}") - # find the user name to search for possible "WOLFSSH-username" + # find the user name to search for possible "wolfssh-username" message(STATUS "USERNAME = $ENV{USERNAME}") if( "$ENV{USER}" STREQUAL "" ) # the bash user if( "$ENV{USERNAME}" STREQUAL "" ) # the Windows user @@ -371,35 +371,35 @@ else() endif() message(STATUS "THIS_USER = ${THIS_USER}") - # This same makefile is used for both the WOLFSSH component, and other - # components that may depend on WOLFSSH, such as wolfssh. Therefore - # we need to determine if this makefile is in the WOLFSSH repo, or + # This same makefile is used for both the wolfssh component, and other + # components that may depend on wolfssh, such as wolfssh. Therefore + # we need to determine if this makefile is in the wolfssh repo, or # some other repo. if( "{THIS_USER}" STREQUAL "" ) # This is highly unusual to not find a user name. - # In this case, we'll just search for a "WOLFSSH" directory: + # In this case, we'll just search for a "wolfssh" directory: message(STATUS "No username found!") - get_filename_component(WOLFSSH_ROOT "${THIS_RELATIVE_PATH}/WOLFSSH" ABSOLUTE) + get_filename_component(WOLFSSH_ROOT "${THIS_RELATIVE_PATH}/wolfssh" ABSOLUTE) else() # We found an environment USER name! - # The first place to look for WOLFSSH will be in a user-clone called "WOLFSSH-[username]" - message(STATUS "Using [THIS_USER = ${THIS_USER}] to see if there's a [relative path]/WOLFSSH-${THIS_USER} directory.") - get_filename_component(WOLFSSH_ROOT "${THIS_RELATIVE_PATH}/WOLFSSH-${THIS_USER}" ABSOLUTE) + # The first place to look for wolfssh will be in a user-clone called "wolfssh-[username]" + message(STATUS "Using [THIS_USER = ${THIS_USER}] to see if there's a [relative path]/wolfssh-${THIS_USER} directory.") + get_filename_component(WOLFSSH_ROOT "${THIS_RELATIVE_PATH}/wolfssh-${THIS_USER}" ABSOLUTE) if( EXISTS "${WOLFSSH_ROOT}" ) - message(STATUS "Found WOLFSSH in user-suffix ${WOLFSSH_ROOT}") + message(STATUS "Found wolfssh in user-suffix ${WOLFSSH_ROOT}") else() - # If there's not a user-clone called "WOLFSSH-[username]", - # perhaps there's simply a git clone called "WOLFSSH"? - message(STATUS "Did not find WOLFSSH-${THIS_USER}; continuing search...") - get_filename_component(WOLFSSH_ROOT "${THIS_RELATIVE_PATH}/WOLFSSH" ABSOLUTE) + # If there's not a user-clone called "wolfssh-[username]", + # perhaps there's simply a git clone called "wolfssh"? + message(STATUS "Did not find wolfssh-${THIS_USER}; continuing search...") + get_filename_component(WOLFSSH_ROOT "${THIS_RELATIVE_PATH}/wolfssh" ABSOLUTE) if( EXISTS "${WOLFSSH_ROOT}" ) - message(STATUS "Found WOLFSSH in standard ${WOLFSSH_ROOT}") + message(STATUS "Found wolfssh in standard ${WOLFSSH_ROOT}") else() # Things are looking pretty bleak. We'll likely not be able to compile. - message(STATUS "Did not find WOLFSSH in ${WOLFSSH_ROOT}") + message(STATUS "Did not find wolfssh in ${WOLFSSH_ROOT}") endif() endif() endif() @@ -426,8 +426,8 @@ else() if( EXISTS "${WOLFSSH_ROOT}" ) message(STATUS "WOLFSSH_ROOT = ${WOLFSSH_ROOT}") else() - # Abort. We need WOLFSSH _somewhere_. - message(FATAL_ERROR "Could not find WOLFSSH in ${WOLFSSH_ROOT}. Try setting environment variable or git clone.") + # Abort. We need wolfssh _somewhere_. + message(FATAL_ERROR "Could not find wolfssh in ${WOLFSSH_ROOT}. Try setting environment variable or git clone.") endif() @@ -488,12 +488,12 @@ else() # We need to now determine if it is local and if so if it is part of the wolfssh repo, # or if wolfssh is simply installed as a local component. # - + message(STATUS "Looking at WOLFSSH_PROJECT_DIR = '${WOLFSSH_PROJECT_DIR}'") if( EXISTS "${WOLFSSH_PROJECT_DIR}" ) # # wolfssh found in local project. # - if( EXISTS "${WOLFSSH_PROJECT_DIR}/wolfcrypt/" ) + if( EXISTS "${WOLFSSH_PROJECT_DIR}/wolfssh/" ) message(STATUS "") message(STATUS "Using installed project ./components/wolfssh in CMAKE_HOME_DIRECTORY = ${CMAKE_HOME_DIRECTORY}") message(STATUS "") diff --git a/ide/include.am b/ide/include.am index 2982e4e6..9e4e1bbd 100644 --- a/ide/include.am +++ b/ide/include.am @@ -1,12 +1,12 @@ -# vim:ft=automake -# included from Top Level Makefile.am -# All paths should be given relative to the root - -include ide/CSBENCH/include.am -incldue ide/Espressif/include.am -include ide/IAR-EWARM/include.am -include ide/MQX/include.am -include ide/STM32CUBE/include.am -include ide/winvs/include.am - -EXTRA_DIST += ide/Renesas +# vim:ft=automake +# included from Top Level Makefile.am +# All paths should be given relative to the root + +include ide/CSBENCH/include.am +include ide/Espressif/include.am +include ide/IAR-EWARM/include.am +include ide/MQX/include.am +include ide/STM32CUBE/include.am +include ide/winvs/include.am + +EXTRA_DIST += ide/Renesas