forked from wolfSSL/wolfssh
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
34 changed files
with
3,270 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
# wolfSSH Espressif Component Install | ||
|
||
|
||
# ESP-IDF port | ||
## Overview | ||
ESP-IDF development framework with wolfSSL by setting *WOLFSSL_ESPIDF* definition | ||
|
||
Including the following examples: | ||
|
||
* SSH UART Server | ||
|
||
The `user_settings.h` file enables some of the hardened settings. | ||
|
||
## Requirements | ||
1. [ESP-IDF development framework](https://docs.espressif.com/projects/esp-idf/en/latest/get-started/) | ||
|
||
2. The wolfSSH component requires the [wolfssl component](https://github.com/wolfSSL/wolfssl/tree/master/IDE/Espressif/ESP-IDF) be installed first. | ||
|
||
|
||
## Setup for Linux | ||
1. Run `setup.sh` at _/path/to_`/wolfssl/IDE/Espressif/ESP-IDF/` to deploy files into ESP-IDF tree | ||
2. Find Wolfssl files at _/path/to/esp_`/esp-idf/components/wolfssl/` | ||
3. Find [Example programs](https://github.com/wolfSSL/wolfssl/tree/master/IDE/Espressif/ESP-IDF/examples) under _/path/to/esp_`/esp-idf/examples/protocols/wolfssl_xxx` (where xxx is the project name) | ||
|
||
## Setup for Windows ESP-IDF | ||
1. Run ESP-IDF Command Prompt (cmd.exe) or Run ESP-IDF PowerShell Environment. The component path should be in "%IDF_PATH%". | ||
2. Run `setup_win.bat` at `.\IDE\Espressif\ESP-IDF\` | ||
|
||
``` | ||
cd ESP-IDF | ||
setup_win.bat | ||
``` | ||
|
||
3. Find Wolfssl files at _/path/to/esp_`/esp-idf/components/wolfssl/` | ||
|
||
## Setup for Windows ESP-IDF Project | ||
|
||
Install a static copy of wolfSSH into a specific project component directory. | ||
|
||
``` | ||
cd ESP-IDF | ||
setup_win.bat C:\workspace\wolfssh\examples\ESP32-SSH-Server | ||
``` | ||
|
||
## Setup for Windows VisualGDB. | ||
|
||
Install a static copy of wolfSSH into shared VisualGDB component directory | ||
|
||
``` | ||
cd ESP-IDF | ||
setup_win.bat C:\SysGCC\esp32\esp-idf\v4.4 | ||
``` | ||
|
||
|
||
|
||
|
||
|
||
|
||
## Configuration | ||
1. The `user_settings.h` can be found in _/path/to/esp_`/esp-idf/components/wolfssl/include/user_settings.h` | ||
|
||
## Build examples | ||
1. See README in each example folder | ||
|
||
## Support | ||
For question please email [[email protected]] | ||
|
||
Note: This is tested with : | ||
- OS: Ubuntu 20.04.3 LTS and Microsoft Windows 10 Pro 10.0.19041 and well as WSL Ubuntu | ||
- ESP-IDF: ESP-IDF v4.3.2 | ||
- Module : ESP32-WROOM-32 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
# | ||
# Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved. | ||
# | ||
# This file is part of wolfSSH. | ||
# | ||
# Contact [email protected] with any questions or comments. | ||
# | ||
# https://www.wolfssl.com | ||
#/ | ||
|
||
# | ||
# This is the CMakeLists.txt for the Espressif ESP-IDF wolfSSH component | ||
# | ||
cmake_minimum_required(VERSION 3.5) | ||
|
||
if( "$ENV{IDF_COMPONENT_REGISTRY_URL}" STREQUAL "https://components-staging.espressif.com" ) | ||
message(STATUS "Using Staging Component Test for wolfSSL: mywolfssl") | ||
set(WOLFSSL_COMPONENT_NAME "mywolfssl") | ||
else() | ||
set(WOLFSSL_COMPONENT_NAME "wolfssl") | ||
endif() | ||
|
||
# These flags apply only to compiling this component independently. | ||
# be sure to include this like in the root CMakeFiles.txt | ||
# for proper application-wide use of WOLFSSL_USER_SETTINGS: | ||
# | ||
# add_compile_definitions("WOLFSSL_USER_SETTINGS") | ||
# add_compile_definitions("WOLFSSH_USER_SETTINGS") | ||
# | ||
# if using ESP-IDF prior to 4.4, see: | ||
# https://github.com/wolfSSL/wolfssl/issues/5727 | ||
if (CONFIG_DEBUG_WOLFSSH) | ||
message(STATUS "Config DEBUG_WOLFSSH is enabled for components/wolfssh") | ||
endif() | ||
|
||
if (WOLFSSL_USER_SETTINGS) | ||
message(STATUS "Component wolfssh: Found predefined WOLFSSL_USER_SETTINGS") | ||
else() | ||
# wolfSSL settings should have occurred in project makefiles | ||
#message(WARNING "Component wolfssh: Setting WOLFSSL_USER_SETTINGS \ | ||
#(should have been a project-wide setting)") | ||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DWOLFSSL_USER_SETTINGS") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DWOLFSSL_USER_SETTINGS") | ||
endif() | ||
|
||
if (WOLFSSH_USER_SETTINGS) | ||
message(STATUS "Component wolfssh: Found predefined WOLFSSH_USER_SETTINGS") | ||
else() | ||
# wolfSSL settings should have occurred in project makefiles. See | ||
message(WARNING "Component wolfssh: Setting WOLFSSH_USER_SETTINGS | ||
(should have been a project-wide setting)") | ||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DWOLFSSH_USER_SETTINGS") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DWOLFSSH_USER_SETTINGS") | ||
endif() | ||
|
||
|
||
message(STATUS "wolfssh CMAKE_C_FLAGS = ${CMAKE_C_FLAGS}") | ||
|
||
set(CMAKE_CURRENT_SOURCE_DIR ".") | ||
set(WOLFSSL_ROOT ${CMAKE_CURRENT_SOURCE_DIR}) | ||
set(INCLUDE_PATH ${WOLFSSL_ROOT}) | ||
|
||
set(COMPONENT_SRCDIRS | ||
"./src/" | ||
) | ||
|
||
|
||
set(COMPONENT_REQUIRES lwip "${WOLFSSL_COMPONENT_NAME}") | ||
|
||
set(COMPONENT_ADD_INCLUDEDIRS | ||
"." | ||
) | ||
|
||
|
||
# list(REMOVE_ITEM ASM_FILES ".*\\.(asm|S)") | ||
|
||
message(STATUS "WOLFSSL_ROOT = ${WOLFSSL_ROOT}") | ||
message(STATUS "ASM_FILES = ${ASM_FILES}") | ||
|
||
|
||
#TODO remove: | ||
#idf_component_register( | ||
#SRC_DIRS "${COMPONENT_SRCDIRS}" | ||
#INCLUDE_DIRS "${COMPONENT_ADD_INCLUDEDIRS}" | ||
#REQUIRES "${COMPONENT_REQUIRES}" | ||
#EXCLUDE_SRCS "${COMPONENT_SRCEXCLUDE}" | ||
## SRCS wolfssl/wolfcrypt/test/test.c | ||
#) | ||
if(CMAKE_BUILD_EARLY_EXPANSION) | ||
message(STATUS "wolfssl component CMAKE_BUILD_EARLY_EXPANSION:") | ||
idf_component_register( | ||
REQUIRES "${COMPONENT_REQUIRES}" | ||
) | ||
else() | ||
idf_component_register( | ||
SRC_DIRS "${COMPONENT_SRCDIRS}" | ||
INCLUDE_DIRS "${COMPONENT_ADD_INCLUDEDIRS}" | ||
REQUIRES "${COMPONENT_REQUIRES}" | ||
EXCLUDE_SRCS "${COMPONENT_SRCEXCLUDE}" | ||
PRIV_REQUIRES "${WOLFSSL_COMPONENT_NAME}" # this will typically only be needed for wolfSSL benchmark | ||
) | ||
endif() | ||
|
||
# check to see if there's both a local copy and EDP-IDF copy of the wolfssh components | ||
if( EXISTS "${CMAKE_HOME_DIRECTORY}/components/wolfssh/" AND EXISTS "$ENV{IDF_PATH}/components/wolfssh/" ) | ||
message(STATUS "") | ||
message(WARNING "WARNING: Found components/wolfssh in both local project and IDF_PATH") | ||
message(STATUS "") | ||
endif() | ||
# end multiple component check | ||
|
Oops, something went wrong.