├── .github └── workflows │ ├── cppcheck.yml │ ├── kyber.yml │ ├── os-check.yml │ ├── paramiko-sftp-test.yml │ ├── scp-test.yml │ ├── sftp-test.yml │ ├── singlethread-check.yml │ ├── sshd-test.yml │ ├── test-fatfs.yml │ ├── tpm-ssh.yml │ ├── windows-check.yml │ └── zephyr.yml ├── .gitignore ├── ChangeLog.md ├── LICENSING ├── Makefile.am ├── README.md ├── apps ├── include.am ├── wolfssh │ ├── README.md │ ├── common.c │ ├── common.h │ ├── include.am │ └── wolfssh.c └── wolfsshd │ ├── auth.c │ ├── auth.h │ ├── configuration.c │ ├── configuration.h │ ├── include.am │ ├── test │ ├── README.md │ ├── create_authorized_test_file.sh │ ├── create_sshd_config.sh │ ├── error_return.sh │ ├── run_all_sshd_tests.sh │ ├── ssh_kex_algos.sh │ ├── sshd_bad_sftp_test.sh │ ├── sshd_exec_test.sh │ ├── sshd_forcedcmd_test.sh │ ├── sshd_large_sftp_test.sh │ ├── sshd_login_grace_test.sh │ ├── sshd_scp_fail.sh │ ├── sshd_term_close_test.sh │ ├── sshd_term_size_test.sh │ ├── sshd_window_full_test.sh │ ├── sshd_x509_test.sh │ ├── start_sshd.sh │ └── test_configuration.c │ └── wolfsshd.c ├── autogen.sh ├── configure.ac ├── examples ├── client │ ├── client.c │ ├── client.h │ ├── common.c │ ├── common.h │ └── include.am ├── echoserver │ ├── echoserver.c │ ├── echoserver.h │ └── include.am ├── include.am ├── portfwd │ ├── include.am │ ├── portfwd.c │ └── wolfssh_portfwd.h ├── scpclient │ ├── include.am │ ├── scpclient.c │ └── scpclient.h └── sftpclient │ ├── include.am │ ├── sftpclient.c │ └── sftpclient.h ├── gencertbuf.pl ├── ide ├── CSBENCH │ ├── .cproject │ ├── .project │ ├── README │ └── include.am ├── Espressif │ ├── ESP-IDF │ │ ├── default_espressif_options.h │ │ ├── examples │ │ │ ├── README.md │ │ │ ├── wolfssh_echoserver │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── README.md │ │ │ │ ├── VisualGDB │ │ │ │ │ ├── wolfssh_echoserver_IDF_v5.1_ESP32.sln │ │ │ │ │ └── wolfssh_echoserver_IDF_v5.1_ESP32.vgdbproj │ │ │ │ ├── components │ │ │ │ │ ├── wolfssh │ │ │ │ │ │ └── CMakeLists.txt │ │ │ │ │ └── wolfssl │ │ │ │ │ │ ├── CMakeLists.txt │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ └── include │ │ │ │ │ │ └── user_settings.h │ │ │ │ ├── main │ │ │ │ │ ├── CMakeLists.txt │ │ │ │ │ ├── echoserver.c │ │ │ │ │ ├── include │ │ │ │ │ │ ├── echoserver.h │ │ │ │ │ │ ├── main.h │ │ │ │ │ │ ├── time_helper.h │ │ │ │ │ │ └── wifi_connect.h │ │ │ │ │ ├── main.c │ │ │ │ │ ├── time_helper.c │ │ │ │ │ └── wifi_connect.c │ │ │ │ ├── partitions_singleapp_large.csv │ │ │ │ └── sdkconfig.defaults │ │ │ └── wolfssh_template │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── README.md │ │ │ │ ├── VisualGDB │ │ │ │ ├── wolfssh_template_IDF_v5.1_ESP32.sln │ │ │ │ └── wolfssh_template_IDF_v5.1_ESP32.vgdbproj │ │ │ │ ├── components │ │ │ │ ├── wolfssh │ │ │ │ │ └── CMakeLists.txt │ │ │ │ └── wolfssl │ │ │ │ │ ├── CMakeLists.txt │ │ │ │ │ ├── README.md │ │ │ │ │ └── include │ │ │ │ │ └── user_settings.h │ │ │ │ ├── main │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── include │ │ │ │ │ └── main.h │ │ │ │ └── main.c │ │ │ │ ├── partitions_singleapp_large.csv │ │ │ │ └── sdkconfig.defaults │ │ ├── libs │ │ │ ├── CMakeLists.txt │ │ │ └── component.mk │ │ ├── setup.sh │ │ ├── setup_win.bat │ │ └── wolfssh_espressif_semaphore.md │ └── README.md ├── IAR-EWARM │ ├── Projects │ │ ├── README.md │ │ ├── echoserver │ │ │ ├── echoserver.ewd │ │ │ └── echoserver.ewp │ │ ├── lib │ │ │ ├── myFilesystem.h │ │ │ ├── wolfSSH-Lib.ewd │ │ │ └── wolfSSH-Lib.ewp │ │ └── user_settings.h │ └── include.am ├── Linux-FATFS │ ├── .gitignore │ ├── Makefile │ ├── README.md │ ├── fatfs_example.c │ └── ffconf.h ├── MQX │ ├── Makefile │ ├── README-jp.md │ ├── README.md │ └── include.am ├── Renesas │ └── cs+ │ │ ├── README.md │ │ ├── README_jp.md │ │ ├── common │ │ ├── strings.h │ │ ├── unistd.h │ │ ├── user_settings.h │ │ └── wolfssh_csplus_usersettings.h │ │ ├── demo_server │ │ ├── demo_server.mtpj │ │ ├── wolfssh_demo.c │ │ ├── wolfssh_demo.h │ │ └── wolfssh_dummy.c │ │ ├── wolfssh_lib │ │ └── wolfssh_lib.mtpj │ │ └── wolfssl_lib │ │ └── wolfssl_lib.mtpj ├── STM32CUBE │ ├── README.md │ ├── default_conf.ftl │ ├── include.am │ ├── main.c │ ├── myFilesystem.h │ ├── userio_template.h │ ├── wolfssh_test.c │ └── wolfssh_test.h ├── include.am ├── mplabx │ ├── README.md │ ├── include.am │ ├── user_settings.h │ ├── wolfssh.X │ │ ├── Makefile │ │ ├── mcc-manifest-generated-success.yml │ │ ├── nbproject │ │ │ ├── configurations.xml │ │ │ └── project.xml │ │ └── wolfssh.mc3 │ └── wolfssh.c └── winvs │ ├── README.md │ ├── api-test │ └── api-test.vcxproj │ ├── client │ └── client.vcxproj │ ├── echoserver │ └── echoserver.vcxproj │ ├── include.am │ ├── testsuite │ └── testsuite.vcxproj │ ├── unit-test │ └── unit-test.vcxproj │ ├── user_settings.h │ ├── wolfsftp-client │ └── wolfsftp-client.vcxproj │ ├── wolfssh.props │ ├── wolfssh.sln │ ├── wolfssh │ └── wolfssh.vcxproj │ └── wolfsshd │ └── wolfsshd.vcxproj ├── keys ├── ca-cert-ecc.der ├── ca-cert-ecc.pem ├── ca-key-ecc.der ├── ca-key-ecc.pem ├── fred-cert.der ├── fred-cert.pem ├── fred-key.der ├── fred-key.pem ├── gretel-key-ecc-384.der ├── gretel-key-ecc-384.pem ├── gretel-key-ecc-384.pub ├── gretel-key-ecc-521.der ├── gretel-key-ecc-521.pem ├── gretel-key-ecc-521.pub ├── gretel-key-ecc.der ├── gretel-key-ecc.pem ├── gretel-key-ecc.pub ├── gretel-key-rsa.der ├── gretel-key-rsa.pem ├── gretel-key-rsa.pub ├── hansel-key-ecc-384.der ├── hansel-key-ecc-384.pem ├── hansel-key-ecc-384.pub ├── hansel-key-ecc-521.der ├── hansel-key-ecc-521.pem ├── hansel-key-ecc-521.pub ├── hansel-key-ecc.der ├── hansel-key-ecc.pem ├── hansel-key-ecc.pub ├── hansel-key-rsa.der ├── hansel-key-rsa.pem ├── hansel-key-rsa.pub ├── id_barney ├── id_barney.pub ├── id_ecdsa ├── id_ecdsa.pub ├── id_rsa ├── id_rsa.pub ├── include.am ├── john-key.pub ├── passwd.txt ├── pubkeys-ecc-384.txt ├── pubkeys-ecc-521.txt ├── pubkeys-ecc.txt ├── pubkeys-rsa.txt ├── putty_rsa.ppk ├── putty_rsa.pub ├── renewcerts.cnf ├── renewcerts.sh ├── server-cert.der ├── server-cert.pem ├── server-key-ecc-384.der ├── server-key-ecc-384.pem ├── server-key-ecc-521.der ├── server-key-ecc-521.pem ├── server-key-ecc.der ├── server-key-ecc.pem ├── server-key-rsa.der ├── server-key-rsa.pem └── server-key.pem ├── m4 ├── ax_add_am_macro.m4 ├── ax_am_jobserver.m4 ├── ax_am_macros.m4 ├── ax_append_compile_flags.m4 ├── ax_append_flag.m4 ├── ax_append_link_flags.m4 ├── ax_append_to_file.m4 ├── ax_check_compile_flag.m4 ├── ax_check_library.m4 ├── ax_check_link_flag.m4 ├── ax_compiler_version.m4 ├── ax_count_cpus.m4 ├── ax_create_generic_config.m4 ├── ax_debug.m4 ├── ax_file_escapes.m4 ├── ax_harden_compiler_flags.m4 ├── ax_print_to_file.m4 ├── ax_pthread.m4 ├── ax_require_defined.m4 ├── ax_vcs_checkout.m4 ├── hexversion.m4 ├── lib-ld.m4 ├── lib-link.m4 ├── lib-prefix.m4 └── visibility.m4 ├── scripts ├── external.test ├── get-put.test ├── include.am ├── scp.test └── sftp.test ├── src ├── agent.c ├── certman.c ├── include.am ├── internal.c ├── io.c ├── keygen.c ├── log.c ├── misc.c ├── port.c ├── ssh.c ├── wolfscp.c ├── wolfsftp.c └── wolfterm.c ├── sshd_config ├── tests ├── api.c ├── api.h ├── auth.c ├── auth.h ├── include.am ├── kex.c ├── kex.h ├── sftp.c ├── sftp.h ├── testsuite.c ├── testsuite.h ├── unit.c └── unit.h ├── wolfssh ├── agent.h ├── certman.h ├── certs_test.h ├── error.h ├── include.am ├── internal.h ├── keygen.h ├── log.h ├── misc.h ├── port.h ├── settings.h ├── ssh.h ├── test.h ├── version.h ├── version.h.in ├── visibility.h ├── wolfscp.h └── wolfsftp.h └── zephyr ├── CMakeLists.txt ├── Kconfig ├── README.md ├── module.yml └── samples └── tests ├── CMakeLists.txt ├── prj.conf ├── prj_nofs.conf ├── sample.yaml ├── tests.c ├── wolfssh_user_settings.h ├── wolfssh_user_settings_nofs.h ├── wolfssl_user_settings.h └── wolfssl_user_settings_nofs.h /.github/workflows/cppcheck.yml: -------------------------------------------------------------------------------- 1 | name: Cppcheck Test 2 | 3 | on: 4 | push: 5 | branches: [ '*' ] 6 | pull_request: 7 | branches: [ '*' ] 8 | 9 | jobs: 10 | run_cppcheck: 11 | name: Cppcheck 12 | runs-on: ubuntu-24.04 13 | steps: 14 | - uses: actions/checkout@v4 15 | 16 | - name: Install cppcheck 17 | if: always() 18 | run: sudo apt-get install cppcheck 19 | 20 | - name: Run CppCheck 21 | id: cpp_check_run 22 | if: always() 23 | run: > 24 | cppcheck 25 | -UWSCPFILEHDR -UXSNPRINTF 26 | -DLIBWOLFSSH_VERSION_STRING='""' 27 | --enable='warning,portability' 28 | --std=c99 29 | --force 30 | --check-level=exhaustive 31 | --error-exitcode=2 32 | --library=std.cfg 33 | --inline-suppr 34 | -j4 35 | -q 36 | . 37 | 3>&1 1>&2 2>&3 | tee cppcheck.txt 38 | 39 | - name: Upload cppcheck results as artifact 40 | if: always() 41 | uses: actions/upload-artifact@v4 42 | with: 43 | name: wolfssh-${{ github.sha }}-cppcheck_results.txt 44 | path: cppcheck.txt 45 | -------------------------------------------------------------------------------- /.github/workflows/singlethread-check.yml: -------------------------------------------------------------------------------- 1 | name: Single-thread Check Test 2 | 3 | on: 4 | push: 5 | branches: [ '*' ] 6 | pull_request: 7 | branches: [ '*' ] 8 | 9 | concurrency: 10 | group: ${{ github.workflow }}-${{ github.ref }} 11 | cancel-in-progress: true 12 | 13 | env: 14 | WOLFSSL_REF: v5.7.0-stable 15 | 16 | jobs: 17 | build_wolfssl: 18 | strategy: 19 | fail-fast: false 20 | matrix: 21 | os: [ ubuntu-latest, macos-latest ] 22 | name: Build wolfssl 23 | runs-on: ${{ matrix.os }} 24 | timeout-minutes: 4 25 | steps: 26 | - name: Checking cache for wolfssl 27 | uses: actions/cache@v4 28 | id: cache-wolfssl 29 | with: 30 | path: build-dir/ 31 | key: wolfssh-singlethread-check-wolfssl-${{ env.WOLFSSL_REF }}-${{ matrix.os }} 32 | lookup-only: true 33 | 34 | - name: Checkout, build, and install wolfssl 35 | if: steps.cache-wolfssl.outputs.cache-hit != 'true' 36 | uses: wolfSSL/actions-build-autotools-project@v1 37 | with: 38 | repository: wolfssl/wolfssl 39 | ref: ${{ env.WOLFSSL_REF }} 40 | path: wolfssl 41 | configure: --enable-wolfssh --enable-singlethreaded --enable-keygen 42 | check: false 43 | install: true 44 | 45 | build_wolfssh: 46 | strategy: 47 | fail-fast: false 48 | matrix: 49 | os: [ ubuntu-latest, macos-latest ] 50 | config: [ 51 | '', 52 | '--enable-all', 53 | '--enable-sftp', 54 | '--enable-scp', 55 | '--enable-shell', 56 | ] 57 | name: Build wolfssh 58 | runs-on: ${{ matrix.os }} 59 | timeout-minutes: 4 60 | needs: build_wolfssl 61 | steps: 62 | - name: Checking cache for wolfssl 63 | uses: actions/cache@v4 64 | with: 65 | path: build-dir/ 66 | key: wolfssh-singlethread-check-wolfssl-${{ env.WOLFSSL_REF }}-${{ matrix.os }} 67 | fail-on-cache-miss: true 68 | 69 | - name: Checkout, build, and test wolfssh 70 | uses: wolfSSL/actions-build-autotools-project@v1 71 | with: 72 | repository: wolfssl/wolfssh 73 | path: wolfssh 74 | configure: ${{ matrix.config }} LDFLAGS="-L${{ github.workspace }}/build-dir/lib" CPPFLAGS="-I${{ github.workspace }}/build-dir/include" 75 | check: true 76 | -------------------------------------------------------------------------------- /.github/workflows/windows-check.yml: -------------------------------------------------------------------------------- 1 | name: Windows Build Test 2 | 3 | on: 4 | push: 5 | branches: [ '*' ] 6 | pull_request: 7 | branches: [ '*' ] 8 | 9 | env: 10 | WOLFSSL_SOLUTION_FILE_PATH: wolfssl64.sln 11 | SOLUTION_FILE_PATH: wolfssh.sln 12 | USER_SETTINGS_H_NEW: wolfssh/ide/winvs/user_settings.h 13 | USER_SETTINGS_H: wolfssl/IDE/WIN/user_settings.h 14 | INCLUDE_DIR: wolfssh 15 | 16 | # Configuration type to build. 17 | # You can convert this to a build matrix if you need coverage of multiple configuration types. 18 | # https://docs.github.com/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix 19 | WOLFSSL_BUILD_CONFIGURATION: Release 20 | WOLFSSH_BUILD_CONFIGURATION: Release 21 | BUILD_PLATFORM: x64 22 | TARGET_PLATFORM: 10 23 | 24 | jobs: 25 | build: 26 | runs-on: windows-latest 27 | 28 | steps: 29 | - uses: actions/checkout@v2 30 | with: 31 | repository: wolfssl/wolfssl 32 | path: wolfssl 33 | 34 | - uses: actions/checkout@master 35 | with: 36 | path: wolfssh 37 | 38 | - name: Add MSBuild to PATH 39 | uses: microsoft/setup-msbuild@v1 40 | 41 | - name: Restore wolfSSL NuGet packages 42 | working-directory: ${{env.GITHUB_WORKSPACE}}wolfssl 43 | run: nuget restore ${{env.WOLFSSL_SOLUTION_FILE_PATH}} 44 | 45 | - name: updated user_settings.h for sshd and x509 46 | working-directory: ${{env.GITHUB_WORKSPACE}} 47 | run: cp ${{env.USER_SETTINGS_H_NEW}} ${{env.USER_SETTINGS_H}} 48 | 49 | - name: replace wolfSSL user_settings.h with wolfSSH user_settings.h 50 | working-directory: ${{env.GITHUB_WORKSPACE}} 51 | run: get-content ${{env.USER_SETTINGS_H_NEW}} | %{$_ -replace "if 0","if 1"} 52 | 53 | - name: Build wolfssl library 54 | working-directory: ${{env.GITHUB_WORKSPACE}}wolfssl 55 | run: msbuild /m /p:PlatformToolset=v142 /p:Platform=${{env.BUILD_PLATFORM}} /p:Configuration=${{env.WOLFSSL_BUILD_CONFIGURATION}} /t:wolfssl ${{env.WOLFSSL_SOLUTION_FILE_PATH}} 56 | 57 | - name: Restore NuGet packages 58 | working-directory: ${{env.GITHUB_WORKSPACE}}wolfssh\ide\winvs 59 | run: nuget restore ${{env.SOLUTION_FILE_PATH}} 60 | 61 | - name: Build wolfssh 62 | working-directory: ${{env.GITHUB_WORKSPACE}}wolfssh\ide\winvs 63 | # Add additional options to the MSBuild command line here (like platform or verbosity level). 64 | # See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference 65 | run: msbuild /m /p:PlatformToolset=v142 /p:Platform=${{env.BUILD_PLATFORM}} /p:WindowsTargetPlatformVersion=${{env.TARGET_PLATFORM}} /p:Configuration=${{env.WOLFSSH_BUILD_CONFIGURATION}} ${{env.SOLUTION_FILE_PATH}} 66 | 67 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Object files 2 | *.o 3 | *.ko 4 | *.lo 5 | 6 | # Libraries 7 | *.lib 8 | *.a 9 | *.la 10 | 11 | # Shared objects (inc. Windows DLLs) 12 | *.dll 13 | *.so 14 | *.so.* 15 | *.dylib 16 | 17 | # Executables 18 | *.exe 19 | *.out 20 | *.app 21 | 22 | # autoconf misc 23 | aclocal.m4 24 | lt*.m4 25 | *.cache 26 | config.h* 27 | configure~ 28 | config.status 29 | configure 30 | libtool 31 | libtool.m4 32 | *.log 33 | *.gz 34 | *.zip 35 | *.bak 36 | *.dummy 37 | *.xcworkspace 38 | Makefile 39 | Makefile.in 40 | *.deps 41 | .dirstamp 42 | *.libs 43 | stamp-h* 44 | src/stamp-h1 45 | build-aux/ 46 | wolfmqtt-config 47 | build-test/ 48 | build/ 49 | wolfssh-config 50 | aminclude.am 51 | 52 | # vim 53 | *.swp 54 | *.swo 55 | tags 56 | diff 57 | .vimrc 58 | 59 | # examples 60 | examples/client/client 61 | examples/echoserver/echoserver 62 | examples/server/server 63 | examples/portfwd/portfwd 64 | examples/sftpclient/wolfsftp 65 | examples/scpclient/wolfscp 66 | 67 | # applications 68 | apps/wolfssh/wolfssh 69 | apps/wolfsshd/wolfsshd 70 | apps/wolfsshd/test/test_configuration 71 | 72 | # test output 73 | tests/*.test 74 | *.trs 75 | 76 | # scan-build 77 | client.plist 78 | 79 | # misc 80 | .DS_Store 81 | 82 | # Visual Studio Code Workspace Files 83 | *.vscode 84 | *.userprefs 85 | *.exe 86 | *.dll 87 | .vs 88 | Backup 89 | UpgradeLog.htm 90 | *.aps 91 | *.VC.db 92 | *.filters 93 | 94 | # VS debris 95 | *.sdf 96 | *.v11.suo 97 | *.vcxproj.filters 98 | *.vcxproj.user 99 | *.opensdf 100 | *.pdb 101 | .vs 102 | Debug 103 | Release 104 | DLL Debug 105 | DLL Release 106 | 107 | # Eclipse 108 | .cproject 109 | .project 110 | .settings 111 | 112 | 113 | # auto-created CMake backups 114 | **/CMakeLists.txt.old 115 | 116 | # VisualGDB 117 | **/.visualgdb 118 | **/*.vgdbproj.*.user 119 | 120 | 121 | # Espressif sdk config default should be saved in sdkconfig.defaults 122 | # we won't track the actual working sdkconfig files 123 | /ide/Espressif/**/out/ 124 | /ide/Espressif/**/sdkconfig 125 | /ide/Espressif/**/sdkconfig.old 126 | 127 | # Espressif managed components to exclude: 128 | /ide/Espressif/**/managed_components/** 129 | 130 | # Espressif managed component lock files to exclude. 131 | # "In general, it's ok to have it under version control, however, it ties 132 | # the solution to the exact version of ESP-IDF and will be ignored if an 133 | # example is built against another IDF version or for a different target. 134 | # So it's better to git ignore it for the examples." 135 | /ide/Espressif/**/dependencies.lock 136 | 137 | 138 | /ide/mplabx/wolfssh.X/dist/ 139 | /ide/mplabx/wolfssh.X/.generated_files 140 | /ide/mplabx/wolfssh.X/build 141 | -------------------------------------------------------------------------------- /LICENSING: -------------------------------------------------------------------------------- 1 | 2 | wolfSSH is either licensed for use under the GPLv3 or a standard commercial 3 | license. For our users who cannot use wolfSSH under GPLv3, a commercial license 4 | to wolfSSH is available. 5 | 6 | Please contact wolfSSL Inc. directly at: 7 | 8 | Email: licensing@wolfssl.com 9 | Phone: +1 425 245-8247 10 | 11 | More information can be found on the wolfSSL website at www.wolfssl.com. 12 | 13 | -------------------------------------------------------------------------------- /Makefile.am: -------------------------------------------------------------------------------- 1 | # includes append to these: 2 | SUFFIXES = 3 | TESTS = 4 | CLEANFILES = 5 | DISTCLEANFILES = 6 | bin_PROGRAMS = 7 | noinst_HEADERS = 8 | lib_LTLIBRARIES = 9 | man_MANS = 10 | noinst_LTLIBRARIES = 11 | noinst_PROGRAMS = 12 | include_HEADERS = 13 | nobase_include_HEADERS = 14 | check_PROGRAMS = 15 | EXTRA_HEADERS = 16 | BUILT_SOURCES= 17 | EXTRA_DIST= 18 | dist_doc_DATA= 19 | dist_noinst_SCRIPTS= 20 | check_SCRIPTS= 21 | 22 | 23 | #includes additional rules from aminclude.am 24 | @INC_AMINCLUDE@ 25 | DISTCLEANFILES+= aminclude.am 26 | 27 | exampledir = $(docdir)/example 28 | dist_example_DATA= 29 | 30 | ACLOCAL_AMFLAGS= -I m4 31 | 32 | EXTRA_DIST+= LICENSING README.md ChangeLog.md 33 | 34 | include src/include.am 35 | include wolfssh/include.am 36 | include apps/include.am 37 | include examples/include.am 38 | include tests/include.am 39 | include keys/include.am 40 | include ide/include.am 41 | include scripts/include.am 42 | 43 | 44 | TEST_EXTENSIONS = .test 45 | TESTS += $(check_PROGRAMS) 46 | 47 | check_SCRIPTS+= $(dist_noinst_SCRIPTS) 48 | TESTS += $(check_SCRIPTS) 49 | 50 | test: check 51 | 52 | DISTCLEANFILES+= wolfssh-config 53 | 54 | 55 | maintainer-clean-local: 56 | -rm Makefile.in 57 | -rm aclocal.m4 58 | -rm build-aux/compile 59 | -rm build-aux/config.guess 60 | -rm build-aux/config.sub 61 | -rm build-aux/depcomp 62 | -rm build-aux/install-sh 63 | -rm build-aux/ltmain.sh 64 | -rm build-aux/missing 65 | -rm wolfssh-config 66 | -rmdir build-aux 67 | -rm configure 68 | -rm config.log 69 | -rm config.status 70 | -rm config.in 71 | -rm m4/libtool.m4 72 | -rm m4/ltoptions.m4 73 | -rm m4/ltsugar.m4 74 | -rm m4/ltversion.m4 75 | -rm m4/lt~obsolete.m4 76 | find . -type f -name '*~' -exec rm -f '{}' \; 77 | -rm -f @PACKAGE@-*.tar.gz 78 | -rm -f @PACKAGE@-*.rpm 79 | 80 | install-exec-local: install-generic-config 81 | 82 | install-generic-config: 83 | $(mkinstalldirs) $(DESTDIR)$(bindir) 84 | $(INSTALL_SCRIPT) @GENERIC_CONFIG@ $(DESTDIR)$(bindir) 85 | 86 | uninstall-local: 87 | -rm -f $(DESTDIR)$(bindir)/@GENERIC_CONFIG@ 88 | 89 | merge-clean: 90 | @find ./ | $(GREP) \.gcda | xargs rm -f 91 | @find ./ | $(GREP) \.gcno | xargs rm -f 92 | @find ./ | $(GREP) \.gz | xargs rm -f 93 | @find ./ | $(GREP) \.orig | xargs rm -f 94 | @find ./ | $(GREP) \.rej | xargs rm -f 95 | @find ./ | $(GREP) \.rpm | xargs rm -f 96 | @find ./ | $(GREP) \.THIS | xargs rm -f 97 | @find ./ | $(GREP) \.OTHER | xargs rm -f 98 | @find ./ | $(GREP) \.BASE | xargs rm -f 99 | @find ./ | $(GREP) \~$$ | xargs rm -f 100 | 101 | 102 | -------------------------------------------------------------------------------- /apps/include.am: -------------------------------------------------------------------------------- 1 | # vim:ft=automake 2 | # included from Top Level Makefile.am 3 | # All paths should be given relative to the root 4 | 5 | include apps/wolfssh/include.am 6 | include apps/wolfsshd/include.am 7 | -------------------------------------------------------------------------------- /apps/wolfssh/README.md: -------------------------------------------------------------------------------- 1 | WOLFSSH CLIENT 2 | ============== 3 | 4 | The wolfSSH client will connect to a server and try to open a terminal. It'll 5 | default the username to your current username, and it will try to use your 6 | ecdsa private key to authenticate. The key file path is hard coded to 7 | `$HOME/.ssh/id_ecdsa`. It is currently far enough along I can use it. The 8 | private keys are the ones produced by the OpenSSL command line tool, not the 9 | ssh-keygen tool. 10 | 11 | Phase 2 is going to bring reading the config files `/etc/ssh/ssh_config` and 12 | `$HOME/.ssh/config`. It will handle OpenSSH style modern keys. It will also 13 | have support for SSH-AGENT and forwarding. 14 | 15 | Command Line Options 16 | -------------------- 17 | 18 | -E logfile : Specify a different log file. 19 | -G : Print out the configuration as used. 20 | -l login_name : Overrides the login name specified in the destination. 21 | -N : Do not execute remote command. 22 | -p port : Overrides the destination port number. 23 | -V : Print out the version. 24 | 25 | The destination option is the only required option. It can be in the two 26 | following formats: 27 | 28 | [user@]hostname 29 | ssh://[user@]hostname[:port] 30 | 31 | The default value for _user_ is the current user's login name. The default 32 | value for _port_ is 22. 33 | -------------------------------------------------------------------------------- /apps/wolfssh/common.h: -------------------------------------------------------------------------------- 1 | /* common.h 2 | * 3 | * Copyright (C) 2014-2024 wolfSSL Inc. 4 | * 5 | * This file is part of wolfSSH. 6 | * 7 | * wolfSSH is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * wolfSSH is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with wolfSSH. If not, see . 19 | */ 20 | 21 | #ifndef APPS_WOLFSSH_COMMON_H 22 | #define APPS_WOLFSSH_COMMON_H 23 | 24 | WOLFSSH_LOCAL int ClientLoadCA(WOLFSSH_CTX* ctx, const char* caCert); 25 | WOLFSSH_LOCAL int ClientUsePubKey(const char* pubKeyName); 26 | WOLFSSH_LOCAL int ClientSetPrivateKey(const char* privKeyName); 27 | WOLFSSH_LOCAL int ClientUseCert(const char* certName); 28 | WOLFSSH_LOCAL int ClientSetEcho(int type); 29 | WOLFSSH_LOCAL int ClientUserAuth(byte authType, WS_UserAuthData* authData, 30 | void* ctx); 31 | WOLFSSH_LOCAL int ClientPublicKeyCheck(const byte* pubKey, word32 pubKeySz, 32 | void* ctx); 33 | WOLFSSH_LOCAL void ClientIPOverride(int flag); 34 | WOLFSSH_LOCAL void ClientFreeBuffers(void); 35 | 36 | #endif /* APPS_WOLFSSH_COMMON_H */ 37 | -------------------------------------------------------------------------------- /apps/wolfssh/include.am: -------------------------------------------------------------------------------- 1 | if BUILD_SSHCLIENT 2 | 3 | bin_PROGRAMS += apps/wolfssh/wolfssh 4 | apps_wolfssh_wolfssh_SOURCES = apps/wolfssh/wolfssh.c \ 5 | apps/wolfssh/common.c apps/wolfssh/common.h 6 | apps_wolfssh_wolfssh_LDADD = src/libwolfssh.la 7 | apps_wolfssh_wolfssh_DEPENDENCIES = src/libwolfssh.la 8 | 9 | endif BUILD_SSHCLIENT 10 | 11 | EXTRA_DIST+= apps/wolfssh/README.md 12 | -------------------------------------------------------------------------------- /apps/wolfsshd/configuration.h: -------------------------------------------------------------------------------- 1 | /* configuration.h 2 | * 3 | * Copyright (C) 2014-2024 wolfSSL Inc. 4 | * 5 | * This file is part of wolfSSH. 6 | * 7 | * wolfSSH is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * wolfSSH is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with wolfSSH. If not, see . 19 | */ 20 | 21 | #ifndef WOLFSSHD_H 22 | #define WOLFSSHD_H 23 | 24 | typedef struct WOLFSSHD_CONFIG WOLFSSHD_CONFIG; 25 | 26 | #include "auth.h" 27 | 28 | /* 0 so that privilage seperation is default on after struct memset'd on init */ 29 | #define WOLFSSHD_PRIV_SEPARAT 0 30 | #define WOLFSSHD_PRIV_SANDBOX 1 31 | #define WOLFSSHD_PRIV_OFF 2 32 | 33 | WOLFSSHD_CONFIG* wolfSSHD_ConfigNew(void* heap); 34 | void wolfSSHD_ConfigFree(WOLFSSHD_CONFIG* conf); 35 | int wolfSSHD_ConfigLoad(WOLFSSHD_CONFIG* conf, const char* filename); 36 | 37 | char* wolfSSHD_ConfigGetForcedCmd(const WOLFSSHD_CONFIG* conf); 38 | char* wolfSSHD_ConfigGetBanner(const WOLFSSHD_CONFIG* conf); 39 | char* wolfSSHD_ConfigGetChroot(const WOLFSSHD_CONFIG* conf); 40 | char* wolfSSHD_ConfigGetHostKeyFile(const WOLFSSHD_CONFIG* conf); 41 | char* wolfSSHD_ConfigGetHostCertFile(const WOLFSSHD_CONFIG* conf); 42 | char* wolfSSHD_ConfigGetUserCAKeysFile(const WOLFSSHD_CONFIG* conf); 43 | int wolfSSHD_ConfigSetHostKeyFile(WOLFSSHD_CONFIG* conf, const char* file); 44 | int wolfSSHD_ConfigSetHostCertFile(WOLFSSHD_CONFIG* conf, const char* file); 45 | int wolfSSHD_ConfigSetUserCAKeysFile(WOLFSSHD_CONFIG* conf, const char* file); 46 | word16 wolfSSHD_ConfigGetPort(const WOLFSSHD_CONFIG* conf); 47 | char* wolfSSHD_ConfigGetAuthKeysFile(const WOLFSSHD_CONFIG* conf); 48 | int wolfSSHD_ConfigGetAuthKeysFileSet(const WOLFSSHD_CONFIG* conf); 49 | int wolfSSHD_ConfigSetAuthKeysFile(WOLFSSHD_CONFIG* conf, const char* file); 50 | byte wolfSSHD_ConfigGetPermitEmptyPw(const WOLFSSHD_CONFIG* conf); 51 | byte wolfSSHD_ConfigGetPermitRoot(const WOLFSSHD_CONFIG* conf); 52 | byte wolfSSHD_ConfigGetPrivilegeSeparation(const WOLFSSHD_CONFIG* conf); 53 | long wolfSSHD_ConfigGetGraceTime(const WOLFSSHD_CONFIG* conf); 54 | byte wolfSSHD_ConfigGetPwAuth(const WOLFSSHD_CONFIG* conf); 55 | WOLFSSHD_CONFIG* wolfSSHD_GetUserConf(const WOLFSSHD_CONFIG* conf, 56 | const char* usr, const char* grp, const char* host, 57 | const char* localAdr, word16* localPort, const char* RDomain, 58 | const char* adr); 59 | void wolfSSHD_ConfigSavePID(const WOLFSSHD_CONFIG* conf); 60 | 61 | #ifdef WOLFSSHD_UNIT_TEST 62 | int ParseConfigLine(WOLFSSHD_CONFIG** conf, const char* l, int lSz); 63 | #endif 64 | 65 | #endif /* WOLFSSHD_H */ 66 | 67 | -------------------------------------------------------------------------------- /apps/wolfsshd/include.am: -------------------------------------------------------------------------------- 1 | if BUILD_SSHD 2 | 3 | bin_PROGRAMS += apps/wolfsshd/wolfsshd 4 | apps_wolfsshd_wolfsshd_SOURCES = apps/wolfsshd/wolfsshd.c \ 5 | apps/wolfsshd/configuration.c \ 6 | apps/wolfsshd/configuration.h \ 7 | apps/wolfsshd/auth.c \ 8 | apps/wolfsshd/auth.h 9 | apps_wolfsshd_wolfsshd_LDADD = src/libwolfssh.la 10 | apps_wolfsshd_wolfsshd_DEPENDENCIES = src/libwolfssh.la 11 | 12 | noinst_PROGRAMS += apps/wolfsshd/test/test_configuration 13 | apps_wolfsshd_test_test_configuration_SOURCES = apps/wolfsshd/test/test_configuration.c \ 14 | apps/wolfsshd/configuration.c \ 15 | apps/wolfsshd/configuration.h \ 16 | apps/wolfsshd/auth.c \ 17 | apps/wolfsshd/auth.h 18 | apps_wolfsshd_test_test_configuration_LDADD = src/libwolfssh.la 19 | apps_wolfsshd_test_test_configuration_DEPENDENCIES = src/libwolfssh.la 20 | apps_wolfsshd_test_test_configuration_CPPFLAGS = $(AM_CPPFLAGS) -DWOLFSSH_SSHD -DWOLFSSHD_UNIT_TEST -I$(srcdir)/apps/wolfsshd/ 21 | 22 | endif BUILD_SSHD 23 | -------------------------------------------------------------------------------- /apps/wolfsshd/test/README.md: -------------------------------------------------------------------------------- 1 | # wolfSSHd Tests 2 | 3 | These are seprate from the tests in scripts directory because of the need for 4 | 'sudo' when starting up an SSHd server to test against. 5 | 6 | ## Running Tests 7 | 8 | To run all tests do: 9 | 10 | ``` 11 | $ cd apps/wolfsshd/test/ 12 | 13 | $ sudo ./run_all_sshd_tests.sh 14 | Running all wolfSSHd tests 15 | Starting up local wolfSSHd for tests on 127.0.0.1:22222 16 | SSHD running on PID 7979 17 | sshd_exec_test.sh ... PASSED 18 | Shutting down test wolfSSHd 19 | Stopping SSHD, killing pid 7979 20 | All tests ran, 1 passed, 0 skipped 21 | 22 | ``` 23 | 24 | To run a specific test do: 25 | 26 | startup wolfSSHd 27 | ``` 28 | $ cd ./apps/wolfsshd 29 | 30 | $ sudo ./wolfsshd -D -d -f ./test/sshd_config_test 31 | [PID 8049]: [SSHD] parsing config file ./test/sshd_config_test 32 | [PID 8049]: [SSHD] Setting login grace time to 600 33 | [PID 8049]: [SSHD] Turning off privilege separation! 34 | [PID 8049]: [SSHD] Starting wolfSSH SSHD application 35 | [PID 8049]: Entering wolfSSH_CTX_new() 36 | [PID 8049]: Entering CtxInit() 37 | [PID 8049]: Leaving wolfSSH_CTX_new(), ctx = 0x5574747f3520 38 | [PID 8049]: Entering wolfSSH_CTX_SetBanner() 39 | [PID 8049]: setting banner to: "wolfSSHD 40 | " 41 | ... 42 | ... 43 | ... 44 | ``` 45 | 46 | point the test to the host/port if needed 47 | ``` 48 | $ cd ./apps/wolfsshd/test 49 | 50 | $ ./sshd_exec_test.sh 127.0.0.1 22222 51 | ``` 52 | 53 | ## Adding Tests 54 | New tests should be added to a new .sh file if not related to any of the 55 | existing tests. The test should then be called from run_all_sshd_tests.sh once 56 | added, for example: 57 | 58 | ``` 59 | run_test "new_test.sh" 60 | ``` 61 | 62 | This would be added before the call to stop the SSHd server `stop_wolfsshd` and 63 | after the test files have been setup: 64 | 65 | ``` 66 | 48 # setup 67 | 49 set -e 68 | 50 ./create_authorized_test_file.sh 69 | 51 ./create_sshd_config.sh 70 | 52 set +e 71 | ``` 72 | 73 | -------------------------------------------------------------------------------- /apps/wolfsshd/test/create_authorized_test_file.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | USER=`whoami` 4 | 5 | cat ../../../keys/hansel-*.pub > authorized_keys_test 6 | sed -i.bak "s/hansel/$USER/" ./authorized_keys_test 7 | 8 | exit 0 9 | -------------------------------------------------------------------------------- /apps/wolfsshd/test/create_sshd_config.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | PWD=`pwd` 4 | 5 | cat < sshd_config_test 6 | Port 22222 7 | Protocol 2 8 | LoginGraceTime 600 9 | PermitRootLogin yes 10 | PasswordAuthentication yes 11 | PermitEmptyPasswords no 12 | UsePrivilegeSeparation no 13 | UseDNS no 14 | HostKey $PWD/../../../keys/server-key.pem 15 | AuthorizedKeysFile $PWD/authorized_keys_test 16 | 17 | EOF 18 | 19 | cat < sshd_config_test_x509 20 | Port 22222 21 | Protocol 2 22 | LoginGraceTime 600 23 | PermitRootLogin yes 24 | PasswordAuthentication yes 25 | PermitEmptyPasswords no 26 | UsePrivilegeSeparation no 27 | UseDNS no 28 | 29 | TrustedUserCAKeys $PWD/../../../keys/ca-cert-ecc.pem 30 | HostKey $PWD/../../../keys/server-key.pem 31 | HostCertificate $PWD/../../../keys/server-cert.pem 32 | 33 | EOF 34 | 35 | cd ../../../keys/ 36 | ./renewcerts.sh $1 37 | cd ../apps/wolfsshd/test/ 38 | 39 | exit 0 40 | 41 | -------------------------------------------------------------------------------- /apps/wolfsshd/test/error_return.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # sshd local test 4 | 5 | PWD=`pwd` 6 | cd ../../.. 7 | 8 | TEST_CLIENT="./examples/client/client" 9 | USER=`whoami` 10 | PRIVATE_KEY="./keys/hansel-key-ecc.der" 11 | PUBLIC_KEY="./keys/hansel-key-ecc.pub" 12 | 13 | if [ -z "$1" ] || [ -z "$2" ]; then 14 | echo "expecting host and port as arguments" 15 | echo "./error_return.sh 127.0.0.1 22222" 16 | exit 1 17 | fi 18 | 19 | echo "$TEST_CLIENT -c 'bash -c \"(exit 2)\"' -u $USER -i $PRIVATE_KEY -j $PUBLIC_KEY -h \"$1\" -p \"$2\"" 20 | $TEST_CLIENT -c 'bash -c "(exit 2)"' -u $USER -i $PRIVATE_KEY -j $PUBLIC_KEY -h "$1" -p "$2" 21 | RESULT=$? 22 | if [ "$RESULT" != 2 ]; then 23 | echo "Expecting error return value of 2 for failed ls command, found $RESULT" 24 | cd $PWD 25 | exit 1 26 | fi 27 | 28 | cd $PWD 29 | exit 0 30 | 31 | 32 | -------------------------------------------------------------------------------- /apps/wolfsshd/test/sshd_bad_sftp_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # sshd local test 4 | 5 | PWD=`pwd` 6 | cd ../../.. 7 | 8 | TEST_SFTP_CLIENT="./examples/sftpclient/wolfsftp" 9 | USER=`whoami` 10 | PRIVATE_KEY="./keys/hansel-key-ecc.der" 11 | PUBLIC_KEY="./keys/hansel-key-ecc.pub" 12 | 13 | if [ -z "$1" ] || [ -z "$2" ]; then 14 | echo "expecting host and port as arguments" 15 | echo "./sshd_exec_test.sh 127.0.0.1 22222" 16 | exit 1 17 | fi 18 | 19 | mkdir test-$$ 20 | mkdir test-$$/subfolder 21 | 22 | echo "$TEST_SFTP_CLIENT -u $USER -i $PRIVATE_KEY -j $PUBLIC_KEY -g -l configure -r `pwd`/test-$$/subfolder/ -h \"$1\" -p \"$2\"" 23 | "$TEST_SFTP_CLIENT -u $USER -i $PRIVATE_KEY -j $PUBLIC_KEY -g -l configure -r `pwd`/test-$$/subfolder/ -h $1 -p $2" 24 | 25 | RESULT=$? 26 | if [ "$RESULT" = "0" ]; then 27 | echo "Expecting to fail transfer to folder" 28 | exit 1 29 | fi 30 | rm -rf test-$$ 31 | 32 | cd $PWD 33 | exit 0 34 | 35 | -------------------------------------------------------------------------------- /apps/wolfsshd/test/sshd_exec_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # sshd local test 4 | 5 | PWD=`pwd` 6 | cd ../../.. 7 | 8 | TEST_CLIENT="./examples/client/client" 9 | USER=`whoami` 10 | PRIVATE_KEY="./keys/hansel-key-ecc.der" 11 | PUBLIC_KEY="./keys/hansel-key-ecc.pub" 12 | 13 | if [ -z "$1" ] || [ -z "$2" ]; then 14 | echo "expecting host and port as arguments" 15 | echo "./sshd_exec_test.sh 127.0.0.1 22222" 16 | exit 1 17 | fi 18 | 19 | set -e 20 | echo "$TEST_CLIENT -c 'ls' -u $USER -i $PRIVATE_KEY -j $PUBLIC_KEY -h \"$1\" -p \"$2\"" 21 | $TEST_CLIENT -c 'ls' -u $USER -i $PRIVATE_KEY -j $PUBLIC_KEY -h "$1" -p "$2" 22 | 23 | set +e 24 | 25 | cd $PWD 26 | exit 0 27 | 28 | -------------------------------------------------------------------------------- /apps/wolfsshd/test/sshd_forcedcmd_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # sshd local test 4 | 5 | if [ -z "$1" ] || [ -z "$2" ]; then 6 | echo "expecting host and port as arguments" 7 | echo "$0 127.0.0.1 22222" 8 | exit 1 9 | fi 10 | 11 | PWD=`pwd` 12 | USER=`whoami` 13 | TEST_PORT="$2" 14 | TEST_HOST="$1" 15 | source ./start_sshd.sh 16 | cat < sshd_config_test_forcedcmd 17 | Port $TEST_PORT 18 | Protocol 2 19 | LoginGraceTime 600 20 | PermitRootLogin yes 21 | PasswordAuthentication yes 22 | PermitEmptyPasswords no 23 | UsePrivilegeSeparation no 24 | UseDNS no 25 | HostKey $PWD/../../../keys/server-key.pem 26 | AuthorizedKeysFile $PWD/authorized_keys_test 27 | 28 | Match User $USER 29 | ForceCommand internal-sftp 30 | EOF 31 | 32 | start_wolfsshd "sshd_config_test_forcedcmd" 33 | cd ../../.. 34 | 35 | TEST_CLIENT="./examples/client/client" 36 | TEST_SFTP="./examples/sftpclient/wolfsftp" 37 | PRIVATE_KEY="./keys/hansel-key-ecc.der" 38 | PUBLIC_KEY="./keys/hansel-key-ecc.pub" 39 | 40 | RESULT=$( $TEST_CLIENT -c 'echo bob' -u $USER -i $PRIVATE_KEY -j $PUBLIC_KEY -h $TEST_HOST -p $TEST_PORT ) 41 | echo $RESULT 42 | echo $RESULT | grep bob 43 | RESULT=$? 44 | if [ "$RESULT" == 0 ]; then 45 | echo "Shell login should fail with forced command" 46 | exit 1 47 | fi 48 | 49 | set -e 50 | echo exit | $TEST_SFTP -u $USER -i $PRIVATE_KEY -j $PUBLIC_KEY -h $TEST_HOST -p $TEST_PORT 51 | 52 | cd $PWD 53 | stop_wolfsshd 54 | exit 0 55 | 56 | 57 | -------------------------------------------------------------------------------- /apps/wolfsshd/test/sshd_large_sftp_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # sshd local test 4 | 5 | PWD=`pwd` 6 | cd ../../.. 7 | 8 | TEST_SFTP_CLIENT="./examples/sftpclient/wolfsftp" 9 | USER=`whoami` 10 | PRIVATE_KEY="./keys/hansel-key-ecc.der" 11 | PUBLIC_KEY="./keys/hansel-key-ecc.pub" 12 | 13 | if [ -z "$1" ] || [ -z "$2" ]; then 14 | echo "expecting host and port as arguments" 15 | echo "./sshd_exec_test.sh 127.0.0.1 22222" 16 | exit 1 17 | fi 18 | 19 | 20 | # create a large file with random data (larger than word32 max value) 21 | head -c 4400000010 < /dev/random > large-random.txt 22 | 23 | set -e 24 | echo "$TEST_SFTP_CLIENT -u $USER -i $PRIVATE_KEY -j $PUBLIC_KEY -g -l large-random.txt -r `pwd`/large-random-2.txt -h \"$1\" -p \"$2\"" 25 | $TEST_SFTP_CLIENT -u $USER -i $PRIVATE_KEY -j $PUBLIC_KEY -g -l large-random.txt -r `pwd`/large-random-2.txt -h "$1" -p "$2" 26 | 27 | cmp large-random.txt large-random-2.txt 28 | RESULT=$? 29 | if [ "$RESULT" != "0" ]; then 30 | echo "files did not match when compared" 31 | exit 1 32 | fi 33 | rm -f large-random.txt 34 | rm -f large-random-2.txt 35 | 36 | set +e 37 | 38 | cd $PWD 39 | exit 0 40 | 41 | -------------------------------------------------------------------------------- /apps/wolfsshd/test/sshd_login_grace_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # sshd local test 4 | 5 | if [ -z "$1" ] || [ -z "$2" ]; then 6 | echo "expecting host and port as arguments" 7 | echo "./sshd_exec_test.sh 127.0.0.1 22222" 8 | exit 1 9 | fi 10 | 11 | PWD=`pwd` 12 | USER=`whoami` 13 | TEST_PORT="$2" 14 | TEST_HOST="$1" 15 | 16 | if [ -f ./log.txt ]; then 17 | sudo rm -rf log.txt 18 | fi 19 | touch log.txt 20 | 21 | source ./start_sshd.sh 22 | cat < sshd_config_test_login_grace 23 | Port $TEST_PORT 24 | Protocol 2 25 | LoginGraceTime 5 26 | PermitRootLogin yes 27 | PasswordAuthentication yes 28 | PermitEmptyPasswords no 29 | UsePrivilegeSeparation no 30 | UseDNS no 31 | HostKey $PWD/../../../keys/server-key.pem 32 | AuthorizedKeysFile $PWD/authorized_keys_test 33 | EOF 34 | 35 | start_wolfsshd "sshd_config_test_login_grace" 36 | pushd ../../.. 37 | 38 | TEST_CLIENT="./examples/client/client" 39 | PRIVATE_KEY="./keys/hansel-key-ecc.der" 40 | PUBLIC_KEY="./keys/hansel-key-ecc.pub" 41 | 42 | RESULT=`$TEST_CLIENT -u $USER -i $PRIVATE_KEY -j $PUBLIC_KEY -h $TEST_HOST -p $TEST_PORT -c 'sleep 6 && echo still connected && exit'` 43 | echo "$RESULT" | grep "still connected" 44 | RESULT=$? 45 | if [ "$RESULT" != 0 ]; then 46 | echo "FAIL: Connection was not held open" 47 | exit 1 48 | fi 49 | 50 | # attempt clearing out stdin from previous echo/grep 51 | read -t 1 -n 1000 discard 52 | 53 | # test grace login timeout by stalling on password prompt 54 | timeout --foreground 7 "$TEST_CLIENT" -u "$USER" -h "$TEST_HOST" -p "$TEST_PORT" -t 55 | 56 | popd 57 | cat ./log.txt | grep "Failed login within grace period" 58 | RESULT=$? 59 | if [ "$RESULT" != 0 ]; then 60 | echo "FAIL: Grace period not hit" 61 | cat ./log.txt 62 | exit 1 63 | fi 64 | 65 | stop_wolfsshd 66 | exit 0 67 | 68 | 69 | -------------------------------------------------------------------------------- /apps/wolfsshd/test/sshd_scp_fail.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # sshd local test 4 | 5 | PWD=`pwd` 6 | cd ../../.. 7 | 8 | TEST_SCP_CLIENT="./examples/scpclient/wolfscp" 9 | USER=`whoami` 10 | PRIVATE_KEY="./keys/hansel-key-ecc.der" 11 | PUBLIC_KEY="./keys/hansel-key-ecc.pub" 12 | 13 | if [ -z "$1" ] || [ -z "$2" ]; then 14 | echo "expecting host and port as arguments" 15 | echo "./sshd_exec_test.sh 127.0.0.1 22222" 16 | exit 1 17 | fi 18 | 19 | mkdir test-$$ 20 | 21 | OUTDIR="`pwd`/test-$$" 22 | 23 | dd if=/dev/random of=$OUTDIR/test.dat bs=1024 count=512 24 | 25 | echo "$TEST_SCP_CLIENT -u $USER -i $PRIVATE_KEY -j $PUBLIC_KEY -S$OUTDIR/test.dat:. -H $1 -p $2" 26 | $TEST_SCP_CLIENT -u $USER -i $PRIVATE_KEY -j $PUBLIC_KEY -S$OUTDIR/test.dat:. -H $1 -p $2 27 | 28 | RESULT=$? 29 | if [ "$RESULT" != "0" ]; then 30 | echo "Expecting to pass transfer" 31 | exit 1 32 | fi 33 | 34 | MD5SOURCE=`md5sum $OUTDIR/test.dat | awk '{ print $1 }'` 35 | MD5DEST=`md5sum test.dat | awk '{ print $1 }'` 36 | 37 | if [ "$MD5SOURCE" != "$MD5DEST" ]; then 38 | echo "Files do not match $MD5SOURCE != $MD5DEST" 39 | exit 1 40 | fi 41 | 42 | rm -rf test-$$ 43 | rm testout.dat 44 | 45 | cd $PWD 46 | exit 0 47 | 48 | -------------------------------------------------------------------------------- /apps/wolfsshd/test/sshd_term_close_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # sshd local test 4 | 5 | ROOT_PWD=$(pwd) 6 | cd ../../.. 7 | 8 | TEST_CLIENT="./examples/client/client" 9 | PRIVATE_KEY="./keys/hansel-key-ecc.der" 10 | PUBLIC_KEY="./keys/hansel-key-ecc.pub" 11 | 12 | if [ -z "$1" ] || [ -z "$2" ] || [ -z "$3" ]; then 13 | echo "expecting host and port as arguments" 14 | echo "$0 127.0.0.1 22222 $USER" 15 | exit 1 16 | fi 17 | 18 | # get the current wolfsshd pid count to compare with 19 | WOLFSSHD_PID_COUNT=$(pgrep wolfsshd | wc -l) 20 | 21 | timeout 3 $TEST_CLIENT -p $2 -i $PRIVATE_KEY -j $PUBLIC_KEY -h $1 -c '/bin/sleep 10' -u $3 & 22 | sleep 1 23 | WOLFSSHD_PID_COUNT_AFTER=$(pgrep wolfsshd | wc -l) 24 | if [ "$WOLFSSHD_PID_COUNT" = "$WOLFSSHD_PID_COUNT_AFTER" ]; then 25 | echo "Expecting another wolfSSHd pid after connection" 26 | echo "PID count before = $WOLFSSHD_PID_COUNT" 27 | echo "PID count after = $WOLFSSHD_PID_COUNT_AFTER" 28 | exit 1 29 | fi 30 | 31 | netstat -nt | grep ESTABLISHED 32 | RESULT=$? 33 | if [ "$RESULT" != "0" ]; then 34 | echo "Expecting to find the TCP connection established" 35 | exit 1 36 | fi 37 | 38 | sleep 2 39 | 40 | netstat -nt | grep CLOSE_WAIT 41 | RESULT=$? 42 | if [ "$RESULT" = "0" ]; then 43 | echo "Found close wait and was not expecting it" 44 | exit 1 45 | fi 46 | 47 | netstat -nt | grep TIME_WAIT 48 | RESULT=$? 49 | if [ "$RESULT" != "0" ]; then 50 | echo "Did not find timed wait for TCP close down" 51 | exit 1 52 | fi 53 | 54 | cd "$ROOT_PWD" 55 | exit 0 56 | 57 | 58 | -------------------------------------------------------------------------------- /apps/wolfsshd/test/sshd_window_full_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # sshd local test 4 | 5 | if [ -z "$1" ] || [ -z "$2" ]; then 6 | echo "expecting host and port as arguments" 7 | echo "./sshd_exec_test.sh 127.0.0.1 22222" 8 | exit 1 9 | fi 10 | 11 | PWD=`pwd` 12 | 13 | if [ ! -z "$3" ]; then 14 | USER="$3" 15 | else 16 | USER=`whoami` 17 | fi 18 | TEST_PORT="$2" 19 | TEST_HOST="$1" 20 | source ./start_sshd.sh 21 | cat < sshd_config_test_window 22 | Port $TEST_PORT 23 | Protocol 2 24 | LoginGraceTime 600 25 | PermitRootLogin yes 26 | PasswordAuthentication yes 27 | PermitEmptyPasswords no 28 | UsePrivilegeSeparation no 29 | UseDNS no 30 | HostKey $PWD/../../../keys/server-key.pem 31 | AuthorizedKeysFile $PWD/authorized_keys_test 32 | EOF 33 | 34 | start_wolfsshd "sshd_config_test_window" 35 | cd ../../.. 36 | 37 | TEST_CLIENT="./examples/client/client" 38 | TEST_SFTP="./examples/sftpclient/wolfsftp" 39 | PRIVATE_KEY="./keys/hansel-key-ecc.der" 40 | PUBLIC_KEY="./keys/hansel-key-ecc.pub" 41 | 42 | head -c 1G /dev/urandom > random-test.txt 43 | 44 | PWD=`pwd` 45 | echo "$TEST_CLIENT -q -c \"cd $PWD; $TEST_CLIENT -q -c \"cat $PWD/random-test.txt\" -u $USER -i $PRIVATE_KEY -j $PUBLIC_KEY -h $TEST_HOST -p $TEST_PORT\" -u $USER -i $PRIVATE_KEY -j $PUBLIC_KEY -h $TEST_HOST -p $TEST_PORT > random-test-result.txt" 46 | 47 | $TEST_CLIENT -q -c "cd $PWD; $TEST_CLIENT -q -c \"cat $PWD/random-test.txt\" -u $USER -i $PRIVATE_KEY -j $PUBLIC_KEY -h $TEST_HOST -p $TEST_PORT" -u $USER -i $PRIVATE_KEY -j $PUBLIC_KEY -h $TEST_HOST -p $TEST_PORT > random-test-result.txt 48 | 49 | ls -la random-test* 50 | 51 | diff random-test.txt random-test-result.txt 52 | RESULT=$? 53 | if [ "$RESULT" != 0 ]; then 54 | echo "cat did not pass through all expected data" 55 | ls -la random-test.txt 56 | ls -la random-test-result.txt 57 | exit 1 58 | fi 59 | 60 | stop_wolfsshd 61 | exit 0 62 | 63 | -------------------------------------------------------------------------------- /apps/wolfsshd/test/sshd_x509_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # sshd local test 4 | 5 | PWD=`pwd` 6 | cd ../../.. 7 | 8 | if [ -z "$1" ] || [ -z "$2" ] || [ -z "$3" ]; then 9 | echo "expecting host, port and user as arguments" 10 | echo "$0 127.0.0.1 22222 user" 11 | exit 1 12 | fi 13 | 14 | TEST_CLIENT="./examples/client/client" 15 | PRIVATE_KEY="./keys/$3-key.der" 16 | PUBLIC_KEY="./keys/$3-cert.der" 17 | CA_CERT="./keys/ca-cert-ecc.der" 18 | 19 | set -e 20 | echo "$TEST_CLIENT -X -c 'pwd' -u $3 -i $PRIVATE_KEY -J $PUBLIC_KEY -A $CA_CERT -h \"$1\" -p \"$2\"" 21 | $TEST_CLIENT -X -c 'pwd' -u $3 -i "$PRIVATE_KEY" -J "$PUBLIC_KEY" -A "$CA_CERT" -h "$1" -p "$2" 22 | set +e 23 | 24 | rm -f error.txt 25 | echo "$TEST_CLIENT -X -c 'ls error' -u $3 -i $PRIVATE_KEY -J $PUBLIC_KEY -A $CA_CERT -h \"$1\" -p \"$2\" 2> error.txt" 26 | $TEST_CLIENT -X -c 'ls error' -u $3 -i "$PRIVATE_KEY" -J "$PUBLIC_KEY" -A "$CA_CERT" -h "$1" -p "$2" 2> error.txt 27 | 28 | # check stderr output was caught 29 | if [ ! -s error.txt ]; then 30 | echo "No stderr data was found when expected!!" 31 | cd $PWD 32 | exit 1 33 | fi 34 | rm -f error.txt 35 | 36 | cd $PWD 37 | exit 0 38 | 39 | -------------------------------------------------------------------------------- /apps/wolfsshd/test/start_sshd.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # starts up a sshd session, takes in the sshd_config file as an argument 4 | start_wolfsshd() { 5 | CURRENT_PIDS=`ps -e | grep wolfsshd | grep -oE "[0-9]+"` 6 | # find a port 7 | sudo ../wolfsshd -d -E ./log.txt -f $1 8 | 9 | # set the PID of started sshd 10 | NEW_PID=`ps -e | grep wolfsshd | grep -oE "[0-9]+"` 11 | PID=`diff <(echo "$CURRENT_PIDS") <(echo "$NEW_PID") | grep '>' | grep -oE "[0-9]+" | head -n1` 12 | printf "SSHD running on PID $PID\n" 13 | } 14 | 15 | # closes down the sshd session taking argument $1 as the PID of the session 16 | stop_wolfsshd() { 17 | printf "Stopping SSHD, killing pid $PID\n" 18 | sudo kill $PID 19 | } 20 | -------------------------------------------------------------------------------- /autogen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Create configure and makefile stuff... 4 | 5 | # If this is a source checkout then call autoreconf with error as well 6 | if [ -e .git ]; then 7 | WARNINGS="all,error" 8 | else 9 | WARNINGS="all" 10 | fi 11 | export WARNINGS 12 | 13 | autoreconf -ivf 14 | -------------------------------------------------------------------------------- /examples/client/client.h: -------------------------------------------------------------------------------- 1 | /* client.h 2 | * 3 | * Copyright (C) 2014-2024 wolfSSL Inc. 4 | * 5 | * This file is part of wolfSSH. 6 | * 7 | * wolfSSH is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * wolfSSH is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with wolfSSH. If not, see . 19 | */ 20 | 21 | 22 | #ifndef _WOLFSSH_EXAMPLES_CLIENT_H_ 23 | #define _WOLFSSH_EXAMPLES_CLIENT_H_ 24 | 25 | 26 | THREAD_RETURN WOLFSSH_THREAD client_test(void* args); 27 | 28 | 29 | #endif /* _WOLFSSH_EXAMPLES_CLIENT_H_ */ 30 | -------------------------------------------------------------------------------- /examples/client/common.h: -------------------------------------------------------------------------------- 1 | /* common.h 2 | * 3 | * Copyright (C) 2014-2024 wolfSSL Inc. 4 | * 5 | * This file is part of wolfSSH. 6 | * 7 | * wolfSSH is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * wolfSSH is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with wolfSSH. If not, see . 19 | */ 20 | 21 | #ifndef WOLFSSH_COMMON_H 22 | #define WOLFSSH_COMMON_H 23 | int ClientLoadCA(WOLFSSH_CTX* ctx, const char* caCert); 24 | int ClientUsePubKey(const char* pubKeyName, int userEcc, void* heap); 25 | int ClientSetPrivateKey(const char* privKeyName, int userEcc, 26 | void* heap, const char* tpmKeyAuth); 27 | int ClientUseCert(const char* certName, void* heap); 28 | int ClientSetEcho(int type); 29 | int ClientUserAuth(byte authType, 30 | WS_UserAuthData* authData, void* ctx); 31 | int ClientPublicKeyCheck(const byte* pubKey, word32 pubKeySz, void* ctx); 32 | void ClientIPOverride(int flag); 33 | void ClientFreeBuffers(const char* pubKeyName, const char* privKeyName, 34 | void* heap); 35 | #ifdef WOLFSSH_TPM 36 | int ClientSetTpm(WOLFSSH* ssh); 37 | #endif 38 | 39 | #endif /* WOLFSSH_COMMON_H */ 40 | 41 | -------------------------------------------------------------------------------- /examples/client/include.am: -------------------------------------------------------------------------------- 1 | # vim:ft=automake 2 | # All paths should be given relative to the root 3 | 4 | if BUILD_EXAMPLE_CLIENTS 5 | noinst_PROGRAMS += examples/client/client 6 | examples_client_client_SOURCES = examples/client/client.c \ 7 | examples/client/common.c \ 8 | examples/client/common.h \ 9 | examples/client/client.h 10 | examples_client_client_LDADD = src/libwolfssh.la 11 | examples_client_client_DEPENDENCIES = src/libwolfssh.la 12 | endif 13 | -------------------------------------------------------------------------------- /examples/echoserver/echoserver.h: -------------------------------------------------------------------------------- 1 | /* echoserver.h 2 | * 3 | * Copyright (C) 2014-2024 wolfSSL Inc. 4 | * 5 | * This file is part of wolfSSH. 6 | * 7 | * wolfSSH is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * wolfSSH is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with wolfSSH. If not, see . 19 | */ 20 | 21 | 22 | #ifndef _WOLFSSH_EXAMPLES_ECHOSERVER_H_ 23 | #define _WOLFSSH_EXAMPLES_ECHOSERVER_H_ 24 | 25 | 26 | THREAD_RETURN WOLFSSH_THREAD echoserver_test(void* args); 27 | int wolfSSH_Echoserver(int argc, char** argv); 28 | 29 | 30 | #endif /* _WOLFSSH_EXAMPLES_ECHOSERVER_H_ */ 31 | -------------------------------------------------------------------------------- /examples/echoserver/include.am: -------------------------------------------------------------------------------- 1 | # vim:ft=automake 2 | # All paths should be given relative to the root 3 | 4 | if BUILD_EXAMPLE_SERVERS 5 | noinst_PROGRAMS += examples/echoserver/echoserver 6 | examples_echoserver_echoserver_SOURCES = examples/echoserver/echoserver.c \ 7 | examples/echoserver/echoserver.h 8 | examples_echoserver_echoserver_LDADD = src/libwolfssh.la 9 | examples_echoserver_echoserver_DEPENDENCIES = src/libwolfssh.la 10 | examples_echoserver_echoserver_CFLAGS = $(AM_CFLAGS) ${AM_CPPFLAGS} 11 | endif 12 | -------------------------------------------------------------------------------- /examples/include.am: -------------------------------------------------------------------------------- 1 | # vim:ft=automake 2 | # included from Top Level Makefile.am 3 | # All paths should be given relative to the root 4 | 5 | include examples/client/include.am 6 | include examples/echoserver/include.am 7 | include examples/portfwd/include.am 8 | include examples/sftpclient/include.am 9 | include examples/scpclient/include.am 10 | -------------------------------------------------------------------------------- /examples/portfwd/include.am: -------------------------------------------------------------------------------- 1 | # vim:ft=automake 2 | # All paths should be given relative to the root 3 | 4 | if BUILD_FWD 5 | noinst_PROGRAMS += examples/portfwd/portfwd 6 | examples_portfwd_portfwd_SOURCES = examples/portfwd/portfwd.c \ 7 | examples/portfwd/wolfssh_portfwd.h 8 | examples_portfwd_portfwd_LDADD = src/libwolfssh.la 9 | examples_portfwd_portfwd_DEPENDENCIES = src/libwolfssh.la 10 | endif 11 | -------------------------------------------------------------------------------- /examples/portfwd/wolfssh_portfwd.h: -------------------------------------------------------------------------------- 1 | /* wolfssh_portfwd.h 2 | * 3 | * Copyright (C) 2014-2024 wolfSSL Inc. 4 | * 5 | * This file is part of wolfSSH. 6 | * 7 | * wolfSSH is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * wolfSSH is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with wolfSSH. If not, see . 19 | */ 20 | 21 | 22 | #ifndef _WOLFSSH_EXAMPLES_PORTFWD_H_ 23 | #define _WOLFSSH_EXAMPLES_PORTFWD_H_ 24 | 25 | THREAD_RETURN WOLFSSH_THREAD portfwd_worker(void* args); 26 | 27 | #endif /* _WOLFSSH_EXAMPLES_PORTFWD_H_ */ 28 | -------------------------------------------------------------------------------- /examples/scpclient/include.am: -------------------------------------------------------------------------------- 1 | # vim:ft=automake 2 | # All paths should be given relative to the root 3 | 4 | if BUILD_SCP 5 | if BUILD_EXAMPLE_CLIENTS 6 | noinst_PROGRAMS += examples/scpclient/wolfscp 7 | examples_scpclient_wolfscp_SOURCES = examples/scpclient/scpclient.c \ 8 | examples/scpclient/scpclient.h \ 9 | examples/client/common.c \ 10 | examples/client/common.h 11 | examples_scpclient_wolfscp_LDADD = src/libwolfssh.la 12 | examples_scpclient_wolfscp_DEPENDENCIES = src/libwolfssh.la 13 | endif 14 | endif 15 | -------------------------------------------------------------------------------- /examples/scpclient/scpclient.h: -------------------------------------------------------------------------------- 1 | /* scpclient.h 2 | * 3 | * Copyright (C) 2014-2024 wolfSSL Inc. 4 | * 5 | * This file is part of wolfSSH. 6 | * 7 | * wolfSSH is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * wolfSSH is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with wolfSSH. If not, see . 19 | */ 20 | 21 | 22 | #ifndef _WOLFSSH_EXAMPLES_SCPCLIENT_H_ 23 | #define _WOLFSSH_EXAMPLES_SCPCLIENT_H_ 24 | 25 | THREAD_RETURN WOLFSSH_THREAD scp_client(void*); 26 | 27 | #endif /* _WOLFSSH_EXAMPLES_SCPCLIENT_H_ */ 28 | -------------------------------------------------------------------------------- /examples/sftpclient/include.am: -------------------------------------------------------------------------------- 1 | # vim:ft=automake 2 | # All paths should be given relative to the root 3 | 4 | if BUILD_EXAMPLE_CLIENTS 5 | if BUILD_SFTP 6 | noinst_PROGRAMS += examples/sftpclient/wolfsftp 7 | examples_sftpclient_wolfsftp_SOURCES = examples/sftpclient/sftpclient.c \ 8 | examples/sftpclient/sftpclient.h \ 9 | examples/client/common.c \ 10 | examples/client/common.h 11 | examples_sftpclient_wolfsftp_LDADD = src/libwolfssh.la 12 | examples_sftpclient_wolfsftp_DEPENDENCIES = src/libwolfssh.la 13 | endif 14 | endif 15 | -------------------------------------------------------------------------------- /examples/sftpclient/sftpclient.h: -------------------------------------------------------------------------------- 1 | /* sftpclient.h 2 | * 3 | * Copyright (C) 2014-2024 wolfSSL Inc. 4 | * 5 | * This file is part of wolfSSH. 6 | * 7 | * wolfSSH is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * wolfSSH is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with wolfSSH. If not, see . 19 | */ 20 | 21 | 22 | #ifndef _WOLFSSH_EXAMPLES_SFTPCLIENT_H_ 23 | #define _WOLFSSH_EXAMPLES_SFTPCLIENT_H_ 24 | 25 | THREAD_RETURN WOLFSSH_THREAD sftpclient_test(void* args); 26 | 27 | #endif /* _WOLFSSH_EXAMPLES_SFTPCLIENT_H_ */ 28 | 29 | -------------------------------------------------------------------------------- /ide/CSBENCH/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | sftp 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.cdt.managedbuilder.core.genmakebuilder 10 | clean,full,incremental, 11 | 12 | 13 | 14 | 15 | org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder 16 | full,incremental, 17 | 18 | 19 | 20 | 21 | 22 | org.eclipse.cdt.core.cnature 23 | org.eclipse.cdt.managedbuilder.core.managedBuildNature 24 | org.eclipse.cdt.managedbuilder.core.ScannerConfigNature 25 | 26 | 27 | 28 | echoserver 29 | 2 30 | PARENT-2-PROJECT_LOC../examples/echoserver 31 | 32 | 33 | src 34 | 2 35 | PARENT-2-PROJECT_LOC../src 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /ide/CSBENCH/README: -------------------------------------------------------------------------------- 1 | This is to build with Sourcery CodeBench IDE 2 | 3 | It makes the assumption that the root wolfssl and wolfssh directory are in the same folder 4 | 5 | workspace -> 6 | ->wolfssl 7 | ->wolfssh 8 | 9 | To build first compile the wolfssl library using the project provided in wolfssl/IDE/CSBENCH 10 | 11 | Next compile the sftp example project provided in wolfssh/ide/CSBENCH 12 | 13 | Note that this is using port 8080 to listen on by default 14 | -------------------------------------------------------------------------------- /ide/CSBENCH/include.am: -------------------------------------------------------------------------------- 1 | # vim:ft=automake 2 | # included from Top Level Makefile.am 3 | # All paths should be given relative to the root 4 | 5 | EXTRA_DIST+= ide/CSBENCH/.cproject 6 | EXTRA_DIST+= ide/CSBENCH/.project 7 | EXTRA_DIST+= ide/CSBENCH/README 8 | -------------------------------------------------------------------------------- /ide/Espressif/ESP-IDF/examples/README.md: -------------------------------------------------------------------------------- 1 | # wolfSSL Espressif Managed Component examples 2 | 3 | [wolfssh_template](./wolfssh_template/README.md) 4 | 5 | [wolfssh_echoserver](./wolfssh_echoserver/README.md) -------------------------------------------------------------------------------- /ide/Espressif/ESP-IDF/examples/wolfssh_echoserver/README.md: -------------------------------------------------------------------------------- 1 | # wolfSSH Server Project 2 | 3 | This is an example wolfSSH Server based on the minimally viable wolfSSL [template](../wolfssh_template/README.md) 4 | 5 | See the [command line example client](https://github.com/wolfSSL/wolfssh/tree/master/examples/client) 6 | and the instructions in [wolfssh README.md](https://github.com/wolfSSL/wolfssh#readme) 7 | 8 | To connect: 9 | 10 | ```bash 11 | ssh -p 22222 jack@192.168.1.32 12 | ``` 13 | 14 | ### Prerequisites 15 | 16 | It is assumed the [ESP-IDF environment](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/) has been installed. 17 | 18 | ### Files Included 19 | 20 | - [main.c](./main/main.c) with a simple call to an Espressif library (`ESP_LOGI`) and a call to a wolfSSL library (`esp_ShowExtendedSystemInfo`) . 21 | 22 | - See [components/wolfssl/include](./components/wolfssl/include/user_settings.h) directory to edit the wolfSSL `user_settings.h`. 23 | 24 | - Edit [main/CMakeLists.txt](./main/CMakeLists.txt) to add/remove source files. 25 | 26 | - The [components/wolfssl/CMakeLists.txt](./components/wolfssl/CMakeLists.txt) typically does not need to be changed. 27 | 28 | - Optional [VisualGDB Project](./VisualGDB/wolfssl_template_IDF_v5.1_ESP32.vgdbproj) for Visual Studio using ESP32 and ESP-IDF v5.1. 29 | 30 | - Edit the project [CMakeLists.txt](./CMakeLists.txt) to optionally point this project's wolfSSL component source code at a different directory: 31 | 32 | ``` 33 | set(WOLFSSL_ROOT "~/workspace/wolfssl-other-source") 34 | ``` 35 | 36 | 37 | ## Getting Started: 38 | 39 | Here's an example using the command-line [idf.py](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/tools/idf-py.html). 40 | 41 | Edit your `WRK_IDF_PATH`to point to your ESP-IDF install directory. 42 | 43 | ``` 44 | WRK_IDF_PATH=/mnt/c/SysGCC/esp32/esp-idf/v5.1 45 | 46 | echo "Run export.sh from ${WRK_IDF_PATH}" 47 | . ${WRK_IDF_PATH}/export.sh 48 | 49 | # build the example: 50 | idf.py build 51 | 52 | # flash the code onto the serial device at /dev/ttyS19 53 | idf.py flash -p /dev/ttyS19 -b 115200 54 | 55 | # build, flash, and view UART output with one command: 56 | idf.py flash -p /dev/ttyS19 -b 115200 monitor 57 | ``` 58 | 59 | Press `Ctrl+]` to exit `idf.py monitor`. See [additional monitor keyboard commands](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/tools/idf-monitor.html). 60 | 61 | ## Other Examples: 62 | 63 | For examples, see: 64 | 65 | - [TLS Client](../wolfssl_client/README.md) 66 | - [TLS Server](../wolfssl_server/README.md) 67 | - [Benchmark](../wolfssl_benchmark/README.md) 68 | - [Test](../wolfssl_test/README.md) 69 | - [wolfssl-examples](https://github.com/wolfSSL/wolfssl-examples/tree/master/ESP32) 70 | - [wolfssh-examples](https://github.com/wolfSSL/wolfssh-examples/tree/main/Espressif) 71 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /ide/Espressif/ESP-IDF/examples/wolfssh_echoserver/VisualGDB/wolfssh_echoserver_IDF_v5.1_ESP32.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.7.34031.279 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{803FD0C6-D64E-4E16-9DC3-1DAEC859A3D2}") = "wolfssh_echoserver_IDF_v5.1_ESP32", "wolfssh_echoserver_IDF_v5.1_ESP32.vgdbproj", "{EADCC9AB-72B3-4B51-A838-593E5D80DDF7}" 7 | EndProject 8 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{510C1DEE-DFFB-4C38-864E-DCE7A172ABB7}" 9 | ProjectSection(SolutionItems) = preProject 10 | ..\..\..\..\..\..\..\wolfssl-gojimmypi\wolfssl\wolfcrypt\port\Espressif\esp32-crypt.h = ..\..\..\..\..\..\..\wolfssl-gojimmypi\wolfssl\wolfcrypt\port\Espressif\esp32-crypt.h 11 | ..\README.md = ..\README.md 12 | EndProjectSection 13 | EndProject 14 | Global 15 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 16 | Debug|VisualGDB = Debug|VisualGDB 17 | Release|VisualGDB = Release|VisualGDB 18 | Tests (Debug)|VisualGDB = Tests (Debug)|VisualGDB 19 | Tests (Release)|VisualGDB = Tests (Release)|VisualGDB 20 | EndGlobalSection 21 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 22 | {EADCC9AB-72B3-4B51-A838-593E5D80DDF7}.Debug|VisualGDB.ActiveCfg = Debug|VisualGDB 23 | {EADCC9AB-72B3-4B51-A838-593E5D80DDF7}.Debug|VisualGDB.Build.0 = Debug|VisualGDB 24 | {EADCC9AB-72B3-4B51-A838-593E5D80DDF7}.Release|VisualGDB.ActiveCfg = Release|VisualGDB 25 | {EADCC9AB-72B3-4B51-A838-593E5D80DDF7}.Release|VisualGDB.Build.0 = Release|VisualGDB 26 | {EADCC9AB-72B3-4B51-A838-593E5D80DDF7}.Tests (Debug)|VisualGDB.ActiveCfg = Tests (Debug)|VisualGDB 27 | {EADCC9AB-72B3-4B51-A838-593E5D80DDF7}.Tests (Debug)|VisualGDB.Build.0 = Tests (Debug)|VisualGDB 28 | {EADCC9AB-72B3-4B51-A838-593E5D80DDF7}.Tests (Release)|VisualGDB.ActiveCfg = Tests (Release)|VisualGDB 29 | {EADCC9AB-72B3-4B51-A838-593E5D80DDF7}.Tests (Release)|VisualGDB.Build.0 = Tests (Release)|VisualGDB 30 | EndGlobalSection 31 | GlobalSection(SolutionProperties) = preSolution 32 | HideSolutionNode = FALSE 33 | EndGlobalSection 34 | GlobalSection(ExtensibilityGlobals) = postSolution 35 | SolutionGuid = {C3DD3774-E396-475C-B78D-604D7CD9B732} 36 | EndGlobalSection 37 | EndGlobal 38 | -------------------------------------------------------------------------------- /ide/Espressif/ESP-IDF/examples/wolfssh_echoserver/components/wolfssl/README.md: -------------------------------------------------------------------------------- 1 | # Component wolfSSL 2 | 3 | This `wolfssl` directory exists only for the stand-alone examples. 4 | 5 | The only files of interest are the [CMakeLists.txt](./CMakeLists.txt) that should point 6 | to the wolfSSL source code and the respective [include/user_settings.h](./include/user_settings.h). 7 | 8 | This directory is _not_ included in the publish to the Espressif Registry, as that 9 | mechanism copies the published source code to the local component directory as needed. 10 | -------------------------------------------------------------------------------- /ide/Espressif/ESP-IDF/examples/wolfssh_echoserver/main/include/echoserver.h: -------------------------------------------------------------------------------- 1 | /* echoserver.h 2 | * 3 | * Copyright (C) 2014-2024 wolfSSL Inc. 4 | * 5 | * This file is part of wolfSSH. 6 | * 7 | * wolfSSH is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * wolfSSH is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with wolfSSH. If not, see . 19 | */ 20 | 21 | 22 | #ifndef _WOLFSSH_EXAMPLES_ECHOSERVER_H_ 23 | #define _WOLFSSH_EXAMPLES_ECHOSERVER_H_ 24 | 25 | #include 26 | 27 | #ifndef WOLFSSH_THREAD 28 | #define WOLFSSH_THREAD WOLFSSL_THREAD 29 | #endif 30 | 31 | THREAD_RETURN WOLFSSH_THREAD echoserver_test(void* args); 32 | int wolfSSH_Echoserver(int argc, char** argv); 33 | 34 | 35 | #endif /* _WOLFSSH_EXAMPLES_ECHOSERVER_H_ */ 36 | -------------------------------------------------------------------------------- /ide/Espressif/ESP-IDF/examples/wolfssh_echoserver/main/include/main.h: -------------------------------------------------------------------------------- 1 | /* template main.h 2 | * 3 | * Copyright (C) 2014-2024 wolfSSL Inc. 4 | * 5 | * This file is part of wolfSSH. 6 | * 7 | * wolfSSH is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * wolfSSH is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with wolfSSH. If not, see . 19 | */ 20 | #ifndef _MAIN_H_ 21 | #define _MAIN_H_ 22 | 23 | /* Espressif libraries */ 24 | #include "sdkconfig.h" 25 | #include 26 | #include 27 | 28 | /* wolfSSL */ 29 | #include /* includes wolfSSL user-settings.h */ 30 | #include 31 | #ifndef WOLFSSL_ESPIDF 32 | #warning "Problem with wolfSSL user_settings." 33 | #warning "Check components/wolfssl/include" 34 | #endif 35 | #include 36 | #include 37 | 38 | /* wolfSSH */ 39 | #include 40 | #include 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /ide/Espressif/ESP-IDF/examples/wolfssh_echoserver/main/include/time_helper.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014-2024 wolfSSL Inc. 3 | * 4 | * This file is part of wolfSSH. 5 | * 6 | * wolfSSH is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * wolfSSH is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with wolfSSH. If not, see . 18 | */ 19 | 20 | /* common Espressif time_helper v5.6.3.001 */ 21 | 22 | #ifndef _TIME_HELPER_H 23 | #define _TIME_HELPER_H 24 | 25 | /* ESP-IDF uses a 64-bit signed integer to represent time_t starting from release v5.0 26 | * See: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/system/system_time.html#year-2036-and-2038-overflow-issues 27 | */ 28 | 29 | #ifdef __cplusplus 30 | extern "C" { 31 | #endif 32 | 33 | #include 34 | 35 | /* a function to show the current data and time */ 36 | esp_err_t esp_show_current_datetime(); 37 | 38 | /* worst case, if GitHub time not available, used fixed time */ 39 | esp_err_t set_fixed_default_time(void); 40 | 41 | /* set time from string (e.g. GitHub commit time) */ 42 | esp_err_t set_time_from_string(const char* time_buffer); 43 | 44 | /* set time from NTP servers, 45 | * also initially calls set_fixed_default_time or set_time_from_string */ 46 | esp_err_t set_time(void); 47 | 48 | /* wait NTP_RETRY_COUNT seconds before giving up on NTP time */ 49 | esp_err_t set_time_wait_for_ntp(void); 50 | 51 | #ifdef __cplusplus 52 | } /* extern "C" */ 53 | #endif 54 | 55 | #endif /* #ifndef _TIME_HELPER_H */ 56 | -------------------------------------------------------------------------------- /ide/Espressif/ESP-IDF/examples/wolfssh_echoserver/partitions_singleapp_large.csv: -------------------------------------------------------------------------------- 1 | # to view: idf.py partition-table 2 | # 3 | # ESP-IDF Partition Table 4 | # Name, Type, SubType, Offset, Size, Flags 5 | nvs, data, nvs, 0x9000, 24K, 6 | phy_init,data, phy, 0xf000, 4K, 7 | factory, app, factory, 0x10000, 1500K, 8 | 9 | 10 | # For other settings, see: 11 | # https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/partition-tables.html#creating-custom-tables 12 | # 13 | # Here is the summary printed for the "Single factory app, no OTA" configuration: 14 | # 15 | # # ESP-IDF Partition Table 16 | # # Name, Type, SubType, Offset, Size, Flags 17 | # nvs, data, nvs, 0x9000, 0x6000, 18 | # phy_init, data, phy, 0xf000, 0x1000, 19 | # factory, app, factory, 0x10000, 1M, 20 | # 21 | # 22 | # Here is the summary printed for the "Factory app, two OTA definitions" configuration: 23 | # 24 | # # ESP-IDF Partition Table 25 | # # Name, Type, SubType, Offset, Size, Flags 26 | # nvs, data, nvs, 0x9000, 0x4000, 27 | # otadata, data, ota, 0xd000, 0x2000, 28 | # phy_init, data, phy, 0xf000, 0x1000, 29 | # factory, app, factory, 0x10000, 1M, 30 | # ota_0, app, ota_0, 0x110000, 1M, 31 | # ota_1, app, ota_1, 0x210000, 1M, 32 | -------------------------------------------------------------------------------- /ide/Espressif/ESP-IDF/examples/wolfssh_echoserver/sdkconfig.defaults: -------------------------------------------------------------------------------- 1 | # This file was generated using idf.py save-defconfig. It can be edited manually. 2 | # Espressif IoT Development Framework (ESP-IDF) Project Minimal Configuration 3 | 4 | CONFIG_FREERTOS_HZ=1000 5 | CONFIG_ESP32_DEFAULT_CPU_FREQ_240=y 6 | 7 | # 8 | # Default main stack size 9 | # 10 | # This is typically way bigger than needed for stack size. See user_settings.h 11 | # 12 | CONFIG_ESP_MAIN_TASK_STACK_SIZE=55500 13 | 14 | # Legacy stack size for older ESP-IDF versions 15 | CONFIG_MAIN_TASK_STACK_SIZE=55500 16 | 17 | # 18 | # Compiler options 19 | # 20 | CONFIG_COMPILER_OPTIMIZATION_DEFAULT=y 21 | CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_ENABLE=y 22 | CONFIG_COMPILER_OPTIMIZATION_ASSERTION_LEVEL=2 23 | CONFIG_COMPILER_HIDE_PATHS_MACROS=y 24 | CONFIG_COMPILER_STACK_CHECK_MODE_NORM=y 25 | CONFIG_COMPILER_STACK_CHECK=y 26 | 27 | # 28 | # Partition Table 29 | # 30 | # CONFIG_PARTITION_TABLE_SINGLE_APP is not set 31 | CONFIG_PARTITION_TABLE_SINGLE_APP_LARGE=y 32 | # CONFIG_PARTITION_TABLE_TWO_OTA is not set 33 | # CONFIG_PARTITION_TABLE_CUSTOM is not set 34 | CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv" 35 | CONFIG_PARTITION_TABLE_FILENAME="partitions_singleapp_large.csv" 36 | CONFIG_PARTITION_TABLE_OFFSET=0x8000 37 | CONFIG_PARTITION_TABLE_MD5=y 38 | # end of Partition Table 39 | -------------------------------------------------------------------------------- /ide/Espressif/ESP-IDF/examples/wolfssh_template/README.md: -------------------------------------------------------------------------------- 1 | # wolfSSL Template Project 2 | 3 | This is an example minimally viable wolfSSL template to get started with your own project. 4 | 5 | ### Prerequisites 6 | 7 | It is assumed the [ESP-IDF environment](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/) has been installed. 8 | 9 | ### Files Included 10 | 11 | - [main.c](./main/main.c) with a simple call to an Espressif library (`ESP_LOGI`) and a call to a wolfSSL library (`esp_ShowExtendedSystemInfo`) . 12 | 13 | - See [components/wolfssl/include](./components/wolfssl/include/user_settings.h) directory to edit the wolfSSL `user_settings.h`. 14 | 15 | - Edit [main/CMakeLists.txt](./main/CMakeLists.txt) to add/remove source files. 16 | 17 | - The [components/wolfssl/CMakeLists.txt](./components/wolfssl/CMakeLists.txt) typically does not need to be changed. 18 | 19 | - Optional [VisualGDB Project](./VisualGDB/wolfssl_template_IDF_v5.1_ESP32.vgdbproj) for Visual Studio using ESP32 and ESP-IDF v5.1. 20 | 21 | - Edit the project [CMakeLists.txt](./CMakeLists.txt) to optionally point this project's wolfSSL component source code at a different directory: 22 | 23 | ``` 24 | set(WOLFSSL_ROOT "~/workspace/wolfssl-other-source") 25 | ``` 26 | 27 | 28 | ## Getting Started: 29 | 30 | Here's an example using the command-line [idf.py](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/tools/idf-py.html). 31 | 32 | Edit your `WRK_IDF_PATH`to point to your ESP-IDF install directory. 33 | 34 | ``` 35 | WRK_IDF_PATH=/mnt/c/SysGCC/esp32/esp-idf/v5.1 36 | 37 | echo "Run export.sh from ${WRK_IDF_PATH}" 38 | . ${WRK_IDF_PATH}/export.sh 39 | 40 | # build the example: 41 | idf.py build 42 | 43 | # flash the code onto the serial device at /dev/ttyS19 44 | idf.py flash -p /dev/ttyS19 -b 115200 45 | 46 | # build, flash, and view UART output with one command: 47 | idf.py flash -p /dev/ttyS19 -b 115200 monitor 48 | ``` 49 | 50 | Press `Ctrl+]` to exit `idf.py monitor`. See [additional monitor keyboard commands](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/tools/idf-monitor.html). 51 | 52 | ## Other Examples: 53 | 54 | For examples, see: 55 | 56 | - [TLS Client](../wolfssl_client/README.md) 57 | - [TLS Server](../wolfssl_server/README.md) 58 | - [Benchmark](../wolfssl_benchmark/README.md) 59 | - [Test](../wolfssl_test/README.md) 60 | - [wolfssl-examples](https://github.com/wolfSSL/wolfssl-examples/tree/master/ESP32) 61 | - [wolfssh-examples](https://github.com/wolfSSL/wolfssh-examples/tree/main/Espressif) 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /ide/Espressif/ESP-IDF/examples/wolfssh_template/components/wolfssl/README.md: -------------------------------------------------------------------------------- 1 | # Component wolfSSL 2 | 3 | This `wolfssl` directory exists only for the stand-alone examples. 4 | 5 | The only files of interest are the [CMakeLists.txt](./CMakeLists.txt) that should point 6 | to the wolfSSL source code and the respective [include/user_settings.h](./include/user_settings.h). 7 | 8 | This directory is _not_ included in the publish to the Espressif Registry, as that 9 | mechanism copies the published source code to the local component directory as needed. 10 | -------------------------------------------------------------------------------- /ide/Espressif/ESP-IDF/examples/wolfssh_template/main/include/main.h: -------------------------------------------------------------------------------- 1 | /* template main.h 2 | * 3 | * Copyright (C) 2014-2024 wolfSSL Inc. 4 | * 5 | * This file is part of wolfSSH. 6 | * 7 | * wolfSSH is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * wolfSSH is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with wolfSSH. If not, see . 19 | */ 20 | #ifndef _MAIN_H_ 21 | #define _MAIN_H_ 22 | 23 | /* Espressif libraries */ 24 | #include "sdkconfig.h" 25 | #include 26 | #include 27 | 28 | /* wolfSSL */ 29 | #include "user_settings.h" /* always include wolfSSL user_settings.h first */ 30 | #include 31 | #include 32 | 33 | /* wolfSSH */ 34 | #include 35 | #include 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /ide/Espressif/ESP-IDF/examples/wolfssh_template/main/main.c: -------------------------------------------------------------------------------- 1 | /* main.c 2 | * 3 | * Copyright (C) 2014-2024 wolfSSL Inc. 4 | * 5 | * This file is part of wolfSSH. 6 | * 7 | * wolfSSH is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * wolfSSH is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with wolfSSH. If not, see . 19 | */ 20 | #include "main.h" 21 | 22 | /* actual working example would include WiFi & time libraries here */ 23 | 24 | static const char* const TAG = "My Project"; 25 | 26 | void app_main(void) 27 | { 28 | ESP_LOGI(TAG, "------------ wolfSSL wolfSSH template Example ----------"); 29 | ESP_LOGI(TAG, "--------------------------------------------------------"); 30 | ESP_LOGI(TAG, "--------------------------------------------------------"); 31 | ESP_LOGI(TAG, "---------------------- BEGIN MAIN ----------------------"); 32 | ESP_LOGI(TAG, "--------------------------------------------------------"); 33 | ESP_LOGI(TAG, "--------------------------------------------------------"); 34 | 35 | ESP_LOGI(TAG, "Hello wolfSSL!"); 36 | 37 | #ifdef DEBUG_WOLFSSH 38 | wolfSSH_Debugging_ON(); 39 | #else 40 | ESP_LOGI(TAG, "DEBUG_WOLFSSH is not defined, " 41 | "so nothing will happen for teh next statement"); 42 | #endif 43 | 44 | #ifdef HAVE_VERSION_EXTENDED_INFO 45 | esp_ShowExtendedSystemInfo(); 46 | #endif 47 | 48 | #ifdef INCLUDE_uxTaskGetStackHighWaterMark 49 | ESP_LOGI(TAG, "Stack HWM: %d", uxTaskGetStackHighWaterMark(NULL)); 50 | 51 | ESP_LOGI(TAG, "Stack used: %d", CONFIG_ESP_MAIN_TASK_STACK_SIZE 52 | - (uxTaskGetStackHighWaterMark(NULL))); 53 | #endif 54 | 55 | /* the simplest check of the wolfSSL library presence: */ 56 | #ifdef LIBWOLFSSL_VERSION_STRING 57 | ESP_LOGI(TAG, ""); 58 | ESP_LOGI(TAG, "Found wolfSSL Version %s\n", LIBWOLFSSL_VERSION_STRING); 59 | #else 60 | ESP_LOGW(TAG, "Warning: Could not find wolfSSL Version"); 61 | #endif 62 | 63 | /* the simplest check of the wolfSSH library presence: */ 64 | #ifdef LIBWOLFSSH_VERSION_STRING 65 | ESP_LOGI(TAG, ""); 66 | ESP_LOGI(TAG, "Found wolfSSH Version %s\n", LIBWOLFSSH_VERSION_STRING); 67 | wolfSSH_Log(WS_LOG_INFO, "[wolfssh] Hello World!"); 68 | #else 69 | ESP_LOGW(TAG, "Warning: Could not find wolfSSH Version"); 70 | #endif 71 | 72 | /* actual working example would initialize WiFi & time libraries here */ 73 | 74 | ESP_LOGI(TAG, "\n\nDone!\n\n" 75 | "If running from idf.py monitor, press twice: Ctrl+]\n\n" 76 | "WOLFSSL_COMPLETE\n" /* exit keyword for wolfssl_monitor.py */ 77 | ); 78 | } /* app_main */ 79 | -------------------------------------------------------------------------------- /ide/Espressif/ESP-IDF/examples/wolfssh_template/partitions_singleapp_large.csv: -------------------------------------------------------------------------------- 1 | # to view: idf.py partition-table 2 | # 3 | # ESP-IDF Partition Table 4 | # Name, Type, SubType, Offset, Size, Flags 5 | nvs, data, nvs, 0x9000, 24K, 6 | phy_init,data, phy, 0xf000, 4K, 7 | factory, app, factory, 0x10000, 1500K, 8 | 9 | 10 | # For other settings, see: 11 | # https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/partition-tables.html#creating-custom-tables 12 | # 13 | # Here is the summary printed for the "Single factory app, no OTA" configuration: 14 | # 15 | # # ESP-IDF Partition Table 16 | # # Name, Type, SubType, Offset, Size, Flags 17 | # nvs, data, nvs, 0x9000, 0x6000, 18 | # phy_init, data, phy, 0xf000, 0x1000, 19 | # factory, app, factory, 0x10000, 1M, 20 | # 21 | # 22 | # Here is the summary printed for the "Factory app, two OTA definitions" configuration: 23 | # 24 | # # ESP-IDF Partition Table 25 | # # Name, Type, SubType, Offset, Size, Flags 26 | # nvs, data, nvs, 0x9000, 0x4000, 27 | # otadata, data, ota, 0xd000, 0x2000, 28 | # phy_init, data, phy, 0xf000, 0x1000, 29 | # factory, app, factory, 0x10000, 1M, 30 | # ota_0, app, ota_0, 0x110000, 1M, 31 | # ota_1, app, ota_1, 0x210000, 1M, 32 | -------------------------------------------------------------------------------- /ide/Espressif/ESP-IDF/examples/wolfssh_template/sdkconfig.defaults: -------------------------------------------------------------------------------- 1 | # This file was generated using idf.py save-defconfig. It can be edited manually. 2 | # Espressif IoT Development Framework (ESP-IDF) Project Minimal Configuration 3 | 4 | CONFIG_FREERTOS_HZ=1000 5 | CONFIG_ESP32_DEFAULT_CPU_FREQ_240=y 6 | 7 | # 8 | # Default main stack size 9 | # 10 | # This is typically way bigger than needed for stack size. See user_settings.h 11 | # 12 | CONFIG_ESP_MAIN_TASK_STACK_SIZE=10500 13 | 14 | # Legacy stack size for older ESP-IDF versions 15 | CONFIG_MAIN_TASK_STACK_SIZE=10500 16 | 17 | # 18 | # Compiler options 19 | # 20 | CONFIG_COMPILER_OPTIMIZATION_DEFAULT=y 21 | CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_ENABLE=y 22 | CONFIG_COMPILER_OPTIMIZATION_ASSERTION_LEVEL=2 23 | CONFIG_COMPILER_HIDE_PATHS_MACROS=y 24 | CONFIG_COMPILER_STACK_CHECK_MODE_NORM=y 25 | CONFIG_COMPILER_STACK_CHECK=y 26 | 27 | # 28 | # Partition Table 29 | # 30 | # CONFIG_PARTITION_TABLE_SINGLE_APP is not set 31 | CONFIG_PARTITION_TABLE_SINGLE_APP_LARGE=y 32 | # CONFIG_PARTITION_TABLE_TWO_OTA is not set 33 | # CONFIG_PARTITION_TABLE_CUSTOM is not set 34 | CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv" 35 | CONFIG_PARTITION_TABLE_FILENAME="partitions_singleapp_large.csv" 36 | CONFIG_PARTITION_TABLE_OFFSET=0x8000 37 | CONFIG_PARTITION_TABLE_MD5=y 38 | # end of Partition Table 39 | -------------------------------------------------------------------------------- /ide/Espressif/ESP-IDF/libs/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # cmake for wolfssh 3 | # 4 | cmake_minimum_required(VERSION 3.5) 5 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DWOLFSSL_USER_SETTINGS") 6 | 7 | set(CMAKE_CURRENT_SOURCE_DIR ".") 8 | set(WOLFSSL_ROOT ${CMAKE_CURRENT_SOURCE_DIR}) 9 | set(INCLUDE_PATH ${WOLFSSL_ROOT}) 10 | 11 | set(COMPONENT_SRCDIRS "./src/" 12 | "../wolfssl/wolfcrypt/src/" 13 | "../wolfssl/wolfcrypt/src/port/Espressif/" 14 | "../wolfssl/wolfcrypt/src/port/atmel/" 15 | ) 16 | 17 | set(COMPONENT_REQUIRES lwip) 18 | 19 | string(REPLACE "\\" "/" RTOS_IDF_PATH "$ENV{IDF_PATH}/components/freertos/include/freertos") 20 | 21 | if(IS_DIRECTORY ${IDF_PATH}/components/freertos/FreeRTOS-Kernel/) 22 | set(COMPONENT_ADD_INCLUDEDIRS 23 | "." 24 | "./include" 25 | "../freertos/FreeRTOS-Kernel/include/freertos" 26 | "${WOLFSSL_ROOT}" 27 | ) 28 | else() 29 | 30 | set(COMPONENT_ADD_INCLUDEDIRS 31 | "." 32 | "./include" 33 | # "/Users/gojimmypi/Desktop/esp-idf/components/freertos/include/freertos" 34 | "${RTOS_IDF_PATH}" 35 | "${WOLFSSL_ROOT}" 36 | ) 37 | endif() 38 | 39 | if(IS_DIRECTORY ${IDF_PATH}/components/cryptoauthlib) 40 | list(APPEND COMPONENT_ADD_INCLUDEDIRS "../cryptoauthlib/lib") 41 | endif() 42 | 43 | set(COMPONENT_SRCEXCLUDE 44 | "./src/misc.c" 45 | "../wolfssl/wolfcrypt/src/evp.c" 46 | "../wolfssl/wolfcrypt/src/misc.c" 47 | ) 48 | set(COMPONENT_PRIV_INCLUDEDIRS . ../wolfssl ../wolfssl/include) 49 | 50 | register_component() 51 | -------------------------------------------------------------------------------- /ide/Espressif/ESP-IDF/libs/component.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Component Makefile 3 | # 4 | 5 | COMPONENT_ADD_INCLUDEDIRS := . ./include 6 | COMPONENT_ADD_INCLUDEDIRS += /Users/gojimmypi/Desktop/esp-idf/components/freertos/include/freertos 7 | 8 | COMPONENT_SRCDIRS := src ../wolfssl/wolfcrypt/src 9 | COMPONENT_SRCDIRS += ../wolfssl/wolfcrypt/src/port/Espressif 10 | COMPONENT_SRCDIRS += ../wolfssl/wolfcrypt/src/port/atmel 11 | 12 | CFLAGS +=-DWOLFSSL_USER_SETTINGS 13 | 14 | COMPONENT_OBJEXCLUDE := ../wolfssl/wolfcrypt/src/aes_asm.o 15 | COMPONENT_OBJEXCLUDE += ../wolfssl/wolfcrypt/src/evp.o 16 | COMPONENT_OBJEXCLUDE += ../wolfssl/wolfcrypt/src/misc.o 17 | COMPONENT_OBJEXCLUDE += src/bio.o 18 | -------------------------------------------------------------------------------- /ide/Espressif/ESP-IDF/setup_win.bat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gojimmypi/wolfssh/b7418a21a36ea3b7b67b5f01a86f5b2ea41aa151/ide/Espressif/ESP-IDF/setup_win.bat -------------------------------------------------------------------------------- /ide/Espressif/ESP-IDF/wolfssh_espressif_semaphore.md: -------------------------------------------------------------------------------- 1 | This is a semaphore file used to ensure the install script is running from the expected directory. -------------------------------------------------------------------------------- /ide/Espressif/README.md: -------------------------------------------------------------------------------- 1 | # wolfSSH Espressif Component Install 2 | 3 | 4 | # ESP-IDF port 5 | ## Overview 6 | ESP-IDF development framework with wolfSSL by setting *WOLFSSL_ESPIDF* definition 7 | 8 | Including the following examples: 9 | 10 | * SSH UART Server 11 | 12 | The `user_settings.h` file enables some of the hardened settings. 13 | 14 | ## Requirements 15 | 1. [ESP-IDF development framework](https://docs.espressif.com/projects/esp-idf/en/latest/get-started/) 16 | 17 | 2. The wolfSSH component requires the [wolfssl component](https://github.com/wolfSSL/wolfssl/tree/master/IDE/Espressif/ESP-IDF) be installed first. 18 | 19 | 20 | ## Setup for Linux 21 | 1. Run `setup.sh` at _/path/to_`/wolfssl/IDE/Espressif/ESP-IDF/` to deploy files into ESP-IDF tree 22 | 2. Find Wolfssl files at _/path/to/esp_`/esp-idf/components/wolfssl/` 23 | 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) 24 | 25 | ## Setup for Windows ESP-IDF 26 | 1. Run ESP-IDF Command Prompt (cmd.exe) or Run ESP-IDF PowerShell Environment. The component path should be in "%IDF_PATH%". 27 | 2. Run `setup_win.bat` at `.\IDE\Espressif\ESP-IDF\` 28 | 29 | ``` 30 | cd ESP-IDF 31 | setup_win.bat 32 | ``` 33 | 34 | 3. Find Wolfssl files at _/path/to/esp_`/esp-idf/components/wolfssl/` 35 | 36 | ## Setup for Windows ESP-IDF Project 37 | 38 | Install a static copy of wolfSSH into a specific project component directory. 39 | 40 | ``` 41 | cd ESP-IDF 42 | setup_win.bat C:\workspace\wolfssh\examples\ESP32-SSH-Server 43 | ``` 44 | 45 | ## Setup for Windows VisualGDB. 46 | 47 | Install a static copy of wolfSSH into shared VisualGDB component directory 48 | 49 | ``` 50 | cd ESP-IDF 51 | setup_win.bat C:\SysGCC\esp32\esp-idf\v4.4 52 | ``` 53 | 54 | 55 | 56 | 57 | 58 | 59 | ## Configuration 60 | 1. The `user_settings.h` can be found in _/path/to/esp_`/esp-idf/components/wolfssl/include/user_settings.h` 61 | 62 | ## Build examples 63 | 1. See README in each example folder 64 | 65 | ## Support 66 | For question please email [support@wolfssl.com] 67 | 68 | Note: This is tested with : 69 | - OS: Ubuntu 20.04.3 LTS and Microsoft Windows 10 Pro 10.0.19041 and well as WSL Ubuntu 70 | - ESP-IDF: ESP-IDF v4.3.2 71 | - Module : ESP32-WROOM-32 72 | -------------------------------------------------------------------------------- /ide/IAR-EWARM/Projects/README.md: -------------------------------------------------------------------------------- 1 | # wolfSSH Example echoServer Setup Guide 2 | 3 | wolfSSH exhoserver example works with wolfSSL and wolfSSH library. 4 | 5 | ## 1) Source file location 6 | 7 | Put wolfSSL and wolfSSH files under a working directory in parallel 8 | with the directory name of "wolfssl" and "wolfssh". 9 | 10 | #### \/wolfssl 11 | #### \/wolfssh 12 | 13 | ## 2) Open projects 14 | 15 | Open wolfSSL workspace and add wolfSSH lib and echoserver project. 16 | 17 | #### \/wolfssl/IDE/IAR-EWARM/Projects/wolfssl.eww 18 | #### \/wolfssh/ide/IAR-EWARM/Projects/lib/wolfSSH-Lib.ewp 19 | #### \/wolfssh/ide/IAR-EWARM/Projects/echoserver/echoserver.ewp 20 | 21 | ### 3) Test build of projects 22 | 23 | Select project and Make of wolfSSL-Lib, wolfSSH-Lib and echoserver project respectively with default options. 24 | 25 | 26 | ### 4) Modify echoserver.c for your target platform 27 | 28 | Configuration Openstions are in user_setings.h under each "Projects" directory 29 | 30 | #### \/wolfssl/IDE/IAR-EWARM/Projects/user_setings.h 31 | #### \/wolfssh/ide/IAR-EWARM/Projects/user_setings.h 32 | 33 | Put appropriate options and modify echoserve.c for your target environment. 34 | 35 | #### \/wolfssl/examples/echoserver/echoserver.c -------------------------------------------------------------------------------- /ide/IAR-EWARM/Projects/user_settings.h: -------------------------------------------------------------------------------- 1 | #ifndef USER_SETTINGS_H 2 | #define USER_SETTINGS_H 3 | 4 | #define BENCH_EMBEDDED 5 | #define NO_WRITEV 6 | #define WOLFSSL_USER_IO 7 | #define NO_DEV_RANDOM 8 | #define USE_CERT_BUFFERS_2048 9 | #define WOLFSSL_USER_CURRTIME 10 | #define SIZEOF_LONG_LONG 8 11 | #define NO_WOLFSSL_DIR 12 | #define WOLFSSL_NO_CURRDIR 13 | #define NO_WOLF_C99 14 | #define NO_MULTIBYTE_PRINT 15 | 16 | #define XVALIDATEDATE(d, f,t) (0) 17 | #define WOLFSSL_USER_CURRTIME /* for benchmark */ 18 | 19 | #define WOLFSSL_GENSEED_FORTEST /* Warning: define your own seed gen */ 20 | 21 | #define TFM_TIMING_RESISTANT 22 | #define ECC_TIMING_RESISTANT 23 | #define WC_RSA_BLINDING 24 | 25 | #define SINGLE_THREADED /* or define RTOS option */ 26 | /* #define WOLFSSL_CMSIS_RTOS */ 27 | /* #define NO_FILESYSTEM */ 28 | 29 | /* #define NO_DH */ 30 | #define HAVE_AESGCM 31 | #define WOLFSSL_SHA512 32 | #define HAVE_ECC 33 | #define HAVE_CURVE25519 34 | #define CURVE25519_SMALL 35 | #define HAVE_ED25519 36 | 37 | #define WOLFSSH_USER_IO 38 | #define WOLFSSL_USER_IO 39 | 40 | #define WOLFSSH_SFTP 41 | 42 | #define WOLFSSH_USER_FILESYSTEM 43 | #define WOLFSSL_USER_FILESYSTEM 44 | #define NO_WOLFSSH_DIR 45 | 46 | /* To be defined for the target Socket API */ 47 | #define WSTARTTCP() 48 | 49 | #define WOLFSSH_LOG_PRINTF 50 | #define WOLFSSL_LOG_PRINTF 51 | #define fprintf(err, ... ) printf(__VA_ARGS__) 52 | 53 | typedef unsigned int size_t; 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /ide/IAR-EWARM/include.am: -------------------------------------------------------------------------------- 1 | # vim:ft=automake 2 | # included from Top Level Makefile.am 3 | # All paths should be given relative to the root 4 | 5 | EXTRA_DIST+= ide/IAR-EWARM/Projects/user_settings.h 6 | EXTRA_DIST+= ide/IAR-EWARM/Projects/lib/wolfSSH-Lib.ewp 7 | EXTRA_DIST+= ide/IAR-EWARM/Projects/lib/wolfSSH-Lib.ewd 8 | EXTRA_DIST+= ide/IAR-EWARM/Projects/echoserver/echoserver.ewp 9 | EXTRA_DIST+= ide/IAR-EWARM/Projects/echoserver/echoserver.ewd 10 | EXTRA_DIST+= ide/IAR-EWARM/Projects/lib/myFilesystem.h 11 | EXTRA_DIST+= ide/IAR-EWARM/Projects/README.md 12 | -------------------------------------------------------------------------------- /ide/Linux-FATFS/.gitignore: -------------------------------------------------------------------------------- 1 | fatfs_image.img 2 | -------------------------------------------------------------------------------- /ide/Linux-FATFS/Makefile: -------------------------------------------------------------------------------- 1 | # Compiler and flags 2 | CC = gcc 3 | CFLAGS = -g -Wall -O2 -fPIC -Isource 4 | LDFLAGS = -shared 5 | 6 | # Source files 7 | SRCS = source/ff.c source/ffunicode.c fatfs_example.c 8 | 9 | # Object files 10 | OBJS = $(SRCS:.c=.o) 11 | 12 | # Target library 13 | TARGET = libfatfs.so 14 | 15 | all: $(TARGET) 16 | 17 | $(TARGET): $(OBJS) 18 | $(CC) $(LDFLAGS) -o $@ $^ 19 | 20 | %.o: %.c 21 | $(CC) $(CFLAGS) -c $< -o $@ 22 | 23 | clean: 24 | rm -f $(OBJS) $(TARGET) 25 | 26 | .PHONY: all clean 27 | -------------------------------------------------------------------------------- /ide/Linux-FATFS/README.md: -------------------------------------------------------------------------------- 1 | # FATFS Linux Example 2 | 3 | This is a FATFS example that uses a single file on the Linux filesystem as the 4 | FATFS file system. 5 | 6 | ## Obtaining FATFS 7 | 8 | You can download the source code from 9 | [The FATFS download site](http://elm-chan.org/fsw/ff/archives.html). Extract it 10 | into this directory. 11 | 12 | The example has been tested against FATFS 0.15a 13 | 14 | ## Compiling Library 15 | 16 | First copy the config file into the correct place: 17 | 18 | ```sh 19 | cp ffconf.h source/ 20 | ``` 21 | 22 | Then to compile the FATFS library simply run `make`. 23 | 24 | ## Setup filesystem 25 | 26 | The single file used for FATFS should be generated using: 27 | 28 | ```sh 29 | dd if=/dev/zero of=fatfs_image.img bs=1M count=32 30 | mkdosfs fatfs_image.img 31 | ``` 32 | 33 | Note that this file will need to be local to wherever you execute anything using 34 | the library. 35 | 36 | ## Compiling wolfSSH and wolfSSL 37 | 38 | ### wolfSSL 39 | 40 | ```sh 41 | ./configure --enable-wolfssh --enable-intelasm --disable-crl --disable-examples --disable-filesystem CFLAGS="-DNO_WOLFSSL_DIR" 42 | ``` 43 | 44 | ### wolfSSH 45 | 46 | ```sh 47 | LD_LIBRARY_PATH=ide/Linux-FATFS ./configure --enable-sftp CFLAGS="-DWOLFSSH_FATFS -Iide/Linux-FATFS/source -DSTDIN_FILENO=0 -DPRINTF=printf" LDFLAGS="-Lide/Linux-FATFS -lfatfs" 48 | ``` 49 | 50 | -------------------------------------------------------------------------------- /ide/MQX/README-jp.md: -------------------------------------------------------------------------------- 1 | # MQX向けビルド方法 2 | ## 概要 3 | このMakefileはwolfSSHライブラリーとサンプルプログラムをMQX向けにビルドするためのものです。 4 | 以下のターゲットを含んでいます。 5 | - wolfsshlib: wolfSSH静的ライブラリー 6 | - echoserver: Echoサーバサンプルプログラム 7 | 8 | 9 | ## 準備 10 | - 事前にMQXをインストールしておいてください。 11 | - 事前にwolfSSHを有効化したwolfSSLの静的ライブラリーをビルドしておいてください。 12 | 13 | ## 設定 14 | - wolfSSH コンフィグレーションオプション 15 |  /ide/MQX/user_settings.hファイルに必要なオプションを追加または削除してください。 16 | 17 | - Makefileの設定 18 | WOLFSSL_ROOT:wolfSSLソースコードのルート 19 | WOLFSSH_ROOT:Makefileの格納位置を変える場合はこの定義を変更してください 20 | MQX_ROOT: MQX のインストールパス 21 | MQXLIB: リンクするMQX ライブラリのパス 22 | CC: コンパイラコマンド 23 | AR: ARコマンド 24 | 25 | -------------------------------------------------------------------------------- /ide/MQX/README.md: -------------------------------------------------------------------------------- 1 | #How to build with MQX 2 | ## Overview 3 | This Makefile is for building wolfSSH library and echoserver sample program running with MQX. 4 | It has following tartes. 5 | - wolfsshlib: wolfSSH static library 6 | - echoserver: Simple echo-server example 7 | 8 | ## Prerequisites 9 | - Installed MQX 10 | - wolfSSH enabled wolfSSL static library 11 | 12 | ## Setup 13 | - wolfSSH configuration parameters 14 | You can add or remove configuration options in /ide/MQX/user_settings.h. 15 | 16 | - Setup Makefile 17 | WOLFSSL_ROOT: wolfSSL install path 18 | WOLFSSH_ROOT: change this if you move this Makefile location 19 | MQX_ROOT: MQX source code installed path 20 | MQXLIB: MQX library path to like with 21 | CC: compiler 22 | AR: archiver 23 | 24 | -------------------------------------------------------------------------------- /ide/MQX/include.am: -------------------------------------------------------------------------------- 1 | # vim:ft=automake 2 | # included from Top Level Makefile.am 3 | # All paths should be given relative to the root 4 | 5 | EXTRA_DIST+= ide/MQX/Makefile 6 | EXTRA_DIST+= ide/MQX/README-jp.md 7 | EXTRA_DIST+= ide/MQX/README.md -------------------------------------------------------------------------------- /ide/Renesas/cs+/README.md: -------------------------------------------------------------------------------- 1 | # wolfSSH/AlphaProject Boad Simple Ssh Example Server Setup Guide 2 | This demo is tested with the following condition. 3 | 4 | * Renesas : CS+ v8.01 5 | * Board : Alpha Project AP-RX71M-0A w/ Sample program v2.0 6 | * wolfSSL : 4.0.0 7 | * wolfSSH : 1.3.1 8 | 9 | ## Setup process: 10 | ### 1. Download software 11 | 12 | - Unzip AlphaProject firmware 13 | - Unzip wolfssl under the same directory 14 | - Unzip wolfssh under the same directory 15 | 16 | ### 2. Set up wolfSSL and wolfSSH 17 | - Open wolfssh\ide\Renesas\cs+\wolfssl_lib\wolfssl_lib.mtpj with CS+ and build 18 | - Open wolfssh\ide\Renesas\cs+\wolfssh_lib\wolfssh_lib.mtpj with CS+ and build 19 | - Open demo_server.mtpj and build. This create demo program library. 20 | 21 | ### 3. Set up AlphaProject 22 | - The demo uses ap_rx71m_0a_sample_cs\Sample\ap_rx71m_0a_usbfunc_sample_cs\ap_rx71m_0a_ether_sample_cs.mtpj 23 | - Open and edit ap_rx71m_0a_sample_cs\Sample\ap_rx71m_0a_usbfunc_sample_cs\src\AP_RX71M_0A.c 24 | insert wolfSSL_init() in UsbfInit(). 25 | ``` 26 | CanInit(); 27 | SciInit(); 28 | EthernetAppInit(); 29 | UsbfInit(); 30 | wolfSSL_init(); <- insert this line 31 | ``` 32 | 33 | - Modify stack and heap size in ap_rx71m_0a_sample_cs\Sample\ap_rx71m_0a_usbfunc_sample_cs\src\smc_gen\r_config\r_bsp_config.h 34 | ``` 35 | Line 154 #pragma stacksize su=0x2000 36 | Line 175 #define BSP_CFG_HEAP_BYTES (0xa000) 37 | ``` 38 | - Modify IP address Sample\ap_rx71m_0a_usbfunc_sample_cs\src\tcp_sample\config_tcpudp.c as needed 39 | 40 | ``` 41 | #define MY_IP_ADDR0 192,168,1,200 /* Local IP address */ 42 | #define GATEWAY_ADDR0 192,168,1,254 /* Gateway address (invalid if all 0s) */ 43 | #define SUBNET_MASK0 255,255,255,0 44 | ``` 45 | - Add project properties of linking library in ap_rx71m_0a_usbfunc_sample_cs.mtpj 46 | wolfssh\ide\Renesas\cs+\Projects\wolfssl_lib\DefaultBuild\wolfssl_lib.lib 47 | wolfssh\ide\Renesas\cs+\Projects\wolfssh_lib\DefaultBuild\wolfssh_lib.lib 48 |   wolfssh\ide\Renesas\cs+\Projects\demo_server\DefaultBuild\demo_sever.lib 49 | 50 | - Set CC-RX(Build Tool)->Library Geberation->Library Configuration to"C99" and enable ctype.h. 51 | 52 | - Build the project and start execut. You see message on the console prompting command. 53 | ``` 54 | Start server_test 55 | ``` 56 | - wolfSSH simple server will be open on port 50000 which can be connected to by using the example client bundled with wolfSSH 57 | ``` 58 | $ ./examples/client/client -h 192.168.1.200 -p 50000 -u jill 59 | Sample public key check callback 60 | public key = 0x55a0890864ea 61 | public key size = 279 62 | ctx = You've been sampled! 63 | Password: <---- input "upthehill" 64 | Server said: Hello, wolfSSH! 65 | ``` 66 | ## Support 67 | 68 | Email us at [support@wolfssl.com](mailto:support@wolfssl.com). 69 | -------------------------------------------------------------------------------- /ide/Renesas/cs+/README_jp.md: -------------------------------------------------------------------------------- 1 | # wolfSSH シンプル SSH サーバ セットアップガイド 2 | 3 | このデモは以下の環境でテストしています。 4 | 5 | * Renesas : CS+ v8.01 6 | * Board : Alpha Project AP-RX71M-0A w/ Sample program v2.0 7 | * wolfSSL : 4.0.0 8 | * wolfSSH : 1.3.1 9 | 10 | ## セットアップ手順: 11 | ### 1 ソフトウェアの入手 12 | 13 | - APボード付属のソフトウェア一式を適当なフォルダー下に解凍します。 14 | - 同じフォルダー下にwolfssl一式を解凍します。 15 | - 同じフォルダー下にwolfssh一式を解答します。 16 | ### 2 wolfSSL及びwolfSSHのセットアップ 17 | 18 | - CS+にてwolfssh\ide\Renesas\cs+\下のwolfssl_lib\wolfssl_lib.mtpjを開き 19 | wolfSSLライブラリーのビルドをします。 20 | - CS+にてwolfssh\ide\Renesas\cs+\下のwolfssh_lib\wolfssj_lib.mtpjを開き 21 | wolfSShライブラリーのビルドをします。 22 | - 同じフォルダの下のdemo_server.mtpjを開き、デモプログラムのビルドをします。 23 | このプログラムもライブラリー形式でビルドされます。 24 | 25 | ### 3 AlphaProject側のセットアップ 26 | デモはap_rx71m_0a_sample_cs\Sample\ap_rx71m_0a_usbfunc_sample_csフォルダ下の 27 | ap_rx71m_0a_usbfunc_sample_cs.mtpjプロジェクトを利用します。 28 | 29 | - ap_rx71m_0a_sample_cs\Sample\ap_rx71m_0a_ether_sample_cs\srcフォルダ下のAP_RX71M_0A.cファイルを開き、 30 | UsbfInit()の下にwolfSSL_init()を挿入します。 31 | 32 | ``` 33 | CanInit(); 34 | SciInit(); 35 | EthernetAppInit(); 36 | UsbfInit(); 37 | wolfSSL_init(); <- この行を挿入 38 | ``` 39 | - ap_rx71m_0a_sample_cs\Sample\ap_rx71m_0a_usbfunc_sample_cs\src\smc_gen\r_config\r_bsp_config.h 40 | を開き、スタックサイズとヒープサイズを以下のように設定します。 41 |  154行目 #pragma stacksize su=0x2000 42 |  175行目 #define BSP_CFG_HEAP_BYTES (0xa000) 43 | 44 | - IPアドレスのデフォルト値は以下のようになっています。 45 |  必要があれば、Sample\ap_rx71m_0a_ether_sample_cs\src\tcp_sample\config_tcpudp.c 46 |  内の139行目からの定義を変更します。 47 | 48 | ``` 49 | #define MY_IP_ADDR0 192,168,1,200 /* Local IP address */ 50 | #define GATEWAY_ADDR0 192,168,1,254 /* Gateway address (invalid if all 0s) */ 51 | #define SUBNET_MASK0 255,255,255,0 /* Subnet mask */ 52 | ``` 53 | - CS+でap_rx71m_0a_usbfunc_sample_cs.mtpjプロジェクトを開き、wolfSSL、wolfSSH及びデモライブラリを 54 |  登録します。CC-RX(ビルドツール)->リンク・オプションタブ->使用するライブラリに 55 |  以下の二つのファイルを登録します。 56 | 57 | - CC-RX(ビルドツール)->ライブラリージェネレーションタブ->ライブラリー構成を「C99」に、 58 | ctype.hを有効にするを「はい」に設定します。 59 | 60 | - プロジェクトのビルド、ターゲットへのダウンロードをしたのち、表示->デバッグ・コンソール 61 |  からコンソールを表示させます。実行を開始するとコンソールに以下の表示が出力されます。 62 | ``` 63 | Start server_test 64 | ``` 65 | - シンプル wolfSSH サーバは、50000番のポートを開いて待ちます。サーバへは、wolfSSHに付サンプルクライアントを 66 | 使って以下のように接続することができます。 67 | ``` 68 | $ ./examples/client/client -h 192.168.1.200 -p 50000 -u jill 69 | Sample public key check callback 70 | public key = 0x55a0890864ea 71 | public key size = 279 72 | ctx = You've been sampled! 73 | Password: <---- input "upthehill" 74 | Server said: Hello, wolfSSH! 75 | ``` 76 | 77 | ## サポート 78 | サポートが必要な場合は、[support@wolfssl.com](mailto:support@wolfssl.com)へご連絡ください。 79 | 80 | 以上 81 | -------------------------------------------------------------------------------- /ide/Renesas/cs+/common/strings.h: -------------------------------------------------------------------------------- 1 | /* strings.h 2 | * 3 | * Copyright (C) 2014-2024 wolfSSL Inc. 4 | * 5 | * This file is part of wolfSSH. 6 | * 7 | * wolfSSH is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * wolfSSH is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with wolfSSH. If not, see . 19 | */ 20 | 21 | int strncasecmp(const char *s1, const char * s2, unsigned int sz); 22 | -------------------------------------------------------------------------------- /ide/Renesas/cs+/common/unistd.h: -------------------------------------------------------------------------------- 1 | /* unistd.h 2 | * 3 | * Copyright (C) 2014-2024 wolfSSL Inc. 4 | * 5 | * This file is part of wolfSSH. 6 | * 7 | * wolfSSH is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * wolfSSH is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with wolfSSH. If not, see . 19 | */ 20 | 21 | /* DUMMY Header */ 22 | -------------------------------------------------------------------------------- /ide/Renesas/cs+/common/user_settings.h: -------------------------------------------------------------------------------- 1 | /* user_settings.h 2 | * 3 | * Copyright (C) 2014-2024 wolfSSL Inc. 4 | * 5 | * This file is part of wolfSSH. 6 | * 7 | * wolfSSH is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * wolfSSH is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with wolfSSH. If not, see . 19 | */ 20 | #define WOLFCRYPT_ONLY 21 | #define NO_ERROR_STRINGS 22 | 23 | #define NO_MAIN_DRIVER 24 | #define NO_WRITEV 25 | #define NO_DEV_RANDOM 26 | #define NO_WOLFSSL_DIR 27 | #define NO_WOLFSSL_STUB 28 | #define NO_DYNAMIC_ARRAY /* for compilers not allowed dynamic size array */ 29 | #define NO_RC4 30 | #define NO_OLD_SHA256 31 | #define NO_FILESYSTEM 32 | 33 | #define WOLFSSL_NO_CURRDIR 34 | #define WOLFSSL_LOG_PRINTF 35 | #define WOLFSSL_SMALL_STACK 36 | #define WOLFSSL_DH_CONST 37 | #define WOLFSSL_USER_IO 38 | 39 | #define TFM_TIMING_RESISTANT 40 | #define ECC_TIMING_RESISTANT 41 | #define WC_RSA_BLINDING 42 | 43 | #define HAVE_TLS_EXTENSIONS 44 | #define HAVE_SUPPORTED_CURVES 45 | #define HAVE_AESGCM 46 | #define WOLFSSL_SHA512 47 | #define WOLFSSL_SHA384 48 | #define HAVE_ECC 49 | 50 | #define BENCH_EMBEDDED 51 | #define USE_CERT_BUFFERS_2048 52 | #define SIZEOF_LONG_LONG 8 53 | #define USER_TIME 54 | #define XTIME time 55 | #define USE_WOLF_SUSECONDS_T 56 | #define USE_WOLF_TIMEVAL_T 57 | #define WOLFSSL_GENSEED_FORTEST /* Wardning: define your own seed gen */ 58 | 59 | #define SINGLE_THREADED /* or define RTOS option */ 60 | 61 | #include "wolfssh_csplus_usersettings.h" 62 | -------------------------------------------------------------------------------- /ide/Renesas/cs+/common/wolfssh_csplus_usersettings.h: -------------------------------------------------------------------------------- 1 | /* wolfssh_csplus_usersettings..h 2 | * 3 | * Copyright (C) 2014-2024 wolfSSL Inc. 4 | * 5 | * This file is part of wolfSSH. 6 | * 7 | * wolfSSH is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * wolfSSH is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with wolfSSH. If not, see . 19 | */ 20 | 21 | #define RENESAS_CSPLUS 22 | //#define DEBUG_WOLFSSH 23 | #define WOLFSSH_NO_TIMESTAMP 24 | #define WOLFSSH_USER_IO 25 | #define WOLFSSH_THREAD 26 | -------------------------------------------------------------------------------- /ide/Renesas/cs+/demo_server/wolfssh_demo.h: -------------------------------------------------------------------------------- 1 | /* wolfssh_demo.h 2 | * 3 | * Copyright (C) 2014-2024 wolfSSL Inc. 4 | * 5 | * This file is part of wolfSSH. 6 | * 7 | * wolfSSH is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * wolfSSH is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with wolfSSH. If not, see . 19 | */ 20 | 21 | #ifndef __WOLFSSH_DEMO_H_ 22 | #define __WOLFSSH_DEMO_H_ 23 | 24 | int server_test(void); 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /ide/Renesas/cs+/demo_server/wolfssh_dummy.c: -------------------------------------------------------------------------------- 1 | /* wolfssh_dummy.c 2 | * 3 | * Copyright (C) 2014-2024 wolfSSL Inc. 4 | * 5 | * This file is part of wolfSSH. 6 | * 7 | * wolfSSH is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * wolfSSH is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with wolfSSH. If not, see . 19 | */ 20 | #ifdef HAVE_CONFIG_H 21 | #include 22 | #endif 23 | 24 | #include 25 | #include 26 | 27 | /* used for checking bytes on wire for window adjust packet read */ 28 | void ws_Ioctl(int fd, int flag, int *ret) 29 | { 30 | /* This needs to implement when using scp or sftp */ 31 | } 32 | 33 | #define YEAR 2019 34 | #define APR 4 35 | 36 | static int tick = 0; 37 | 38 | time_t time(time_t *t) 39 | { 40 | return ((YEAR-1970)*365+30*APR)*24*60*60 + tick++; 41 | } 42 | 43 | #include 44 | int strncasecmp(const char *s1, const char * s2, unsigned int sz) 45 | { 46 | for( ; sz>0; sz--, s1++, s2++){ 47 | if(toupper(*s1) < toupper(*s2)){ 48 | return -1; 49 | } 50 | if(toupper(*s1) > toupper(*s2)){ 51 | return 1; 52 | } 53 | } 54 | return 0; 55 | } -------------------------------------------------------------------------------- /ide/STM32CUBE/README.md: -------------------------------------------------------------------------------- 1 | # wolfSSH for STM32 Cube IDE 2 | 3 | The wolfSSH Cube Pack can be found [here](https://www.wolfssl.com/files/ide/I-CUBE-wolfSSH.pack) and is dependent on the `wolfCrypt` library. 4 | 5 | ## Dependencies 6 | 7 | ### wolfCrypt 8 | 9 | The wolfCrypt crypto library is required to build/run the wolfSSH pack. 10 | 11 | ### RTOS 12 | 13 | The wolfSSH pack core functionality can be built without an RTOS but to build/run the tests, FreeRTOS will have to be added as a middlware. 14 | 15 | ### Input/Output 16 | 17 | By default, the wolfSSH pack uses a dummy custom IO implementation. The user is expected to be provide their own implementation in `ide/STM32CUBE/userio_template.h`. Alternatively, they can enable LwIP and configure wolfSSH to use it. 18 | 19 | 20 | ## Building and Running Tests 21 | 22 | 1. The first step is to set up the wolfCrypt library in your ST project following the guide here [https://github.com/wolfSSL/wolfssl/blob/master/IDE/STM32Cube/README.md](https://github.com/wolfSSL/wolfssl/blob/master/IDE/STM32Cube/README.md). To run the wolfSSH unit tests, name the entry function `wolfSSHTest` instead of `wolfCryptDemo`. 23 | 24 | 2. Then install the wolfSSH Cube Pack in the same manner as the wolfSSL pack with CUBEMX. 25 | 26 | 3. Open the project `.ioc` file and click the `Software Packs` drop down menu and then `Select Components`. Expand the `wolfSSH` pack and check all the components. 27 | 28 | 4. In the `Software Packs` configuration category of the `.ioc` file, click on the wolfSSH pack and enable the library by checking the box. 29 | 30 | 5. The Pack defaults to using custom IO provided by the user. Modify `ide/STM32CUBE/userio_template.h` to supply the custom IO. If you'd like to use LwIP instead, configure the wolfSSH IO settings in the `.ioc` to enable LwIP compatibilty. You'll also have to enable LwIP in the `Middleware` configuration category of the project. Enable the `LWIP_DNS` option in the LwIP configuration settings. 31 | 32 | 6. Save your changes and select yes to the prompt asking about generating code. 33 | 34 | 7. Build the project and run the unit tests. 35 | 36 | ## Notes 37 | - Make sure to make [these changes](https://github.com/wolfSSL/wolfssl/tree/master/IDE/STM32Cube#stm32-printf) to redirect the printf's to the UART. 38 | 39 | - If looking to enable filesystem support (required for SFTP), the pack assumes the user has defined their own filesystem in `wolfssh/myFilesystem.h`. That file will originally contain a dummy filesystem. If going the FATFS route, make sure to replace `#define WOLFSSH_USER_FILESYSTEM` with `#define WOLFSSH_FATFS` in the `wolfSSL.I-CUBE-wolfSSH_conf.h` header file. The wolfSSL Cube Pack also defaults to disabling filesystem support so make sure to remove `#define NO_FILESYSTEM` from `wolfSSL.I-CUBE-wolfSSL_conf.h`. 40 | 41 | - If building with LwIP and you encounter the error `multiple definition of 'errno'` in `Middlewares/Third_Party/LwIP/system/OS/sys_arch.c`, modify the file as shown below. 42 | ``` 43 | #if defined(LWIP_SOCKET_SET_ERRNO) && defined(LWIP_PROVIDE_ERRNO) 44 | - int errno; 45 | + extern int errno; 46 | #endif 47 | ``` 48 | -------------------------------------------------------------------------------- /ide/STM32CUBE/include.am: -------------------------------------------------------------------------------- 1 | # vim:ft=automake 2 | # included from Top Level Makefile.am 3 | # All paths should be given relative to the root 4 | 5 | EXTRA_DIST+= ide/STM32CUBE/main.c 6 | EXTRA_DIST+= ide/STM32CUBE/wolfssh_test.c 7 | EXTRA_DIST+= ide/STM32CUBE/wolfssh_test.h 8 | EXTRA_DIST+= ide/STM32CUBE/myFilesystem.h 9 | EXTRA_DIST+= ide/STM32CUBE/README.md 10 | EXTRA_DIST+= ide/STM32CUBE/default_conf.ftl 11 | -------------------------------------------------------------------------------- /ide/STM32CUBE/userio_template.h: -------------------------------------------------------------------------------- 1 | /* userio_template.h 2 | * 3 | * Copyright (C) 2014-2024 wolfSSL Inc. 4 | * 5 | * This file is part of wolfSSH. 6 | * 7 | * wolfSSH is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * wolfSSH is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with wolfSSH. If not, see . 19 | */ 20 | 21 | 22 | #ifndef USERIO_TEMPLATE_H 23 | #define USERIO_TEMPLATE_H 24 | 25 | #ifdef WOLFSSH_USER_IO 26 | 27 | #define SOCK_STREAM 1 28 | #define SOCK_DGRAM 2 29 | #define SOCK_RAW 3 30 | 31 | #define SOL_SOCKET 0xfff 32 | #define SO_REUSEADDR 0x0004 33 | 34 | #define AF_INET 2 35 | #define INADDR_ANY ((uint32_t)0x00000000UL) 36 | 37 | #define socklen_t uint32_t 38 | 39 | typedef struct { int s_addr; } in_addr; 40 | 41 | struct sockaddr { int i; }; 42 | 43 | typedef struct sockaddr sockaddr; 44 | 45 | struct sockaddr_in{ 46 | int sin_len; 47 | int sin_family; 48 | int sin_port; 49 | in_addr sin_addr; 50 | }; 51 | 52 | typedef struct sockaddr_in sockaddr_in; 53 | 54 | struct hostent{ 55 | char *h_name; 56 | int h_length; 57 | char **h_addr_list; 58 | }; 59 | 60 | typedef struct hostent hostent; 61 | 62 | static inline int inet_addr(const char* n){ 63 | (void) n; 64 | return 0; 65 | } 66 | 67 | static inline int htons(unsigned int n){ 68 | (void) n; 69 | return 0; 70 | } 71 | 72 | static inline int ntohs(unsigned int n){ 73 | (void) n; 74 | return 0; 75 | } 76 | 77 | static inline int socket(int d, int t, int p) { 78 | (void) d; (void) t; (void) p; 79 | return 0; 80 | } 81 | 82 | static inline int setsockopt(int s, int l, int n, const void *o, 83 | socklen_t len) { 84 | (void) s; (void) l; (void) n; (void) o; (void) len; 85 | return 0; 86 | } 87 | 88 | static inline int getsockname(int s, struct sockaddr *n, socklen_t* len) { 89 | (void) s; (void) n; (void) len; 90 | return 0; 91 | } 92 | 93 | static inline int bind(int s, const struct sockaddr *n, socklen_t l) { 94 | (void) s; (void) n; (void) l; 95 | return 0; 96 | } 97 | 98 | static inline int listen(int s, int b) { 99 | (void) s; (void) b; 100 | return 0; 101 | } 102 | 103 | static inline struct hostent* gethostbyname(const char* n) { 104 | (void) n; 105 | return NULL; 106 | } 107 | 108 | #endif /* WOLFSSH_USER_IO */ 109 | 110 | #endif 111 | -------------------------------------------------------------------------------- /ide/STM32CUBE/wolfssh_test.c: -------------------------------------------------------------------------------- 1 | /* wolfssh_test.c 2 | * 3 | * Copyright (C) 2014-2024 wolfSSL Inc. 4 | * 5 | * This file is part of wolfSSH. 6 | * 7 | * wolfSSH is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * wolfSSH is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with wolfSSH. If not, see . 19 | */ 20 | 21 | #include "wolfssh_test.h" 22 | 23 | #ifndef SINGLE_THREADED 24 | #include 25 | 26 | #ifdef WOLFSSL_DEBUG_MEMORY 27 | /* for memory debugging */ 28 | #include 29 | #endif 30 | #endif 31 | 32 | #include 33 | #include 34 | 35 | 36 | #ifdef CMSIS_OS2_H_ 37 | void wolfSSHTest(void* argument) 38 | #else 39 | void wolfSSHTest(const void* argument) 40 | #endif 41 | { 42 | int ret = 0; 43 | #if 0 44 | wolfSSL_Debugging_ON(); 45 | wolfSSH_Debugging_ON(); 46 | #endif 47 | 48 | printf("Running wolfSSH Tests...\n"); 49 | 50 | /* TODO: Uncomment once proper threading abstractions have been implemented 51 | * in wolfSSL */ 52 | /* if (wolfSSH_TestsuiteTest(0, NULL)) 53 | ret = -1; */ 54 | if (wolfSSH_UnitTest(0, NULL)) 55 | ret = -1; 56 | if (wolfSSH_ApiTest(0, NULL)) 57 | ret = -1; 58 | 59 | printf("wolfSSH Test: Return code %d\n", ret); 60 | 61 | } 62 | -------------------------------------------------------------------------------- /ide/STM32CUBE/wolfssh_test.h: -------------------------------------------------------------------------------- 1 | /* wolfssh_test.h 2 | * 3 | * Copyright (C) 2014-2024 wolfSSL Inc. 4 | * 5 | * This file is part of wolfSSH. 6 | * 7 | * wolfSSH is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * wolfSSH is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with wolfSSH. If not, see . 19 | */ 20 | 21 | #ifndef WOLFSSH_TEST_H_ 22 | #define WOLFSSH_TEST_H_ 23 | 24 | #ifdef HAVE_CONFIG_H 25 | #include 26 | #endif 27 | 28 | #include 29 | #include 30 | 31 | #include "../../tests/unit.h" 32 | #include "../../tests/api.h" 33 | #include "../../tests/testsuite.h" 34 | 35 | #ifndef SINGLE_THREADED 36 | #include 37 | #endif 38 | 39 | #ifdef CMSIS_OS2_H_ 40 | void wolfSSHTest(void* argument); 41 | #else 42 | void wolfSSHTest(void const * argument); 43 | #endif 44 | 45 | #endif /* WOLFSSH_TEST_H_ */ 46 | -------------------------------------------------------------------------------- /ide/include.am: -------------------------------------------------------------------------------- 1 | # vim:ft=automake 2 | # included from Top Level Makefile.am 3 | # All paths should be given relative to the root 4 | 5 | include ide/winvs/include.am 6 | include ide/mplabx/include.am 7 | include ide/CSBENCH/include.am 8 | include ide/MQX/include.am 9 | include ide/IAR-EWARM/include.am 10 | include ide/STM32CUBE/include.am 11 | 12 | EXTRA_DIST += ide/Renesas 13 | -------------------------------------------------------------------------------- /ide/mplabx/README.md: -------------------------------------------------------------------------------- 1 | # wolfSSH MPLABX 2 | 3 | This is example project to create a wolfSSH library and example code for adding 4 | a wolfSSH echoserver to a MPLABX project. 5 | 6 | Tested on a ATSAMV71Q21B with MPLABX version 6.20. 7 | 8 | ### Building wolfSSH library 9 | 10 | The library project is located at ide/mplabx/wolfssh.X 11 | 12 | - First open wolfssh.X with MPLABX IDE then click on "CM" content manager and 13 | import the ide/mplabx/wolfssh.X/mcc-manifest-generated-success.yml file. 14 | - Click apply. 15 | - Next click "MCC" and "generate". 16 | - To build from the command line, do the following after the XC32 toolchain has 17 | been installed. 18 | 19 | ``` 20 | cd ide/mplabx/wolfssh.X 21 | make 22 | ``` 23 | 24 | - To build using the IDE open the project ide/mplabx/wolfssh.X and click build. 25 | 26 | 27 | This will produce a wolfssh.X.a library in the directory 28 | ide/mplabx/wolfssh.X/dist/default/production/wolfssh.X.a 29 | 30 | The application and wolfSSL must be built with the same user_settings.h as the 31 | wolfSSH library was built with! Differences in macro's defined for 32 | configuration will cause undefined behavior and potential crashes. 33 | 34 | ### Building an example app 35 | 36 | 1) Adjust the "Preprocessor macros" to include WOLFSSL_USER_SETTINGS and add an 37 | include path to ide/mplabx/user_settings.h. 38 | 2) Remove the generated app.c from Source File 39 | 3) Link to the wolfssh.X.a library. Properties->Libraries->Add Library/Object 40 | File... 41 | 4) Right click on the project and add existing item. Select ide/mplabx/wolfssh.c 42 | 5) Increase the heap size to 200,000 by right clicking on the project, selecting 43 | "Properties"->"x32-ld" 44 | 45 | Notes: 46 | 47 | For the current project this was tested with the heap and stack set to 200,000 48 | each. This was not trimed to see the minumum possible heap and stack usage yet. 49 | The TX buffer size used was set to 1024. The example was developed with wolfssh 50 | version 1.4.20. 51 | 52 | After building and flashing the board a wolfSSH echoserver will be open on port 53 | 22 which can be connected to by using the example client bundled with wolfSSH. 54 | ```./examples/client/client -u jill -P upthehill -h 192.168.1.120 -p 22``` 55 | -------------------------------------------------------------------------------- /ide/mplabx/include.am: -------------------------------------------------------------------------------- 1 | # vim:ft=automake 2 | # All paths should be given relative to the root 3 | 4 | EXTRA_DIST+= ide/mplabx/README.md 5 | EXTRA_DIST+= ide/mplabx/user_settings.h 6 | EXTRA_DIST+= ide/mplabx/wolfssh.c 7 | 8 | EXTRA_DIST+= wolfssh.X/Makefile 9 | EXTRA_DIST+= wolfssh.X/mcc-manifest-generated-success.yml 10 | EXTRA_DIST+= wolfssh.X/wolfssh.mc3 11 | EXTRA_DIST+= wolfssh.X/nbproject/configurations.xml 12 | EXTRA_DIST+= wolfssh.X/nbproject/project.xml 13 | -------------------------------------------------------------------------------- /ide/mplabx/user_settings.h: -------------------------------------------------------------------------------- 1 | #ifndef USER_SETTINGS_H 2 | #define USER_SETTINGS_H 3 | 4 | /* include Microchip configuration first and then make additional changes */ 5 | #include "configuration.h" 6 | 7 | #include 8 | 9 | /* Turn on filesystem support for SFTP use */ 10 | #undef NO_FILESYSTEM 11 | 12 | /* wolfSSH configuration macros */ 13 | #define WOLFSSL_WOLFSSH 14 | #ifndef NO_FILESYSTEM 15 | #define WOLFSSH_SFTP 16 | #endif 17 | #define DEFAULT_WINDOW_SZ 16384 18 | #define WOLFSSH_NO_HMAC_SHA2_512 19 | 20 | /* do not use dirent with wolfSSL */ 21 | #define NO_WOLFSSL_DIR 22 | 23 | /* avoid the defualt settings in older wolfssl versions from 24 | * wolfssl/wolfcryt/settings.h */ 25 | #undef MICROCHIP_PIC32 26 | 27 | #undef TFM_TIMING_RESISTANT 28 | #define TFM_TIMING_RESISTANT 29 | 30 | #undef ECC_TIMING_RESISTANT 31 | #define ECC_TIMING_RESISTANT 32 | 33 | /* In older versions of wolfSSL (5.7.6 and older) the strcasecmp and strncasecmp 34 | * were dependent on the macro MICROCHIP_PIC32. Defining them here overrides 35 | * that. */ 36 | #if (__XC32_VERSION >= 1000) && (__XC32_VERSION < 4000) 37 | #define XSTRCASECMP(s1,s2) strcasecmp((s1),(s2)) 38 | #define XSTRNCASECMP(s1,s2,n) strncasecmp((s1),(s2),(n)) 39 | #else 40 | #define XSTRCASECMP(s1,s2) strcmp((s1),(s2)) 41 | #define XSTRNCASECMP(s1,s2,n) strncmp((s1),(s2),(n)) 42 | #endif 43 | 44 | /* allow signature wrapper api for wolfSSH use */ 45 | #undef NO_SIG_WRAPPER 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /ide/mplabx/wolfssh.X/mcc-manifest-generated-success.yml: -------------------------------------------------------------------------------- 1 | # This file has been autogenerated by MPLAB Code Configurator. Please do not edit this file. 2 | 3 | manifest_file_version: 1.0.0 4 | project: wolfssh 5 | creation_date: 2025-04-02T16:56:35.669-06:00[America/Denver] 6 | operating_system: Mac OS X 7 | mcc_mode: IDE 8 | mcc_mode_version: v6.20 9 | device_name: ATSAMV71Q21B 10 | compiler: XC32 4.35 11 | mcc_version: 5.5.0 12 | mcc_core_version: 5.7.0 13 | content_manager_version: 5.0.1 14 | is_mcc_offline: false 15 | is_using_prerelease_versions: false 16 | mcc_content_registries: https://registry.npmjs.org/ 17 | device_library: {library_class: com.microchip.mcc.harmony.Harmony3Library, name: Harmony 18 | V3, version: 1.5.5} 19 | packs: {name: SAMV71_DFP, version: 4.12.237} 20 | modules: 21 | - {name: core, type: HARMONY, version: v3.13.1} 22 | - {name: csp, type: HARMONY, version: v3.18.0} 23 | - {name: filex, type: HARMONY, version: v6.2.1_rel} 24 | - {name: CMSIS_5, type: HARMONY, version: 5.9.0} 25 | - {name: littlefs, type: HARMONY, version: v2.10.1} 26 | - {name: wolfssl, type: HARMONY, version: v5.4.0} 27 | - {name: net, type: HARMONY, version: v3.11.0} 28 | - {name: crypto, type: HARMONY, version: v3.8.1} 29 | - {name: CMSIS-FreeRTOS, type: HARMONY, version: v10.5.1} 30 | -------------------------------------------------------------------------------- /ide/mplabx/wolfssh.X/nbproject/project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | com.microchip.mplab.nbide.embedded.makeproject 4 | 5 | 6 | wolfssh 7 | 92aa1711-a46a-4125-9aea-fd01c492463b 8 | 0 9 | ISO-8859-1 10 | 11 | 12 | ../../../src 13 | .. 14 | ../../../wolfssh 15 | 16 | 17 | 18 | default 19 | 3 20 | 21 | 22 | 23 | false 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /ide/winvs/README.md: -------------------------------------------------------------------------------- 1 | VisualStudio solution for wolfSSH 2 | ================================= 3 | 4 | The solution file, wolfssh.sln, facilitates bulding wolfSSH and its 5 | example and test programs. The solution provides both Debug and Release 6 | builds of Static and Dynamic 32- or 64-bit libraries. The file 7 | `user_settings.h` should be used in the wolfSSL build to configure it. 8 | 9 | 10 | This project assumes that the wolfSSH and wolfSSL source directories 11 | are installed side-by-side and do not have the version number in their 12 | names: 13 | 14 | Projects\ 15 | wolfssh\ 16 | wolfssl\ 17 | 18 | 19 | The file `wolfssh\ide\winvs\user_settings.h` contains the settings used to 20 | configure wolfSSL with the appropriate settings. This file must be copied 21 | from the directory `wolfssh\ide\winvs` to `wolfssl\IDE\WIN`. If you change 22 | one copy you must change both copies. The option `WOLFCRYPT_ONLY` disables 23 | the build of the wolfSSL files and only builds the wolfCrypt algorithms. To 24 | also keep wolfSSL, delete that option. 25 | 26 | 27 | User Macros 28 | ----------- 29 | 30 | The solution is using user macros to indicate the location of the 31 | wolfSSL library and headers. All paths are set to the default build 32 | destinations in the wolfssl64 solution. The user macro `wolfCryptDir` 33 | is used as the base path for finding the libraries. It is initially 34 | set to `..\..\..\..\wolfssl`. And then, for example, the additional 35 | include directories value for the API test project is set to 36 | `$(wolfCryptDir)`. 37 | 38 | 39 | The wolfCryptDir path must be relative to the project files, which are 40 | all one directory down 41 | 42 | wolfssh/wolfssh.vcxproj 43 | unit-test/unit-test.vcxproj 44 | 45 | etc. The other user macros are the directories where the wolfSSL 46 | libraries for the different builds may be found. So the user macro 47 | `wolfCryptDllRelease64` is initially set to 48 | 49 | $(wolfCryptDir)\DLL Release\x64 50 | 51 | This value is used in the debugging environment for the echoserver's 52 | 64-bit DLL Release build is set to 53 | 54 | PATH=$(wolfCryptDllRelease64);%PATH% 55 | 56 | When you run the echoserver from the debugger, it finds the wolfSSL 57 | DLL in that directory. 58 | 59 | 60 | SSHD Service 61 | ----------- 62 | 63 | Creating a new service 64 | `sc.exe create wolfSSHd binpath="D:\work\wolfssh\ide\winvs\Debug\x64\wolfsshd.exe -f -h -p "` 65 | 66 | Starting wolfSSHd service run the following command in an adminstrator power shell session: 67 | `sc.exe start wolfSSHd` 68 | 69 | To stop the service run the following in an adminstrator power shell session: 70 | `sc.exe stop wolfSSHd` 71 | 72 | To delete the service run 73 | `sc.exe delete wolfSSHd` 74 | -------------------------------------------------------------------------------- /ide/winvs/include.am: -------------------------------------------------------------------------------- 1 | # vim:ft=automake 2 | # All paths should be given relative to the root 3 | 4 | EXTRA_DIST+= ide/winvs/README.md 5 | EXTRA_DIST+= ide/winvs/user_settings.h 6 | EXTRA_DIST+= ide/winvs/wolfssh.sln 7 | EXTRA_DIST+= ide/winvs/wolfssh.props 8 | EXTRA_DIST+= ide/winvs/wolfssh/wolfssh.vcxproj 9 | EXTRA_DIST+= ide/winvs/api-test/api-test.vcxproj 10 | EXTRA_DIST+= ide/winvs/unit-test/unit-test.vcxproj 11 | EXTRA_DIST+= ide/winvs/client/client.vcxproj 12 | EXTRA_DIST+= ide/winvs/echoserver/echoserver.vcxproj 13 | EXTRA_DIST+= ide/winvs/testsuite/testsuite.vcxproj 14 | EXTRA_DIST+= ide/winvs/wolfsftp-client/wolfsftp-client.vcxproj 15 | EXTRA_DIST+= ide/winvs/wolfsshd/wolfsshd.vcxproj 16 | -------------------------------------------------------------------------------- /ide/winvs/user_settings.h: -------------------------------------------------------------------------------- 1 | #ifndef _WIN_USER_SETTINGS_H_ 2 | #define _WIN_USER_SETTINGS_H_ 3 | 4 | /* Verify this is Windows */ 5 | #ifndef _WIN32 6 | #error This user_settings.h header is only designed for Windows 7 | #endif 8 | 9 | #define WOLFSSL_WOLFSSH 10 | #define WOLFCRYPT_ONLY 11 | #define WOLFSSL_KEY_GEN 12 | #define HAVE_ECC 13 | #define HAVE_AESGCM 14 | #define HAVE_HASHDRBG 15 | #define WOLFSSL_AES_COUNTER 16 | #define WOLFSSL_AES_DIRECT 17 | #define WOLFSSL_SHA384 18 | #define WOLFSSL_SHA512 19 | #define NO_PSK 20 | #define NO_HC128 21 | #define NO_RC4 22 | #define NO_RABBIT 23 | #define NO_DSA 24 | #define NO_MD4 25 | #define WC_RSA_BLINDING 26 | #define WOLFSSL_PUBLIC_MP 27 | #define WC_NO_HARDEN 28 | 29 | #define WOLFSSH_TERM 30 | #ifndef WOLFSSH_TERM 31 | /* Threading is needed for opening a psuedo terminal in the examples */ 32 | #define SINGLE_THREADED 33 | #endif 34 | 35 | /* adding X509 support */ 36 | #if 0 37 | /* Uses CertManager which is in the TLS layer */ 38 | #undef WOLFCRYPT_ONLY 39 | 40 | #undef WOLFSSL_CERT_GEN 41 | #define WOLFSSL_CERT_GEN 42 | 43 | /* Used for comparing IP of peer with IP found in certificate */ 44 | #undef WOLFSSL_IP_ALT_NAME 45 | #define WOLFSSL_IP_ALT_NAME 46 | 47 | #undef HAVE_TLS_EXTENSIONS 48 | #define HAVE_TLS_EXTENSIONS 49 | 50 | #undef OPENSSL_ALL 51 | #define OPENSSL_ALL 52 | 53 | /* Turn off additional FPKI support checks (Federal PKI) on certificates */ 54 | #undef WOLFSSH_NO_FPKI 55 | #define WOLFSSH_NO_FPKI 56 | 57 | #undef WOLFSSH_CERTS 58 | #define WOLFSSH_CERTS 59 | #endif 60 | 61 | 62 | /* default SSHD options */ 63 | #if 0 64 | #undef WOLFSSH_SSHD 65 | #define WOLFSSH_SSHD 66 | 67 | /* handle shell connections */ 68 | #undef WOLFSSH_SHELL 69 | #define WOLFSSH_SHELL 70 | 71 | /* handle SCP connection requests */ 72 | #undef WOLFSSH_SCP 73 | #define WOLFSSH_SCP 74 | 75 | /* handle SFTP connection requests */ 76 | #undef WOLFSSH_SFTP 77 | #define WOLFSSH_SFTP 78 | 79 | #endif 80 | 81 | #endif /* _WIN_USER_SETTINGS_H_ */ 82 | -------------------------------------------------------------------------------- /ide/winvs/wolfssh.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | ..\..\..\..\wolfssl 6 | $(wolfCryptDir)\Debug\Win32 7 | $(wolfCryptDir)\Release\Win32 8 | $(wolfCryptDir)\Debug\x64 9 | $(wolfCryptDir)\Release\x64 10 | $(wolfCryptDir)\DLL Debug\Win32 11 | $(wolfCryptDir)\DLL Release\Win32 12 | $(wolfCryptDir)\DLL Debug\x64 13 | $(wolfCryptDir)\DLL Release\x64 14 | 15 | 16 | 17 | 18 | $(wolfCryptDir) 19 | 20 | 21 | $(wolfCryptDebug32) 22 | 23 | 24 | $(wolfCryptRelease32) 25 | 26 | 27 | $(wolfCryptDebug64) 28 | 29 | 30 | $(wolfCryptRelease64) 31 | 32 | 33 | $(wolfCryptDllDebug32) 34 | 35 | 36 | $(wolfCryptDllRelease32) 37 | 38 | 39 | $(wolfCryptDllDebug64) 40 | 41 | 42 | $(wolfCryptDllRelease64) 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /keys/ca-cert-ecc.der: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gojimmypi/wolfssh/b7418a21a36ea3b7b67b5f01a86f5b2ea41aa151/keys/ca-cert-ecc.der -------------------------------------------------------------------------------- /keys/ca-key-ecc.der: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gojimmypi/wolfssh/b7418a21a36ea3b7b67b5f01a86f5b2ea41aa151/keys/ca-key-ecc.der -------------------------------------------------------------------------------- /keys/ca-key-ecc.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN PRIVATE KEY----- 2 | MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgAuEzmHeXrEpZbSib 3 | bqCTmwdxi01gY4WZ5rsWcOkK9oChRANCAAQC09lu1gGORci5kDHlwEzjnq0pOJi6 4 | ENbpCSqAqS4XKrmKvzODRuOVC+R3QLU7Q0UzD2FTfDdEwcv8gMroQ+qn 5 | -----END PRIVATE KEY----- 6 | -------------------------------------------------------------------------------- /keys/fred-cert.der: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gojimmypi/wolfssh/b7418a21a36ea3b7b67b5f01a86f5b2ea41aa151/keys/fred-cert.der -------------------------------------------------------------------------------- /keys/fred-cert.pem: -------------------------------------------------------------------------------- 1 | Certificate: 2 | Data: 3 | Version: 3 (0x2) 4 | Serial Number: 7 (0x7) 5 | Signature Algorithm: ecdsa-with-SHA256 6 | Issuer: C = US, ST = Washington, L = Seattle, O = wolfSSL, OU = Development, CN = www.wolfssl.com, emailAddress = ca@example.com 7 | Validity 8 | Not Before: Oct 1 05:54:44 2022 GMT 9 | Not After : Sep 28 05:54:44 2032 GMT 10 | Subject: C = US, ST = WA, L = Seattle, O = wolfSSL Inc, OU = Development, CN = Fred, emailAddress = fred@example.com 11 | Subject Public Key Info: 12 | Public Key Algorithm: id-ecPublicKey 13 | Public-Key: (256 bit) 14 | pub: 15 | 04:12:dc:16:d1:17:81:a6:02:f0:0f:11:90:bb:32: 16 | 85:66:0e:76:00:62:ac:aa:e3:b9:26:1c:2a:e2:28: 17 | f8:dd:d8:79:3f:c0:02:5e:d1:d1:c5:fe:3c:63:f5: 18 | 1f:ae:13:4b:69:ca:e8:ed:f4:36:ba:62:e0:a1:c8: 19 | 18:10:4b:55:e1 20 | ASN1 OID: prime256v1 21 | NIST CURVE: P-256 22 | X509v3 extensions: 23 | X509v3 Subject Key Identifier: 24 | 9C:AF:03:66:F5:F0:04:FC:22:8F:8E:20:26:40:47:01:CE:D6:7A:8D 25 | X509v3 Authority Key Identifier: 26 | keyid:56:8E:9A:C3:F0:42:DE:18:B9:45:55:6E:F9:93:CF:EA:C3:F3:A5:21 27 | DirName:/C=US/ST=Washington/L=Seattle/O=wolfSSL/OU=Development/CN=www.wolfssl.com/emailAddress=ca@example.com 28 | serial:06 29 | 30 | X509v3 Subject Alternative Name: 31 | othername: 32 | Signature Algorithm: ecdsa-with-SHA256 33 | 30:45:02:21:00:de:95:bb:3a:54:c3:81:6e:f2:89:da:2f:99: 34 | 37:e7:40:13:be:40:5c:93:84:0f:36:2e:80:d6:8a:f5:e3:6a: 35 | 0c:02:20:55:6b:3a:c8:ed:ce:d1:29:15:b5:32:21:3c:a5:0e: 36 | bc:84:08:db:a3:ef:c1:c5:c3:79:1f:07:c9:c0:bb:b0:f5 37 | -----BEGIN CERTIFICATE----- 38 | MIIDITCCAsegAwIBAgIBBzAKBggqhkjOPQQDAjCBlTELMAkGA1UEBhMCVVMxEzAR 39 | BgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxEDAOBgNVBAoMB3dv 40 | bGZTU0wxFDASBgNVBAsMC0RldmVsb3BtZW50MRgwFgYDVQQDDA93d3cud29sZnNz 41 | bC5jb20xHTAbBgkqhkiG9w0BCQEWDmNhQGV4YW1wbGUuY29tMB4XDTIyMTAwMTA1 42 | NTQ0NFoXDTMyMDkyODA1NTQ0NFowgYgxCzAJBgNVBAYTAlVTMQswCQYDVQQIDAJX 43 | QTEQMA4GA1UEBwwHU2VhdHRsZTEUMBIGA1UECgwLd29sZlNTTCBJbmMxFDASBgNV 44 | BAsMC0RldmVsb3BtZW50MQ0wCwYDVQQDDARGcmVkMR8wHQYJKoZIhvcNAQkBFhBm 45 | cmVkQGV4YW1wbGUuY29tMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEEtwW0ReB 46 | pgLwDxGQuzKFZg52AGKsquO5Jhwq4ij43dh5P8ACXtHRxf48Y/UfrhNLacro7fQ2 47 | umLgocgYEEtV4aOCAREwggENMB0GA1UdDgQWBBScrwNm9fAE/CKPjiAmQEcBztZ6 48 | jTCBwgYDVR0jBIG6MIG3gBRWjprD8ELeGLlFVW75k8/qw/OlIaGBm6SBmDCBlTEL 49 | MAkGA1UEBhMCVVMxEzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0 50 | bGUxEDAOBgNVBAoMB3dvbGZTU0wxFDASBgNVBAsMC0RldmVsb3BtZW50MRgwFgYD 51 | VQQDDA93d3cud29sZnNzbC5jb20xHTAbBgkqhkiG9w0BCQEWDmNhQGV4YW1wbGUu 52 | Y29tggEGMCcGA1UdEQQgMB6gHAYKKwYBBAGCNxQCA6AODAxmcmVkQGV4YW1wbGUw 53 | CgYIKoZIzj0EAwIDSAAwRQIhAN6VuzpUw4Fu8onaL5k350ATvkBck4QPNi6A1or1 54 | 42oMAiBVazrI7c7RKRW1MiE8pQ68hAjbo+/BxcN5HwfJwLuw9Q== 55 | -----END CERTIFICATE----- 56 | -------------------------------------------------------------------------------- /keys/fred-key.der: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gojimmypi/wolfssh/b7418a21a36ea3b7b67b5f01a86f5b2ea41aa151/keys/fred-key.der -------------------------------------------------------------------------------- /keys/fred-key.pem: -------------------------------------------------------------------------------- 1 | ASN1 OID: prime256v1 2 | -----BEGIN EC PARAMETERS----- 3 | BggqhkjOPQMBBw== 4 | -----END EC PARAMETERS----- 5 | -----BEGIN EC PRIVATE KEY----- 6 | MHcCAQEEIEkbklf9L+5N9RuSnwmbgv/yCarqVK3j+PagHLtcDsw7oAoGCCqGSM49 7 | AwEHoUQDQgAEEtwW0ReBpgLwDxGQuzKFZg52AGKsquO5Jhwq4ij43dh5P8ACXtHR 8 | xf48Y/UfrhNLacro7fQ2umLgocgYEEtV4Q== 9 | -----END EC PRIVATE KEY----- 10 | -------------------------------------------------------------------------------- /keys/gretel-key-ecc-384.der: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gojimmypi/wolfssh/b7418a21a36ea3b7b67b5f01a86f5b2ea41aa151/keys/gretel-key-ecc-384.der -------------------------------------------------------------------------------- /keys/gretel-key-ecc-384.pem: -------------------------------------------------------------------------------- 1 | ASN1 OID: secp384r1 2 | NIST CURVE: P-384 3 | -----BEGIN EC PARAMETERS----- 4 | BgUrgQQAIg== 5 | -----END EC PARAMETERS----- 6 | -----BEGIN EC PRIVATE KEY----- 7 | MIGkAgEBBDCbJgFByjzObZPIsdeDWJhousjR4dS+RusTeuAWvz1nJjKEn6jmnMMf 8 | Lnl7MK7+AkmgBwYFK4EEACKhZANiAAQMx2lasNsBTgRRynJDNpYRIiT9o9w8P/zv 9 | XyHehhIJtNp50R4sSqJOWcLHxqNoqLXzLz2HSLQ0rhi+bS8anYDnOhaP9FI4KDuU 10 | 0gRlIukRBK3pbRWPxf+t6YLOH9P0xPo= 11 | -----END EC PRIVATE KEY----- 12 | -------------------------------------------------------------------------------- /keys/gretel-key-ecc-384.pub: -------------------------------------------------------------------------------- 1 | ecdsa-sha2-nistp384 AAAAE2VjZHNhLXNoYTItbmlzdHAzODQAAAAIbmlzdHAzODQAAABhBAzHaVqw2wFOBFHKckM2lhEiJP2j3Dw//O9fId6GEgm02nnRHixKok5ZwsfGo2iotfMvPYdItDSuGL5tLxqdgOc6Fo/0UjgoO5TSBGUi6REEreltFY/F/63pgs4f0/TE+g== gretel 2 | -------------------------------------------------------------------------------- /keys/gretel-key-ecc-521.der: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gojimmypi/wolfssh/b7418a21a36ea3b7b67b5f01a86f5b2ea41aa151/keys/gretel-key-ecc-521.der -------------------------------------------------------------------------------- /keys/gretel-key-ecc-521.pem: -------------------------------------------------------------------------------- 1 | ASN1 OID: secp521r1 2 | NIST CURVE: P-521 3 | -----BEGIN EC PARAMETERS----- 4 | BgUrgQQAIw== 5 | -----END EC PARAMETERS----- 6 | -----BEGIN EC PRIVATE KEY----- 7 | MIHcAgEBBEIAFwRmxnrUpSzry9y1gD32Ahr6Vxm1NK7gJUFgmftir37yftsyucaz 8 | vLGcpBEEYmtylCFHKa95Fcy0VNxAAaUfVyOgBwYFK4EEACOhgYkDgYYABAD3gANm 9 | zvkxOBN8MYwRBYO6B//7TTCtA2vwG/W5bqiVVxznXWj0xiFrgayApvH7FDpLHiJ8 10 | +c1vUsRVEa8PY5QPsgFow+xv0P2WSrRkn4/UUquftPs1ZHPhdr06LjS19ObvWM8x 11 | FZYU6n0i28UWCUR5qE+BCTzZDWYT8V24YD8UhpaYIw== 12 | -----END EC PRIVATE KEY----- 13 | -------------------------------------------------------------------------------- /keys/gretel-key-ecc-521.pub: -------------------------------------------------------------------------------- 1 | ecdsa-sha2-nistp521 AAAAE2VjZHNhLXNoYTItbmlzdHA1MjEAAAAIbmlzdHA1MjEAAACFBAD3gANmzvkxOBN8MYwRBYO6B//7TTCtA2vwG/W5bqiVVxznXWj0xiFrgayApvH7FDpLHiJ8+c1vUsRVEa8PY5QPsgFow+xv0P2WSrRkn4/UUquftPs1ZHPhdr06LjS19ObvWM8xFZYU6n0i28UWCUR5qE+BCTzZDWYT8V24YD8UhpaYIw== gretel 2 | -------------------------------------------------------------------------------- /keys/gretel-key-ecc.der: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gojimmypi/wolfssh/b7418a21a36ea3b7b67b5f01a86f5b2ea41aa151/keys/gretel-key-ecc.der -------------------------------------------------------------------------------- /keys/gretel-key-ecc.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN EC PRIVATE KEY----- 2 | MHcCAQEEIFWdSB6pL/oYzrP6d0YAxNvTiz6d72/NN0aHIzx3mat4oAoGCCqGSM49 3 | AwEHoUQDQgAEoC0fxypoNu0kWO2+IuhscGaMK0bnoMyQ/oDgzYf3Nfb9gKDWH1th 4 | LtYd31RAPBc7UeEhnNFh5xeHtIb0/gaFFg== 5 | -----END EC PRIVATE KEY----- 6 | -------------------------------------------------------------------------------- /keys/gretel-key-ecc.pub: -------------------------------------------------------------------------------- 1 | ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBKAtH8cqaDbtJFjtviLobHBmjCtG56DMkP6A4M2H9zX2/YCg1h9bYS7WHd9UQDwXO1HhIZzRYecXh7SG9P4GhRY= gretel 2 | -------------------------------------------------------------------------------- /keys/gretel-key-rsa.der: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gojimmypi/wolfssh/b7418a21a36ea3b7b67b5f01a86f5b2ea41aa151/keys/gretel-key-rsa.der -------------------------------------------------------------------------------- /keys/gretel-key-rsa.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIIEowIBAAKCAQEAqg8EVU0VZP8Iz4aKOuvjM7a3N9SrMQ2fpAFdNd/Tx0PsLLnj 3 | aW2uozZ+aOplExDq8a89CzLAyTgTOwphtPfN5BeIESIoRAqUNK3Izj+gUn21UxPZ 4 | nyCuSLFImRnfEqBPZEldqSdhb2XgUBDaAMRBZNM2S/bXIT0vjglBmyuEg487jWZf 5 | 99DHM7O9zdzAc4uidaD6O7BZaswennAYytiqY7rOGNa2BaYSZ1MbSrwdLPoaGmna 6 | 7m4hOe3Sugax+YmcFS00Crsd9bgiSz4YpLSN4i23ZRmRHLSZE2rH1UrFIs8FSMkY 7 | 4VSpm3SERsJFN/A9ONwEdYdJlKBgjyCrqnBTHwIDAQABAoIBADTkttRRRXZEXNkv 8 | X480D1bmXdZfr19yfVTll7hKBfTUi4Dd0H3aP5dEO80mGonzmR/TAYmaH5x2dITI 9 | ldtTuBZZu1iY5y1CnRZFd0+vOo5tyxgr9GQqJgs2GP6FrXx9oDPxHdCfDw83AK3m 10 | j+ftIunZR+oYvJD6FvB2sJEy1+STBoI6znDILaJzm0sR6YCnaH05cfVTB/UyNisy 11 | 8OAIJrhB+oiH/BdWyYDhVM3E09uFt8b5+rJVqhQ+G+dFzRNsTLLAzADGWtxr3Yl6 12 | XtHjNDE/HobMgjlH6CkXPZ5ZO3wkUPg4EuTaS1atlaxWqHqp/3OffB8rPGxg0N+n 13 | w9NRbwECgYEA1E6AgiCVOj7fIFcznoEJSu2tcdPcCD+PopWisNWNE678ZqlUsD/4 14 | 7Fxz24RUn+1+pO4VjQ0vmDkhgM+O28gJdd1O+3loht9+h3Ie2+/EUXQudmqs7sPV 15 | 8DAuhWrnqrO6W4/nO/6MEgcXI5iJyi+uCNclMARDN1T3bh60UbcfAksCgYEAzQ6n 16 | xGBkkAm2gItkjdIlZFVKJikSpKhLnQV5D04y/S5nw1XBdk7iL8rWIqZVYlE+7sjX 17 | TB4gCXtFFZDTnM8fSzQU5I3ggo5NxmKq/Q4hl2aFSPEK3PMQ4Ik4jud85rluhTG8 18 | WRtIlvbqSKTSiuPbZXD/xmS3EL8Xf+V2wbK/zf0CgYEAsvCbZZIa1KXLIBH/Ytf1 19 | Qh8Dcg4TxSv1Xx5pqkvDhVSWTdzokUjKAEWILPvi64ybkl1M8r6rX8y/TTcjfGCk 20 | gKAQAup4TD0xAu4PzmXO/KxEwO/2Y6PRvIiPnUnWiszDBItMZQeNfWBWg1z8vdnk 21 | AHV9VXQyRv+pMDpW1wzV6PMCgYAnL6HH2VPeYrzJm9m/cGVM4y+kUz0I0lCA1Ubp 22 | Mdx0naWeooix/ykiUPTS8k5m13fbUe4y0Z71sOTm1iJaWQp16KIFe0doK6GZQ8nB 23 | Si4JLMJTyhx1VM3o2tBAHuSzgsQoF/USYjBhCRaEg1rox9ppbEq0sxJ41Mu82TD0 24 | myAkUQKBgFboHyz32Lx4/xB0fNTyw5c4tmnvQ8B1BFInXV3+yfL6vRIVDAfj5mMn 25 | WUNo1Hd77uHLuB3n4TzU8KwbF1vD2aACLk3p+OVRramMyv98nrl83oBMONxUh9Qb 26 | J1NBwEkdjaqk+s+r3SSl7avVJJOViEGwGnrm0a6kACd5zxdjx0vk 27 | -----END RSA PRIVATE KEY----- 28 | -------------------------------------------------------------------------------- /keys/gretel-key-rsa.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCqDwRVTRVk/wjPhoo66+Mztrc31KsxDZ+kAV0139PHQ+wsueNpba6jNn5o6mUTEOrxrz0LMsDJOBM7CmG0983kF4gRIihECpQ0rcjOP6BSfbVTE9mfIK5IsUiZGd8SoE9kSV2pJ2FvZeBQENoAxEFk0zZL9tchPS+OCUGbK4SDjzuNZl/30Mczs73N3MBzi6J1oPo7sFlqzB6ecBjK2Kpjus4Y1rYFphJnUxtKvB0s+hoaadrubiE57dK6BrH5iZwVLTQKux31uCJLPhiktI3iLbdlGZEctJkTasfVSsUizwVIyRjhVKmbdIRGwkU38D043AR1h0mUoGCPIKuqcFMf gretel 2 | -------------------------------------------------------------------------------- /keys/hansel-key-ecc-384.der: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gojimmypi/wolfssh/b7418a21a36ea3b7b67b5f01a86f5b2ea41aa151/keys/hansel-key-ecc-384.der -------------------------------------------------------------------------------- /keys/hansel-key-ecc-384.pem: -------------------------------------------------------------------------------- 1 | ASN1 OID: secp384r1 2 | NIST CURVE: P-384 3 | -----BEGIN EC PARAMETERS----- 4 | BgUrgQQAIg== 5 | -----END EC PARAMETERS----- 6 | -----BEGIN EC PRIVATE KEY----- 7 | MIGkAgEBBDBaxq6RECDqdn+EP6FkoasL0cnBs4c/e+nevuWzIelR6tAGDL1gUt9T 8 | YkK4nVa3wrWgBwYFK4EEACKhZANiAAQr2YmeotiM8dBVvP17oO88LGoaBHKjBI5S 9 | DxTcEaN/OR6UcNJsbW1dc2WJ4bROtxrwFhoK4Q+Vrk0RwwdcdI6SHHN122h4+KKR 10 | 4T3OG4pKcsy9dMNLQ6P0TMXm6kluUcI= 11 | -----END EC PRIVATE KEY----- 12 | -------------------------------------------------------------------------------- /keys/hansel-key-ecc-384.pub: -------------------------------------------------------------------------------- 1 | ecdsa-sha2-nistp384 AAAAE2VjZHNhLXNoYTItbmlzdHAzODQAAAAIbmlzdHAzODQAAABhBCvZiZ6i2Izx0FW8/Xug7zwsahoEcqMEjlIPFNwRo385HpRw0mxtbV1zZYnhtE63GvAWGgrhD5WuTRHDB1x0jpIcc3XbaHj4opHhPc4bikpyzL10w0tDo/RMxebqSW5Rwg== hansel 2 | -------------------------------------------------------------------------------- /keys/hansel-key-ecc-521.der: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gojimmypi/wolfssh/b7418a21a36ea3b7b67b5f01a86f5b2ea41aa151/keys/hansel-key-ecc-521.der -------------------------------------------------------------------------------- /keys/hansel-key-ecc-521.pem: -------------------------------------------------------------------------------- 1 | ASN1 OID: secp521r1 2 | NIST CURVE: P-521 3 | -----BEGIN EC PARAMETERS----- 4 | BgUrgQQAIw== 5 | -----END EC PARAMETERS----- 6 | -----BEGIN EC PRIVATE KEY----- 7 | MIHcAgEBBEIBeUC4M+VTW5797b58aOS2w1AADTlkBfZaXUGrs9mnyxx9NEZcLVYm 8 | oGrHPU94WBRmbPyGPItbVCmJk0jZVIu+nZGgBwYFK4EEACOhgYkDgYYABAET/BOz 9 | Bb9Jx9b52VIHFP4g/uk5KceDpz2M+/Ln9WiDjsMfb4NgNCAB+EMNJUX/TNBLFFmq 10 | r7c6+zUH+QAo2qstvQDsReyFkETRB2vZD//nCZfcAe0RMtKZmgtQLKXzSlimUjXB 11 | M4/zE5lwE05aXADp88h8nuaT/X4bll9cWJlH0fUykA== 12 | -----END EC PRIVATE KEY----- 13 | -------------------------------------------------------------------------------- /keys/hansel-key-ecc-521.pub: -------------------------------------------------------------------------------- 1 | ecdsa-sha2-nistp521 AAAAE2VjZHNhLXNoYTItbmlzdHA1MjEAAAAIbmlzdHA1MjEAAACFBAET/BOzBb9Jx9b52VIHFP4g/uk5KceDpz2M+/Ln9WiDjsMfb4NgNCAB+EMNJUX/TNBLFFmqr7c6+zUH+QAo2qstvQDsReyFkETRB2vZD//nCZfcAe0RMtKZmgtQLKXzSlimUjXBM4/zE5lwE05aXADp88h8nuaT/X4bll9cWJlH0fUykA== hansel 2 | -------------------------------------------------------------------------------- /keys/hansel-key-ecc.der: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gojimmypi/wolfssh/b7418a21a36ea3b7b67b5f01a86f5b2ea41aa151/keys/hansel-key-ecc.der -------------------------------------------------------------------------------- /keys/hansel-key-ecc.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN EC PRIVATE KEY----- 2 | MHcCAQEEIANuF9O5uKvI+R/xLURMOxKxpHfY7Q5qvmDC9ovn04eDoAoGCCqGSM49 3 | AwEHoUQDQgAE2QjklM/oPSUXja1vFfX1wTzuHO1RLoVIOga89+JTQKB41Jsj5oV0 4 | ojNM/kJAQlK+bbmpTOAO0fujJpBE5Sc2+Q== 5 | -----END EC PRIVATE KEY----- 6 | -------------------------------------------------------------------------------- /keys/hansel-key-ecc.pub: -------------------------------------------------------------------------------- 1 | ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBNkI5JTP6D0lF42tbxX19cE87hztUS6FSDoGvPfiU0CgeNSbI+aFdKIzTP5CQEJSvm25qUzgDtH7oyaQROUnNvk= hansel 2 | -------------------------------------------------------------------------------- /keys/hansel-key-rsa.der: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gojimmypi/wolfssh/b7418a21a36ea3b7b67b5f01a86f5b2ea41aa151/keys/hansel-key-rsa.der -------------------------------------------------------------------------------- /keys/hansel-key-rsa.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIIEowIBAAKCAQEAvT92RaMDrDjVxw+TMFognIl8rQUWRoaDDYorFkoFLOR3R3AA 3 | rh2D4tlumdTwRZgVk/aHTqxkY6GVyXww6D4vo/EknwxrHP4bApnNxqdshIVGVBJA 4 | 4bTl8qo57NYnJAvRoeLvNGklbcB0ZyWYfcT4UqubSzoSHeHj+tbPmuacI045xIQW 5 | iD1CTtgvzNKRZ522cSoCZV+7dQ6Mu4eXl8b4spjiL2gmSlPseTqKX8zP8BZHstBD 6 | 1jZsyOcv/qc1OWn7HXhFnYkAyEHPNB+j8/H7KBT72EhvrOP8M9Hbru8nnldWKaIa 7 | OuWa/qRJyH+3TtAfBG5YFrfrnfiSPMKwIXxOMQIDAQABAoIBAQCNpGEGL8NA9Gz0 8 | hzC4AMzlvHWHHgaVFHoj+STUkuQavIiV/DtWFhsu/2QrWNfYjsKfsuWEubyNYVQ1 9 | sHD+cgTAJG0vaWEGGx3mLW15YLf027dOlzbed8GfhU7Dd2lmLj5hdvNn+8aaxW+Z 10 | /+aJQ5JEddJOVJFYskgq5voNSsrUFJ72J2e3JXpDuytn0f7RaCMGMHy/YEnezH4m 11 | Wjv+pqbnqN2sua+CmjpBfmEhN6MI5MS8EfU7jk1R873aurLF7vvP34OhggHhUZ0H 12 | Wl3Yx1s/lxNqTR6NOaxAlYJsoqHMipshMjpYzOctGnmkMVCxS3YjG7NAPT1ycjLs 13 | Xzi1jbKNAoGBAO1afo6hYn0mXHjEh3HJQVd3lJOTJnjIoxW9WcsbtLJrD+eA8vr8 14 | jjKpGx5/4SbvACXY3ckaIwAmO0YjwFDnzmKyNrKYCRY0GJ5GvK8sKJQv4F3Jssj7 15 | XRPVNqoVD4mlFlldInSkR136+wxegL8PwpyVD+eqfxYb1Ns4fVguV3gvAoGBAMwd 16 | f3Q2bbSSJWLFULBcodrzsv0emA2LBWlgjl7SiZBKDUZ+4lRprhbmy9W9ezAre1zu 17 | kxLPY4mcPcgt5HphCV6A+zwDs3PWmNCEDFmfToDzRu0DndXci+ex6KpX3NFBVQfH 18 | 32c8cniwYI+FoZCZDKVnq/C2dJADVXtezMW/3qefAoGAQIFuka7UiHSrfvrSYJ80 19 | jePm0jCUrRDCGb9rLuLpue+U0/Lclk+bCbOhtilE9ILRxHdq1yOuTXUWeNpwgsxs 20 | 76/FY8Yj+g/QfPt2fhj/Mj7MuFB/sVV3F1PD1neA0IS4TTMdkRuwdZ8nKVZpoQNU 21 | fZ+ZQfm5LjYEJEv27MczaGsCgYBgNcs80Ob3BSggHVeCObeFB/enPcN4Jr4/RGb3 22 | JQ/4dh85ylcOaN3JJ7KOpgip1OUKEd47MIv/cijg8VjPomuTIwLI8AmnIVDYgFV9 23 | 7QxI1eLplxnPk2xSotZDbLTF4aCd0UVpWOGwJ5rsK5XTHYELeglepfHda+TgCPhG 24 | gcEGiwKBgAD28uslungErQ4NLqdp1lfmNjJQ0vLrrTFGZcAHl4NsZic+lCwFAV9c 25 | 4DEw7GHSdDW3nzjnjmexUAhozs/Y7oj9XcTN4oY9Sg4Ef+6K6JsWofwJguJiAzzo 26 | JX88mqqD+NiT0VT5zrT6NTbMGFSq8pC3fJcLJy+u/MOTrxp17Bjb 27 | -----END RSA PRIVATE KEY----- 28 | -------------------------------------------------------------------------------- /keys/hansel-key-rsa.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC9P3ZFowOsONXHD5MwWiCciXytBRZGhoMNiisWSgUs5HdHcACuHYPi2W6Z1PBFmBWT9odOrGRjoZXJfDDoPi+j8SSfDGsc/hsCmc3Gp2yEhUZUEkDhtOXyqjns1ickC9Gh4u80aSVtwHRnJZh9xPhSq5tLOhId4eP61s+a5pwjTjnEhBaIPUJO2C/M0pFnnbZxKgJlX7t1Doy7h5eXxviymOIvaCZKU+x5OopfzM/wFkey0EPWNmzI5y/+pzU5afsdeEWdiQDIQc80H6Pz8fsoFPvYSG+s4/wz0duu7yeeV1Ypoho65Zr+pEnIf7dO0B8EblgWt+ud+JI8wrAhfE4x hansel 2 | -------------------------------------------------------------------------------- /keys/id_barney: -------------------------------------------------------------------------------- 1 | -----BEGIN OPENSSH PRIVATE KEY----- 2 | b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW 3 | QyNTUxOQAAACBs8gsipHiL/VP0nvJOeDeR0EYF9AXtXnjGlGmqHru5NQAAAJghFgrDIRYK 4 | wwAAAAtzc2gtZWQyNTUxOQAAACBs8gsipHiL/VP0nvJOeDeR0EYF9AXtXnjGlGmqHru5NQ 5 | AAAEDuTSTiIfkHZlxI+gjjETACk3F3PPU7jgOHG6NH/THSXWzyCyKkeIv9U/Se8k54N5HQ 6 | RgX0Be1eeMaUaaoeu7k1AAAAEGJhcm5leUBsb2NhbGhvc3QBAgMEBQ== 7 | -----END OPENSSH PRIVATE KEY----- 8 | -------------------------------------------------------------------------------- /keys/id_barney.pub: -------------------------------------------------------------------------------- 1 | ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGzyCyKkeIv9U/Se8k54N5HQRgX0Be1eeMaUaaoeu7k1 barney@localhost 2 | -------------------------------------------------------------------------------- /keys/id_ecdsa: -------------------------------------------------------------------------------- 1 | -----BEGIN OPENSSH PRIVATE KEY----- 2 | b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAaAAAABNlY2RzYS 3 | 1zaGEyLW5pc3RwMjU2AAAACG5pc3RwMjU2AAAAQQTAqdBgCp8bYSq2kQQ48/Ud8Iy6Mjnb 4 | /fpB3LfSE/1kx9VaaE4FL3i9Gg2vDV0eLGM3PWksFNPhULxtcYJyjaBjAAAAqJAeleSQHp 5 | XkAAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBMCp0GAKnxthKraR 6 | BDjz9R3wjLoyOdv9+kHct9IT/WTH1VpoTgUveL0aDa8NXR4sYzc9aSwU0+FQvG1xgnKNoG 7 | MAAAAgPrOgktioNqad/wHNC/rt/zVrpNqDnOwg9tNDFMOTwo8AAAANYm9iQGxvY2FsaG9z 8 | dAECAw== 9 | -----END OPENSSH PRIVATE KEY----- 10 | -------------------------------------------------------------------------------- /keys/id_ecdsa.pub: -------------------------------------------------------------------------------- 1 | ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBMCp0GAKnxthKraRBDjz9R3wjLoyOdv9+kHct9IT/WTH1VpoTgUveL0aDa8NXR4sYzc9aSwU0+FQvG1xgnKNoGM= bob@localhost 2 | -------------------------------------------------------------------------------- /keys/id_rsa: -------------------------------------------------------------------------------- 1 | -----BEGIN OPENSSH PRIVATE KEY----- 2 | b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAABFwAAAAdzc2gtcn 3 | NhAAAAAwEAAQAAAQEAy2cigZDlpBT+X2MJHAoHnfeFf6+LHm6BDkAT8V9ejHA4dY0Aepb6 4 | NbV6u/oYZlueKPeAZ3GNztR9szoL6FSlMvkd9oqvfoxjTGu71T0981ybJelqqGATGtevHU 5 | 6Jko/I0+lgSQFKWQJ7D3Dj2zlZpIXB2Q7xl/i9kFZgaIqFhUHdWO9JMOwCFwoDrhd8v5xk 6 | y1v3OIIZDxiYxVIKbf2J07WbwiSFAxXfiX8TjUBDLFmtqt1AF6LjAyGyaRICXkaGJQ/QJ9 7 | sX85h9bkiPlGNAtQGQtNUg3tC9GqOkZ9tCKY1Efh/r0zosOA7ufxg6ymLpq1C4LU/4ENGH 8 | kuRPAKvu8wAAA8gztJfmM7SX5gAAAAdzc2gtcnNhAAABAQDLZyKBkOWkFP5fYwkcCged94 9 | V/r4seboEOQBPxX16McDh1jQB6lvo1tXq7+hhmW54o94BncY3O1H2zOgvoVKUy+R32iq9+ 10 | jGNMa7vVPT3zXJsl6WqoYBMa168dTomSj8jT6WBJAUpZAnsPcOPbOVmkhcHZDvGX+L2QVm 11 | BoioWFQd1Y70kw7AIXCgOuF3y/nGTLW/c4ghkPGJjFUgpt/YnTtZvCJIUDFd+JfxONQEMs 12 | Wa2q3UAXouMDIbJpEgJeRoYlD9An2xfzmH1uSI+UY0C1AZC01SDe0L0ao6Rn20IpjUR+H+ 13 | vTOiw4Du5/GDrKYumrULgtT/gQ0YeS5E8Aq+7zAAAAAwEAAQAAAQEAvbdBiQXkGyn1pHST 14 | /5IfTqia3OCX6td5ChicQUsJvgXBs2rDopQFZmkRxBjd/0K+/0jyfAl/EgZCBBRFHPsuZp 15 | /S4ayzSV6aE6J8vMT1bnLWxwKyl7+csjGwRK6HRKtVzsnjI9TPSrw0mc9ax5PzV6/mgZUd 16 | o/i+nszh+UASj5mYrBGqMiINspzX6YC+qoUHor3rEJOd9p1aO+N5+1fDKiDnlkM5IO0Qsz 17 | GktuwL0fzv9zBnGfnWVJz3CorfP1OW5KCtrDn7BnkQf1eBeVLzq/uoglUjS4DNnVfLA67D 18 | O4ZfwtnoW8Gr2R+KdvnypvHnDeY5X51r5PDgL4+7z47pWQAAAIBNFcAzHHE19ISGN8YRHk 19 | 23/r/3zfvzHU68GSKR1Xj/Y4LSdRTpSm3wBrdQ17f5B4V7RVl2CJvoPekTggnBDQlLJ7fU 20 | NU93/nZrY9teYdrNh03buL54VVb5tUM+KN+27zERlTj0/LmYJupN97sZXmlgKsvLbcsnM2 21 | i7HuQQaFnsIQAAAIEA5wqFVatT9yovt8pS7rAyYUL/cqc50TZ/5Nwfy5uasRyf1BphHwEW 22 | LEimBemVc+VrNwAkt6MFWuloK5ssqb1ubvtRI8Mntd15rRfZtq/foS3J8FJxueXLDWlECy 23 | PmVyfVN1Vv4ZeirBy9BTYLiSuxMes+HYks3HucQhxIN1j8SA0AAACBAOFgRjfWXv1/93Jp 24 | 6CCJ5c98MWP+zu1FbLIlklxPb85osZqlazXHNPPEtblC4z+OqRGMCsv2683anU4ZzcTFIk 25 | JS3lzeJ3tdAH4osQ5etKkV4mcdCmeRpjudB9VbaziVhPX02qkPWpM0ckPrgB3hVNUDPz89 26 | GtJd3mlhyY5IfFL/AAAADWJvYkBsb2NhbGhvc3QBAgMEBQ== 27 | -----END OPENSSH PRIVATE KEY----- 28 | -------------------------------------------------------------------------------- /keys/id_rsa.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDLZyKBkOWkFP5fYwkcCged94V/r4seboEOQBPxX16McDh1jQB6lvo1tXq7+hhmW54o94BncY3O1H2zOgvoVKUy+R32iq9+jGNMa7vVPT3zXJsl6WqoYBMa168dTomSj8jT6WBJAUpZAnsPcOPbOVmkhcHZDvGX+L2QVmBoioWFQd1Y70kw7AIXCgOuF3y/nGTLW/c4ghkPGJjFUgpt/YnTtZvCJIUDFd+JfxONQEMsWa2q3UAXouMDIbJpEgJeRoYlD9An2xfzmH1uSI+UY0C1AZC01SDe0L0ao6Rn20IpjUR+H+vTOiw4Du5/GDrKYumrULgtT/gQ0YeS5E8Aq+7z bob@localhost 2 | -------------------------------------------------------------------------------- /keys/include.am: -------------------------------------------------------------------------------- 1 | # vim:ft=automake 2 | # included from Top Level Makefile.am 3 | # All paths should be given relative to the root 4 | 5 | 6 | EXTRA_DIST+= \ 7 | keys/server-key-ecc.der keys/server-key-ecc.pem \ 8 | keys/server-key-ecc-384.der keys/server-key-ecc-384.pem \ 9 | keys/server-key-ecc-521.der keys/server-key-ecc-521.pem \ 10 | keys/server-key-rsa.der keys/server-key-rsa.pem \ 11 | keys/hansel-key-ecc.der keys/hansel-key-ecc.pem keys/hansel-key-ecc.pub \ 12 | keys/hansel-key-ecc-384.der keys/hansel-key-ecc-384.pem keys/hansel-key-ecc-384.pub \ 13 | keys/hansel-key-ecc-521.der keys/hansel-key-ecc-521.pem keys/hansel-key-ecc-521.pub \ 14 | keys/hansel-key-rsa.der keys/hansel-key-rsa.pem keys/hansel-key-rsa.pub \ 15 | keys/gretel-key-ecc.der keys/gretel-key-ecc.pem keys/gretel-key-ecc.pub \ 16 | keys/gretel-key-ecc-384.der keys/gretel-key-ecc-384.pem keys/gretel-key-ecc-384.pub \ 17 | keys/gretel-key-ecc-521.der keys/gretel-key-ecc-521.pem keys/gretel-key-ecc-521.pub \ 18 | keys/gretel-key-rsa.der keys/gretel-key-rsa.pem keys/gretel-key-rsa.pub \ 19 | keys/pubkeys-ecc.txt keys/pubkeys-ecc-384.txt keys/pubkeys-ecc-521.txt \ 20 | keys/pubkeys-rsa.txt keys/passwd.txt keys/ca-cert-ecc.der \ 21 | keys/ca-cert-ecc.pem keys/ca-key-ecc.der keys/ca-key-ecc.pem \ 22 | keys/server-cert.der keys/server-cert.pem \ 23 | keys/fred-cert.der keys/fred-cert.pem \ 24 | keys/server-key.pem keys/fred-key.der keys/fred-key.pem \ 25 | keys/id_ecdsa keys/id_ecdsa.pub keys/id_rsa keys/id_rsa.pub \ 26 | keys/renewcerts.sh keys/renewcerts.cnf 27 | 28 | -------------------------------------------------------------------------------- /keys/john-key.pub: -------------------------------------------------------------------------------- 1 | ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBBLcFtEXgaYC8A8RkLsyhWYOdgBirKrjuSYcKuIo+N3YeT/AAl7R0cX+PGP1H64TS2nK6O30Nrpi4KHIGBBLVeE= 2 | -------------------------------------------------------------------------------- /keys/passwd.txt: -------------------------------------------------------------------------------- 1 | jill:upthehill 2 | jack:fetchapail 3 | -------------------------------------------------------------------------------- /keys/pubkeys-ecc-384.txt: -------------------------------------------------------------------------------- 1 | ecdsa-sha2-nistp384 AAAAE2VjZHNhLXNoYTItbmlzdHAzODQAAAAIbmlzdHAzODQAAABhBCvZiZ6i2Izx0FW8/Xug7zwsahoEcqMEjlIPFNwRo385HpRw0mxtbV1zZYnhtE63GvAWGgrhD5WuTRHDB1x0jpIcc3XbaHj4opHhPc4bikpyzL10w0tDo/RMxebqSW5Rwg== hansel 2 | ecdsa-sha2-nistp384 AAAAE2VjZHNhLXNoYTItbmlzdHAzODQAAAAIbmlzdHAzODQAAABhBAzHaVqw2wFOBFHKckM2lhEiJP2j3Dw//O9fId6GEgm02nnRHixKok5ZwsfGo2iotfMvPYdItDSuGL5tLxqdgOc6Fo/0UjgoO5TSBGUi6REEreltFY/F/63pgs4f0/TE+g== gretel 3 | -------------------------------------------------------------------------------- /keys/pubkeys-ecc-521.txt: -------------------------------------------------------------------------------- 1 | ecdsa-sha2-nistp521 AAAAE2VjZHNhLXNoYTItbmlzdHA1MjEAAAAIbmlzdHA1MjEAAACFBAET/BOzBb9Jx9b52VIHFP4g/uk5KceDpz2M+/Ln9WiDjsMfb4NgNCAB+EMNJUX/TNBLFFmqr7c6+zUH+QAo2qstvQDsReyFkETRB2vZD//nCZfcAe0RMtKZmgtQLKXzSlimUjXBM4/zE5lwE05aXADp88h8nuaT/X4bll9cWJlH0fUykA== hansel 2 | ecdsa-sha2-nistp521 AAAAE2VjZHNhLXNoYTItbmlzdHA1MjEAAAAIbmlzdHA1MjEAAACFBAD3gANmzvkxOBN8MYwRBYO6B//7TTCtA2vwG/W5bqiVVxznXWj0xiFrgayApvH7FDpLHiJ8+c1vUsRVEa8PY5QPsgFow+xv0P2WSrRkn4/UUquftPs1ZHPhdr06LjS19ObvWM8xFZYU6n0i28UWCUR5qE+BCTzZDWYT8V24YD8UhpaYIw== gretel 3 | -------------------------------------------------------------------------------- /keys/pubkeys-ecc.txt: -------------------------------------------------------------------------------- 1 | ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBNkI5JTP6D0lF42tbxX19cE87hztUS6FSDoGvPfiU0CgeNSbI+aFdKIzTP5CQEJSvm25qUzgDtH7oyaQROUnNvk= hansel 2 | ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBKAtH8cqaDbtJFjtviLobHBmjCtG56DMkP6A4M2H9zX2/YCg1h9bYS7WHd9UQDwXO1HhIZzRYecXh7SG9P4GhRY= gretel 3 | -------------------------------------------------------------------------------- /keys/pubkeys-rsa.txt: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC9P3ZFowOsONXHD5MwWiCciXytBRZGhoMNiisWSgUs5HdHcACuHYPi2W6Z1PBFmBWT9odOrGRjoZXJfDDoPi+j8SSfDGsc/hsCmc3Gp2yEhUZUEkDhtOXyqjns1ickC9Gh4u80aSVtwHRnJZh9xPhSq5tLOhId4eP61s+a5pwjTjnEhBaIPUJO2C/M0pFnnbZxKgJlX7t1Doy7h5eXxviymOIvaCZKU+x5OopfzM/wFkey0EPWNmzI5y/+pzU5afsdeEWdiQDIQc80H6Pz8fsoFPvYSG+s4/wz0duu7yeeV1Ypoho65Zr+pEnIf7dO0B8EblgWt+ud+JI8wrAhfE4x hansel 2 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCqDwRVTRVk/wjPhoo66+Mztrc31KsxDZ+kAV0139PHQ+wsueNpba6jNn5o6mUTEOrxrz0LMsDJOBM7CmG0983kF4gRIihECpQ0rcjOP6BSfbVTE9mfIK5IsUiZGd8SoE9kSV2pJ2FvZeBQENoAxEFk0zZL9tchPS+OCUGbK4SDjzuNZl/30Mczs73N3MBzi6J1oPo7sFlqzB6ecBjK2Kpjus4Y1rYFphJnUxtKvB0s+hoaadrubiE57dK6BrH5iZwVLTQKux31uCJLPhiktI3iLbdlGZEctJkTasfVSsUizwVIyRjhVKmbdIRGwkU38D043AR1h0mUoGCPIKuqcFMf gretel 3 | -------------------------------------------------------------------------------- /keys/putty_rsa.ppk: -------------------------------------------------------------------------------- 1 | PuTTY-User-Key-File-3: ssh-rsa 2 | Encryption: none 3 | Comment: rsa-key-20240604 4 | Public-Lines: 6 5 | AAAAB3NzaC1yc2EAAAADAQABAAABAQDEbENolVsJ9W/mfKF1G+j/xKiL0g+BhVLH 6 | JP3fOYpXRur5x5kdselmlnklpnzqxQcp+5uv89XfqhILDMNJRhffIKvOYa2AHdEg 7 | ML/FjtLwgiruM6sCA+NZ1MbBHRUqzsPdMlEqZp0kMBpldtUgcwNoyT3TD0zxPNk7 8 | ZaVl5KTZi3c5KBr11SpT5HsxPLRGN0XwjEZpxu6nfPAdg4R1/rW1vJDHJfU/ZvJb 9 | GcJvDls5OWvFMbaGzhq/JgWmrSRYjYlKpNBnGpvCm61ZbABBoUVyWUGbNgWjeVjw 10 | apW/Ycw9Mb9+u3jVtFPquU3loMXDyXGslclhwH/k8pJjt+g7jAN1 11 | Private-Lines: 14 12 | AAABAGyMC8Bq8VGSkhFEhJFMKDnX+vCx2CHShMlKtwU6LipHJal9VS9k1z/7Hd3h 13 | oJy431mjEwlsbZ/Zw3jZx73hf2WuD2PQ9OmdEKmCZygM4qNIu+LBKNrHPUeyX1fu 14 | 83ihpPnDSblt1Z9e+edigSsahCLPO1w8019pKf86D+o8LaGOCgWrgAhxzlESQSHj 15 | d5c7C08qOTjOTfSCrUGX6X8vbuVN62sejd7stw/hznNSfKXxGNS36U4PAFA3ISkD 16 | TD3ZYKNDHogfxWbnQdQBykw90OQCn/k05U1ibih4dE7o2C+1Nd+gJBfoUFoz0DcT 17 | LILn9MC7TazgFvfsZ/8eV9hPZm0AAACBAOiNzN6TJvvE2rE0/NFTjXw6Rr0DpCDE 18 | px3IOHaX6sDR+w8h7/Hu1VdnAhNPZndslzW8B0x+yfIE3jxUds3rl5sF4Q54/POj 19 | PnPSNrdP6xFFznxen6TyLxg4DNnlirBBQRPFg6dqtv3SKenVyGLWuzOgCV+oajBh 20 | vnXHJIIMSFRHAAAAgQDYOeymt6Ubi5shUNHpTfvbRMh08Uhlb6R2wkDDBLcDJEHd 21 | h0+4nlNC3I/5OMyGrtPa0zwdEdUNTOKXT3sHC5g/mCOvh3Nk2pcMBr2kK4nR2jKK 22 | oDY6czAlHk3Egd1WAz00Vm+DRKlKOzkPbnYk66cbtmIOPfyBoMv3Ce/wtWM0YwAA 23 | AIEA2hkI2Px9OgtDRjl9Q/ACzTrEytucBtr8sbfDEB9xJo6KfQSvSM+JTs6ZwyDq 24 | xGYnAgfExL6jAziHuDoPOY2ypk9narnVvbT7YnR/unI7w2hKOA4wzwDg2ttjTd2H 25 | p/TeCUiHrrVPe6Q9KkfXMFngbYnt11nN5p6JFKOuzMLg224= 26 | Private-MAC: 8eead3c876b6feb64a80d9d7573ffc1ab89bb272091a38fe85c962d47400c7cb 27 | -------------------------------------------------------------------------------- /keys/putty_rsa.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDEbENolVsJ9W/mfKF1G+j/xKiL0g+BhVLHJP3fOYpXRur5x5kdselmlnklpnzqxQcp+5uv89XfqhILDMNJRhffIKvOYa2AHdEgML/FjtLwgiruM6sCA+NZ1MbBHRUqzsPdMlEqZp0kMBpldtUgcwNoyT3TD0zxPNk7ZaVl5KTZi3c5KBr11SpT5HsxPLRGN0XwjEZpxu6nfPAdg4R1/rW1vJDHJfU/ZvJbGcJvDls5OWvFMbaGzhq/JgWmrSRYjYlKpNBnGpvCm61ZbABBoUVyWUGbNgWjeVjwapW/Ycw9Mb9+u3jVtFPquU3loMXDyXGslclhwH/k8pJjt+g7jAN1 rsa-key-20240604 2 | -------------------------------------------------------------------------------- /keys/renewcerts.cnf: -------------------------------------------------------------------------------- 1 | HOME = . 2 | RANDFILE = $ENV::HOME/.rnd 3 | 4 | [ ca ] 5 | default_ca = CA_default # The default ca section 6 | 7 | [ CA_default ] 8 | dir = $HOME 9 | database = $dir/index.txt # database index file. 10 | certs = $dir/ 11 | new_certs_dir = $dir/ 12 | certificate = $dir/ca-cert-ecc.pem 13 | serial = $dir/serial 14 | default_md = default 15 | policy = policy_match 16 | email_in_dn = no 17 | RANDFILE = $dir/.rand 18 | 19 | # For the CA policy 20 | [ policy_match ] 21 | countryName = match 22 | stateOrProvinceName = supplied 23 | organizationName = supplied 24 | organizationalUnitName = optional 25 | commonName = supplied 26 | emailAddress = optional 27 | 28 | [ req ] 29 | x509_extensions = v3_ca # The extensions to add to the self signed cert 30 | distinguished_name = req_distinguished_name 31 | prompt = no 32 | 33 | # Extensions for a typical CA 34 | [ v3_ca ] 35 | subjectKeyIdentifier=hash 36 | authorityKeyIdentifier=keyid:always,issuer:always 37 | basicConstraints = critical,CA:true 38 | keyUsage = critical, digitalSignature, keyCertSign, cRLSign 39 | 40 | # Extensions for fred cert 41 | [ v3_fred ] 42 | subjectKeyIdentifier=hash 43 | authorityKeyIdentifier=keyid:always,issuer:always 44 | subjectAltName = @fred_altnames 45 | 46 | [ fred_altnames ] 47 | otherName = msUPN;UTF8:fred@example 48 | 49 | # Extensions for server cert 50 | [ v3_server ] 51 | subjectKeyIdentifier=hash 52 | authorityKeyIdentifier=keyid:always,issuer:always 53 | subjectAltName = DNS:example, IP:127.0.0.1 54 | 55 | 56 | [ req_distinguished_name ] 57 | 58 | -------------------------------------------------------------------------------- /keys/renewcerts.sh: -------------------------------------------------------------------------------- 1 | touch index.txt 2 | 3 | if [ -z "$1" ]; then 4 | USER_NAME="fred" 5 | else 6 | USER_NAME=$1 7 | cp fred-key.der $USER_NAME-key.der 8 | cp fred-key.pem $USER_NAME-key.pem 9 | sed -i.bak "s/fred/$USER_NAME/g" renewcerts.cnf 10 | fi 11 | 12 | # renew CA 13 | openssl req -subj '/C=US/ST=Washington/L=Seattle/O=wolfSSL/OU=Development/CN=www.wolfssl.com/emailAddress=ca@example.com' -key ca-key-ecc.pem -text -out ca-cert-ecc.pem -config renewcerts.cnf -new -nodes -x509 -extensions v3_ca -days 3650 -set_serial 6 14 | openssl x509 -in ca-cert-ecc.pem -outform DER -out ca-cert-ecc.der 15 | 16 | # renew user cert 17 | openssl req -subj "/C=US/ST=WA/L=Seattle/O=wolfSSL Inc/OU=Development/CN=$USER_NAME/emailAddress=fred@example.com" -key $USER_NAME-key.pem -out $USER_NAME-cert.csr -config renewcerts.cnf -new -nodes 18 | 19 | openssl x509 -req -in $USER_NAME-cert.csr -days 3650 -extfile renewcerts.cnf -extensions v3_$USER_NAME -CA ca-cert-ecc.pem -CAkey ca-key-ecc.pem -text -out $USER_NAME-cert.pem -set_serial 7 20 | openssl x509 -in $USER_NAME-cert.pem -outform DER -out $USER_NAME-cert.der 21 | 22 | # renew server-cert 23 | openssl req -subj '/C=US/ST=Washington/L=Seattle/O=Eliptic/OU=ECC/CN=www.wolfssl.com/emailAddress=server@example.com' -key server-key.pem -out server-cert.csr -config renewcerts.cnf -new -nodes 24 | 25 | openssl x509 -req -in server-cert.csr -days 3650 -extfile renewcerts.cnf -extensions v3_server -CA ca-cert-ecc.pem -CAkey ca-key-ecc.pem -text -out server-cert.pem -set_serial 8 26 | openssl x509 -in server-cert.pem -outform DER -out server-cert.der 27 | 28 | rm index.* 29 | -------------------------------------------------------------------------------- /keys/server-cert.der: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gojimmypi/wolfssh/b7418a21a36ea3b7b67b5f01a86f5b2ea41aa151/keys/server-cert.der -------------------------------------------------------------------------------- /keys/server-cert.pem: -------------------------------------------------------------------------------- 1 | Certificate: 2 | Data: 3 | Version: 3 (0x2) 4 | Serial Number: 8 (0x8) 5 | Signature Algorithm: ecdsa-with-SHA256 6 | Issuer: C = US, ST = Washington, L = Seattle, O = wolfSSL, OU = Development, CN = www.wolfssl.com, emailAddress = ca@example.com 7 | Validity 8 | Not Before: Oct 1 05:54:44 2022 GMT 9 | Not After : Sep 28 05:54:44 2032 GMT 10 | Subject: C = US, ST = Washington, L = Seattle, O = Eliptic, OU = ECC, CN = www.wolfssl.com, emailAddress = server@example.com 11 | Subject Public Key Info: 12 | Public Key Algorithm: id-ecPublicKey 13 | Public-Key: (256 bit) 14 | pub: 15 | 04:bb:33:ac:4c:27:50:4a:c6:4a:a5:04:c3:3c:de: 16 | 9f:36:db:72:2d:ce:94:ea:2b:fa:cb:20:09:39:2c: 17 | 16:e8:61:02:e9:af:4d:d3:02:93:9a:31:5b:97:92: 18 | 21:7f:f0:cf:18:da:91:11:02:34:86:e8:20:58:33: 19 | 0b:80:34:89:d8 20 | ASN1 OID: prime256v1 21 | NIST CURVE: P-256 22 | X509v3 extensions: 23 | X509v3 Subject Key Identifier: 24 | 5D:5D:26:EF:AC:7E:36:F9:9B:76:15:2B:4A:25:02:23:EF:B2:89:30 25 | X509v3 Authority Key Identifier: 26 | keyid:56:8E:9A:C3:F0:42:DE:18:B9:45:55:6E:F9:93:CF:EA:C3:F3:A5:21 27 | DirName:/C=US/ST=Washington/L=Seattle/O=wolfSSL/OU=Development/CN=www.wolfssl.com/emailAddress=ca@example.com 28 | serial:06 29 | 30 | X509v3 Subject Alternative Name: 31 | DNS:example, IP Address:127.0.0.1 32 | Signature Algorithm: ecdsa-with-SHA256 33 | 30:45:02:20:42:d8:a0:95:e7:aa:4e:63:fd:50:6e:6b:f9:98: 34 | 90:be:3d:44:53:68:1b:66:dd:22:a3:12:77:70:94:56:db:82: 35 | 02:21:00:ce:18:b2:10:b2:2d:2a:b9:79:d4:76:64:df:28:91: 36 | 23:8d:93:22:e9:4b:ea:7f:49:4e:eb:65:ce:c8:86:ba:fb 37 | -----BEGIN CERTIFICATE----- 38 | MIIDGjCCAsCgAwIBAgIBCDAKBggqhkjOPQQDAjCBlTELMAkGA1UEBhMCVVMxEzAR 39 | BgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxEDAOBgNVBAoMB3dv 40 | bGZTU0wxFDASBgNVBAsMC0RldmVsb3BtZW50MRgwFgYDVQQDDA93d3cud29sZnNz 41 | bC5jb20xHTAbBgkqhkiG9w0BCQEWDmNhQGV4YW1wbGUuY29tMB4XDTIyMTAwMTA1 42 | NTQ0NFoXDTMyMDkyODA1NTQ0NFowgZExCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApX 43 | YXNoaW5ndG9uMRAwDgYDVQQHDAdTZWF0dGxlMRAwDgYDVQQKDAdFbGlwdGljMQww 44 | CgYDVQQLDANFQ0MxGDAWBgNVBAMMD3d3dy53b2xmc3NsLmNvbTEhMB8GCSqGSIb3 45 | DQEJARYSc2VydmVyQGV4YW1wbGUuY29tMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcD 46 | QgAEuzOsTCdQSsZKpQTDPN6fNttyLc6U6iv6yyAJOSwW6GEC6a9N0wKTmjFbl5Ih 47 | f/DPGNqREQI0huggWDMLgDSJ2KOCAQEwgf4wHQYDVR0OBBYEFF1dJu+sfjb5m3YV 48 | K0olAiPvsokwMIHCBgNVHSMEgbowgbeAFFaOmsPwQt4YuUVVbvmTz+rD86UhoYGb 49 | pIGYMIGVMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3RvbjEQMA4GA1UE 50 | BwwHU2VhdHRsZTEQMA4GA1UECgwHd29sZlNTTDEUMBIGA1UECwwLRGV2ZWxvcG1l 51 | bnQxGDAWBgNVBAMMD3d3dy53b2xmc3NsLmNvbTEdMBsGCSqGSIb3DQEJARYOY2FA 52 | ZXhhbXBsZS5jb22CAQYwGAYDVR0RBBEwD4IHZXhhbXBsZYcEfwAAATAKBggqhkjO 53 | PQQDAgNIADBFAiBC2KCV56pOY/1Qbmv5mJC+PURTaBtm3SKjEndwlFbbggIhAM4Y 54 | shCyLSq5edR2ZN8okSONkyLpS+p/SU7rZc7Ihrr7 55 | -----END CERTIFICATE----- 56 | -------------------------------------------------------------------------------- /keys/server-key-ecc-384.der: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gojimmypi/wolfssh/b7418a21a36ea3b7b67b5f01a86f5b2ea41aa151/keys/server-key-ecc-384.der -------------------------------------------------------------------------------- /keys/server-key-ecc-384.pem: -------------------------------------------------------------------------------- 1 | ASN1 OID: secp384r1 2 | NIST CURVE: P-384 3 | -----BEGIN EC PARAMETERS----- 4 | BgUrgQQAIg== 5 | -----END EC PARAMETERS----- 6 | -----BEGIN EC PRIVATE KEY----- 7 | MIGkAgEBBDA+rdK7vwWnvjo/fCgVEoneW7NkTXARdh21byoDYvumT5jmT/mG3E+4 8 | 79sta42lcUKgBwYFK4EEACKhZANiAAQ41ivkGP9XP9DgINSIdsThEh37LW6+5Ild 9 | dyQxbUaiMQWHPymG1ccSgDpvRxq4aFDrBj4QiWE0nPi0xqTPXpe9flHpdePpIXJh 10 | UG65zzxJPT64jUZ7XyfrqyFhwABm/r0= 11 | -----END EC PRIVATE KEY----- 12 | -------------------------------------------------------------------------------- /keys/server-key-ecc-521.der: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gojimmypi/wolfssh/b7418a21a36ea3b7b67b5f01a86f5b2ea41aa151/keys/server-key-ecc-521.der -------------------------------------------------------------------------------- /keys/server-key-ecc-521.pem: -------------------------------------------------------------------------------- 1 | ASN1 OID: secp521r1 2 | NIST CURVE: P-521 3 | -----BEGIN EC PARAMETERS----- 4 | BgUrgQQAIw== 5 | -----END EC PARAMETERS----- 6 | -----BEGIN EC PRIVATE KEY----- 7 | MIHcAgEBBEIATKTYZCjZQA57LfORLrmWwZWJUEOvkuht5wrk30byKikaa7J0iq6C 8 | WA32w59Js+2C8XiezhtlfUVDjP8VZTQ1RXWgBwYFK4EEACOhgYkDgYYABAH40KfD 9 | xY2EGVeWnyE6lPPaVQ7fdtjdFxUx81uwaci8MA1vazfRgEapcX8sb1lRnIJwlbKa 10 | YxMwYhjCNXaUAND5bQAKGTujRmUr60CamkXFl6Ptky3Vqq6Wvy8xflp6x0WLPGzb 11 | qpDDVTgs383Kc3fZLrIKXox0I3ylo0Wxnj8aIpCxVA== 12 | -----END EC PRIVATE KEY----- 13 | -------------------------------------------------------------------------------- /keys/server-key-ecc.der: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gojimmypi/wolfssh/b7418a21a36ea3b7b67b5f01a86f5b2ea41aa151/keys/server-key-ecc.der -------------------------------------------------------------------------------- /keys/server-key-ecc.pem: -------------------------------------------------------------------------------- 1 | ASN1 OID: prime256v1 2 | NIST CURVE: P-256 3 | -----BEGIN EC PARAMETERS----- 4 | BggqhkjOPQMBBw== 5 | -----END EC PARAMETERS----- 6 | -----BEGIN EC PRIVATE KEY----- 7 | MHcCAQEEIGEJmQt50l8oWg9dFcyhVlT5KzmHIS2nfYV7uH84xm3VoAoGCCqGSM49 8 | AwEHoUQDQgAEgRP/pCu3nEV0eoNMYfM/rSbPIs2po7ylYbR85mLUwvdVQ5ox+4AR 9 | ILUSSyT1eNf9Iu9GNfAFWGtfY8jaG8T1aQ== 10 | -----END EC PRIVATE KEY----- 11 | -------------------------------------------------------------------------------- /keys/server-key-rsa.der: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gojimmypi/wolfssh/b7418a21a36ea3b7b67b5f01a86f5b2ea41aa151/keys/server-key-rsa.der -------------------------------------------------------------------------------- /keys/server-key-rsa.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIIEowIBAAKCAQEA2l2tJRR2FVnzQP08uGIws23A+ezsi4MenkKcykFq04rhUjTg 3 | DRNiftQPrlxNBPGN+sWtd6paBcrv+I2r/4opCUwEwvUZy+0fsbQp08NsqSPfo6Dl 4 | CN6tjHH5NIhs7Tvwb6UPrFn/azPxcPuMpLNFIo2dd3rlKV+EFNmZ6urOLVHz41j6 5 | WwIPybUqvLJe08Iwuzyxw+9Y81CUKIvEZUr3ANmX2WtNjZWhimIGtFARIoO06irn 6 | 0KggR0//Rq7FE+E4i/hUrzpNL/gf14SQ2JMFBsJ9kNvjnNDEZVoDrQCsWqLN2j+J 7 | WDdTvytGeqyJQStaLuh2517jKYWjY+rmhmB8LQIDAQABAoH/D5EeBsaupFcFQFzN 8 | N1fIoQHx/98j/c4bIK0fAEwpkWsVJQcf8c6v9tqnQ4bQ9slBld8BvsYmJMOS1+VB 9 | nbX7tu30aPGQJTmCSOjPEomb9XLZPpD5wugc9yYo3dXb7g2X1l2uAFtqGfpZ+/Py 10 | 0sr04sG1uA7Kx2hHwjTBBD449IIBWfKKbvdrWwq8BaknN7n5BoBU6HAatDKTa/Um 11 | x4b0WAVD+XKP7EKgO7o1Yszs9LMEouuuPIdAjv6P3RS+vYPJyRjKgXwG+eOZLuwp 12 | xSdW6h6TxugMRMpzaEp/rhYlHRIlFCrsQWklw13mruRZgB36vZ8zNpOdiNaIyVsn 13 | ewthAoGBAN4Bq/pl0vrSb/4/V211f4zmvf4IvccTNGIOh7J6LKnNypPYMZGBLdZo 14 | lqol47h+pZio6BU8wM7e9auAsfW6r6ycwbNDNK4i9xhBhmOiRI4bQZ0tdW8NWxAZ 15 | XRSqgB/uAj74tvbsZY44iQ0LUOQRSYY5gttz5ToPEyKrraB4m5QhAoGBAPvNTFJJ 16 | PyyAlJFKOOwPSn06jrwEkBUlhPvTaL3voEf+zlu/HSqUJ/xRcP/J6bq+K6BQJdPh 17 | oVczzFzHfQn23PtylD3KWVJz4GxFCtnaMN8rM9dSGEEB8N8bAcHTt5sm+ByP/8gZ 18 | /TbQE6VyQqMwWVe02ioJ5UVaOW1wIgy6UyaNAoGBALE8wnDwk8Q89r4TEZhIguEZ 19 | YbsKfYAOO/bAxOLfGQMjUURBCCmy6MZQz1/dSfUD3u6GgmpaC0/cvmMCJpEYTqHO 20 | r/GOiOMw9PX/cevfIz4UUojKPwO+tOGgbihOimVzXYWqiF+PkPA/AGNSkmzRxFIN 21 | XgQXfXyhhlRanQ4M26AhAoGBAOr+G54nsYdssDovlJPpaVEZlx+s+nJhw4vpLrUj 22 | rufBywAgia20+uQldVmiLDkVRU2lvsfQqGvjcXOc0Pq9ologAmzwLRAgCG/Ct2+8 23 | iyObBBSNDwmMMClm4OrtFUr8wUyWrtUmPAQtiEg9LCdz9c0+gOP+vDNPEo0puv05 24 | 3mP5AoGBAIsfR6KQS4I7iS3pa+Eo5SKHg9DeHg2MzIRDPSONnWy8xMbaRER5ILY+ 25 | 78+KxDiw5dpFrFrMe2K6qXMfuidcgvitMR7e8zdyy0fSzff4fwA5240qyk7BzuIV 26 | idY6Ya6dojClha446kZ03AI6rOlfo8ZzT3OBkFbDzndfW7psQvEh 27 | -----END RSA PRIVATE KEY----- 28 | -------------------------------------------------------------------------------- /keys/server-key.pem: -------------------------------------------------------------------------------- 1 | ASN1 OID: prime256v1 2 | -----BEGIN EC PARAMETERS----- 3 | BggqhkjOPQMBBw== 4 | -----END EC PARAMETERS----- 5 | -----BEGIN EC PRIVATE KEY----- 6 | MHcCAQEEIEW2aQJznGyFoThbcujox6zEA41TNQT6bCjcNI3hqAmMoAoGCCqGSM49 7 | AwEHoUQDQgAEuzOsTCdQSsZKpQTDPN6fNttyLc6U6iv6yyAJOSwW6GEC6a9N0wKT 8 | mjFbl5Ihf/DPGNqREQI0huggWDMLgDSJ2A== 9 | -----END EC PRIVATE KEY----- 10 | -------------------------------------------------------------------------------- /m4/ax_add_am_macro.m4: -------------------------------------------------------------------------------- 1 | # =========================================================================== 2 | # https://www.gnu.org/software/autoconf-archive/ax_add_am_macro.html 3 | # =========================================================================== 4 | # 5 | # SYNOPSIS 6 | # 7 | # AX_ADD_AM_MACRO([RULE]) 8 | # 9 | # DESCRIPTION 10 | # 11 | # Adds the specified rule to $AMINCLUDE. This macro will only work 12 | # properly with implementations of Make which allow include statements. 13 | # See also AX_ADD_AM_MACRO_STATIC. 14 | # 15 | # LICENSE 16 | # 17 | # Copyright (c) 2009 Tom Howard 18 | # 19 | # Copying and distribution of this file, with or without modification, are 20 | # permitted in any medium without royalty provided the copyright notice 21 | # and this notice are preserved. This file is offered as-is, without any 22 | # warranty. 23 | 24 | #serial 10 25 | 26 | AC_DEFUN([AX_ADD_AM_MACRO],[ 27 | AC_REQUIRE([AX_AM_MACROS]) 28 | AX_APPEND_TO_FILE([$AMINCLUDE],[$1]) 29 | ]) 30 | -------------------------------------------------------------------------------- /m4/ax_am_jobserver.m4: -------------------------------------------------------------------------------- 1 | # =========================================================================== 2 | # https://www.gnu.org/software/autoconf-archive/ax_am_jobserver.html 3 | # =========================================================================== 4 | # 5 | # SYNOPSIS 6 | # 7 | # AX_AM_JOBSERVER([default_value]) 8 | # 9 | # DESCRIPTION 10 | # 11 | # Enables the use of make's jobserver for the purpose of parallel building 12 | # by passing the -j option to make. 13 | # 14 | # The option --enable-jobserver is added to configure which can accept a 15 | # yes, no, or an integer. The integer is the number of separate jobs to 16 | # allow. If 'yes' is given, then the is assumed to be one more than the 17 | # number of CPUs (determined through AX_COUNT_CPUS). If the value of no is 18 | # given, then the jobserver is disabled. The default value is given by the 19 | # first argument of the macro, or 'yes' if the argument is omitted. 20 | # 21 | # This macro makes use of AX_AM_MACROS, so you must add the following line 22 | # 23 | # @INC_AMINCLUDE@ 24 | # 25 | # to your Makefile.am files. 26 | # 27 | # LICENSE 28 | # 29 | # Copyright (c) 2008 Michael Paul Bailey 30 | # 31 | # Copying and distribution of this file, with or without modification, are 32 | # permitted in any medium without royalty provided the copyright notice 33 | # and this notice are preserved. This file is offered as-is, without any 34 | # warranty. 35 | 36 | #serial 8.1 37 | # Local update: Make the increment of enable-jobserver so it isn't executable 38 | # and is more posix syntax. 39 | 40 | AC_DEFUN([AX_AM_JOBSERVER], [ 41 | AC_REQUIRE([AX_COUNT_CPUS]) 42 | AC_REQUIRE([AX_AM_MACROS]) 43 | AC_ARG_ENABLE( jobserver, 44 | [ --enable-jobserver@<:@=no/yes/@%:@@:>@ default=m4_ifval([$1],[$1],[yes]) 45 | Enable up to @%:@ make jobs 46 | yes: enable one more than CPU count 47 | ],, [enable_jobserver=m4_ifval([$1],[$1],[yes])]) 48 | if test "x$enable_jobserver" = "xyes"; then 49 | enable_jobserver=$CPU_COUNT 50 | : $((enable_jobserver+=1)) 51 | fi 52 | m4_pattern_allow(AM_MAKEFLAGS) 53 | if test "x$enable_jobserver" != "xno"; then 54 | AC_MSG_NOTICE([added jobserver support to make for $enable_jobserver jobs]) 55 | AX_ADD_AM_MACRO( AM_MAKEFLAGS += -j$enable_jobserver ) 56 | fi 57 | ]) 58 | -------------------------------------------------------------------------------- /m4/ax_am_macros.m4: -------------------------------------------------------------------------------- 1 | # =========================================================================== 2 | # https://www.gnu.org/software/autoconf-archive/ax_am_macros.html 3 | # =========================================================================== 4 | # 5 | # SYNOPSIS 6 | # 7 | # AX_AM_MACROS 8 | # 9 | # DESCRIPTION 10 | # 11 | # Adds support for macros that create Make rules. You must manually add 12 | # the following line 13 | # 14 | # @INC_AMINCLUDE@ 15 | # 16 | # to your Makefile.in (or Makefile.am if you use Automake) files. 17 | # 18 | # LICENSE 19 | # 20 | # Copyright (c) 2009 Tom Howard 21 | # 22 | # Copying and distribution of this file, with or without modification, are 23 | # permitted in any medium without royalty provided the copyright notice 24 | # and this notice are preserved. This file is offered as-is, without any 25 | # warranty. 26 | 27 | #serial 11 28 | 29 | AC_DEFUN([AX_AM_MACROS], 30 | [ 31 | AC_MSG_NOTICE([adding automake macro support]) 32 | AMINCLUDE="aminclude.am" 33 | AC_SUBST(AMINCLUDE) 34 | AC_MSG_NOTICE([creating $AMINCLUDE]) 35 | AMINCLUDE_TIME=`LC_ALL=C date` 36 | AX_PRINT_TO_FILE([$AMINCLUDE],[[ 37 | # generated automatically by configure from AX_AUTOMAKE_MACROS 38 | # on $AMINCLUDE_TIME 39 | 40 | ]]) 41 | 42 | INC_AMINCLUDE="include \$(top_builddir)/$AMINCLUDE" 43 | AC_SUBST(INC_AMINCLUDE) 44 | ]) 45 | -------------------------------------------------------------------------------- /m4/ax_append_flag.m4: -------------------------------------------------------------------------------- 1 | # =========================================================================== 2 | # https://www.gnu.org/software/autoconf-archive/ax_append_flag.html 3 | # =========================================================================== 4 | # 5 | # SYNOPSIS 6 | # 7 | # AX_APPEND_FLAG(FLAG, [FLAGS-VARIABLE]) 8 | # 9 | # DESCRIPTION 10 | # 11 | # FLAG is appended to the FLAGS-VARIABLE shell variable, with a space 12 | # added in between. 13 | # 14 | # If FLAGS-VARIABLE is not specified, the current language's flags (e.g. 15 | # CFLAGS) is used. FLAGS-VARIABLE is not changed if it already contains 16 | # FLAG. If FLAGS-VARIABLE is unset in the shell, it is set to exactly 17 | # FLAG. 18 | # 19 | # NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. 20 | # 21 | # LICENSE 22 | # 23 | # Copyright (c) 2008 Guido U. Draheim 24 | # Copyright (c) 2011 Maarten Bosmans 25 | # 26 | # This program is free software: you can redistribute it and/or modify it 27 | # under the terms of the GNU General Public License as published by the 28 | # Free Software Foundation, either version 3 of the License, or (at your 29 | # option) any later version. 30 | # 31 | # This program is distributed in the hope that it will be useful, but 32 | # WITHOUT ANY WARRANTY; without even the implied warranty of 33 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 34 | # Public License for more details. 35 | # 36 | # You should have received a copy of the GNU General Public License along 37 | # with this program. If not, see . 38 | # 39 | # As a special exception, the respective Autoconf Macro's copyright owner 40 | # gives unlimited permission to copy, distribute and modify the configure 41 | # scripts that are the output of Autoconf when processing the Macro. You 42 | # need not follow the terms of the GNU General Public License when using 43 | # or distributing such scripts, even though portions of the text of the 44 | # Macro appear in them. The GNU General Public License (GPL) does govern 45 | # all other use of the material that constitutes the Autoconf Macro. 46 | # 47 | # This special exception to the GPL applies to versions of the Autoconf 48 | # Macro released by the Autoconf Archive. When you make and distribute a 49 | # modified version of the Autoconf Macro, you may extend this special 50 | # exception to the GPL to apply to your modified version as well. 51 | 52 | #serial 7 53 | 54 | AC_DEFUN([AX_APPEND_FLAG], 55 | [dnl 56 | AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_SET_IF 57 | AS_VAR_PUSHDEF([FLAGS], [m4_default($2,_AC_LANG_PREFIX[FLAGS])]) 58 | AS_VAR_SET_IF(FLAGS,[ 59 | AS_CASE([" AS_VAR_GET(FLAGS) "], 60 | [*" $1 "*], [AC_RUN_LOG([: FLAGS already contains $1])], 61 | [ 62 | AS_VAR_APPEND(FLAGS,[" $1"]) 63 | AC_RUN_LOG([: FLAGS="$FLAGS"]) 64 | ]) 65 | ], 66 | [ 67 | AS_VAR_SET(FLAGS,[$1]) 68 | AC_RUN_LOG([: FLAGS="$FLAGS"]) 69 | ]) 70 | AS_VAR_POPDEF([FLAGS])dnl 71 | ])dnl AX_APPEND_FLAG 72 | -------------------------------------------------------------------------------- /m4/ax_append_to_file.m4: -------------------------------------------------------------------------------- 1 | # =========================================================================== 2 | # https://www.gnu.org/software/autoconf-archive/ax_append_to_file.html 3 | # =========================================================================== 4 | # 5 | # SYNOPSIS 6 | # 7 | # AX_APPEND_TO_FILE([FILE],[DATA]) 8 | # 9 | # DESCRIPTION 10 | # 11 | # Appends the specified data to the specified file. 12 | # 13 | # LICENSE 14 | # 15 | # Copyright (c) 2008 Tom Howard 16 | # 17 | # Copying and distribution of this file, with or without modification, are 18 | # permitted in any medium without royalty provided the copyright notice 19 | # and this notice are preserved. This file is offered as-is, without any 20 | # warranty. 21 | 22 | #serial 9 23 | 24 | AC_DEFUN([AX_APPEND_TO_FILE],[ 25 | AC_REQUIRE([AX_FILE_ESCAPES]) 26 | printf "%s" "$2" >> "$1" 27 | ]) 28 | -------------------------------------------------------------------------------- /m4/ax_debug.m4: -------------------------------------------------------------------------------- 1 | # =========================================================================== 2 | # https://github.com/BrianAker/ddm4/ 3 | # =========================================================================== 4 | # 5 | # SYNOPSIS 6 | # 7 | # AX_DEBUG() 8 | # 9 | # DESCRIPTION 10 | # 11 | # --enable-debug 12 | # 13 | # LICENSE 14 | # 15 | # Copyright (C) 2012 Brian Aker 16 | # All rights reserved. 17 | # 18 | # Redistribution and use in source and binary forms, with or without 19 | # modification, are permitted provided that the following conditions are 20 | # met: 21 | # 22 | # * Redistributions of source code must retain the above copyright 23 | # notice, this list of conditions and the following disclaimer. 24 | # 25 | # * Redistributions in binary form must reproduce the above 26 | # copyright notice, this list of conditions and the following disclaimer 27 | # in the documentation and/or other materials provided with the 28 | # distribution. 29 | # 30 | # * The names of its contributors may not be used to endorse or 31 | # promote products derived from this software without specific prior 32 | # written permission. 33 | # 34 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 35 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 36 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 37 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 38 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 39 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 40 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 41 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 42 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 43 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 44 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 45 | 46 | #serial 6.1 47 | 48 | AC_DEFUN([AX_DEBUG], 49 | [AC_PREREQ([2.63])dnl 50 | AC_ARG_ENABLE([debug], 51 | [AS_HELP_STRING([--enable-debug], 52 | [Add debug code/turns off optimizations (yes|no) @<:@default=no@:>@])], 53 | [ax_enable_debug=$enableval], 54 | [ax_enable_debug=no]) 55 | 56 | AS_IF([test "x$ax_enable_debug" = xyes], 57 | [AC_DEFINE([DEBUG],[1],[Define to 1 to enable debugging code.])], 58 | [AC_SUBST([MCHECK]) 59 | AC_DEFINE([DEBUG],[0],[Define to 1 to enable debugging code.])]) 60 | 61 | AC_MSG_CHECKING([for debug]) 62 | AC_MSG_RESULT([$ax_enable_debug]) 63 | AM_CONDITIONAL([DEBUG],[test "x${ax_enable_debug}" = xyes])]) 64 | -------------------------------------------------------------------------------- /m4/ax_file_escapes.m4: -------------------------------------------------------------------------------- 1 | # =========================================================================== 2 | # https://www.gnu.org/software/autoconf-archive/ax_file_escapes.html 3 | # =========================================================================== 4 | # 5 | # SYNOPSIS 6 | # 7 | # AX_FILE_ESCAPES 8 | # 9 | # DESCRIPTION 10 | # 11 | # Writes the specified data to the specified file. 12 | # 13 | # LICENSE 14 | # 15 | # Copyright (c) 2008 Tom Howard 16 | # 17 | # Copying and distribution of this file, with or without modification, are 18 | # permitted in any medium without royalty provided the copyright notice 19 | # and this notice are preserved. This file is offered as-is, without any 20 | # warranty. 21 | 22 | #serial 8 23 | 24 | AC_DEFUN([AX_FILE_ESCAPES],[ 25 | AX_DOLLAR="\$" 26 | AX_SRB="\\135" 27 | AX_SLB="\\133" 28 | AX_BS="\\\\" 29 | AX_DQ="\"" 30 | ]) 31 | -------------------------------------------------------------------------------- /m4/ax_print_to_file.m4: -------------------------------------------------------------------------------- 1 | # =========================================================================== 2 | # https://www.gnu.org/software/autoconf-archive/ax_print_to_file.html 3 | # =========================================================================== 4 | # 5 | # SYNOPSIS 6 | # 7 | # AX_PRINT_TO_FILE([FILE],[DATA]) 8 | # 9 | # DESCRIPTION 10 | # 11 | # Writes the specified data to the specified file. 12 | # 13 | # LICENSE 14 | # 15 | # Copyright (c) 2008 Tom Howard 16 | # 17 | # Copying and distribution of this file, with or without modification, are 18 | # permitted in any medium without royalty provided the copyright notice 19 | # and this notice are preserved. This file is offered as-is, without any 20 | # warranty. 21 | 22 | #serial 8 23 | 24 | AC_DEFUN([AX_PRINT_TO_FILE],[ 25 | AC_REQUIRE([AX_FILE_ESCAPES]) 26 | printf "$2" > "$1" 27 | ]) 28 | -------------------------------------------------------------------------------- /m4/ax_require_defined.m4: -------------------------------------------------------------------------------- 1 | # =========================================================================== 2 | # https://www.gnu.org/software/autoconf-archive/ax_require_defined.html 3 | # =========================================================================== 4 | # 5 | # SYNOPSIS 6 | # 7 | # AX_REQUIRE_DEFINED(MACRO) 8 | # 9 | # DESCRIPTION 10 | # 11 | # AX_REQUIRE_DEFINED is a simple helper for making sure other macros have 12 | # been defined and thus are available for use. This avoids random issues 13 | # where a macro isn't expanded. Instead the configure script emits a 14 | # non-fatal: 15 | # 16 | # ./configure: line 1673: AX_CFLAGS_WARN_ALL: command not found 17 | # 18 | # It's like AC_REQUIRE except it doesn't expand the required macro. 19 | # 20 | # Here's an example: 21 | # 22 | # AX_REQUIRE_DEFINED([AX_CHECK_LINK_FLAG]) 23 | # 24 | # LICENSE 25 | # 26 | # Copyright (c) 2014 Mike Frysinger 27 | # 28 | # Copying and distribution of this file, with or without modification, are 29 | # permitted in any medium without royalty provided the copyright notice 30 | # and this notice are preserved. This file is offered as-is, without any 31 | # warranty. 32 | 33 | #serial 2 34 | 35 | AC_DEFUN([AX_REQUIRE_DEFINED], [dnl 36 | m4_ifndef([$1], [m4_fatal([macro ]$1[ is not defined; is a m4 file missing?])]) 37 | ])dnl AX_REQUIRE_DEFINED 38 | -------------------------------------------------------------------------------- /m4/hexversion.m4: -------------------------------------------------------------------------------- 1 | AC_DEFUN([CREATE_HEX_VERSION],[ 2 | 3 | HEX_VERSION=`echo $VERSION | sed 's|[\-a-z0-9]*$||' | \ 4 | awk -F. '{printf "0x%0.2d%0.3d%0.3d", $[]1, $[]2, $[]3}'` 5 | AC_SUBST([HEX_VERSION]) 6 | ]) 7 | -------------------------------------------------------------------------------- /scripts/external.test: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # external tests 4 | host="$WOLFSSH_EXTERNAL_HOST" 5 | user="$WOLFSSH_EXTERNAL_USER" 6 | password="$WOLFSSH_EXTERNAL_PASSWORD" 7 | 8 | if test -n "$WOLFSSH_EXTERNAL_TEST"; then 9 | echo "WOLFSSH_EXTERNAL_TEST set, running test..." 10 | else 11 | echo "WOLFSSH_EXTERNAL_TEST NOT set, won't run" 12 | exit 77 13 | fi 14 | 15 | # test for nonblocking only 16 | ./examples/client/client -h | grep WOLFSSH_TEST_BLOCK 17 | if [ $? -eq 0 ] 18 | then 19 | echo "macro NO_WOLFSSH_CLIENT was used" 20 | echo "skipping for now" 21 | exit 77 22 | fi 23 | 24 | do_cleanup() { 25 | echo "in cleanup" 26 | } 27 | 28 | do_trap() { 29 | echo "got trap" 30 | do_cleanup 31 | exit -1 32 | } 33 | 34 | trap do_trap INT TERM 35 | 36 | [ ! -x ./examples/client/client ] && echo -e "\n\nClient doesn't exist" && exit 1 37 | 38 | echo "Testing client connection to $host : " 39 | ./examples/client/client -u $user -P $password -h $host -p 22 -x 40 | RESULT=$? 41 | if [ $RESULT -ne 0 ]; then 42 | echo -e "failed to connect\n" 43 | do_cleanup 44 | exit 1 45 | fi 46 | echo -e "Success\n" 47 | 48 | 49 | # not having the sftp client built in is not a failure case 50 | ./examples/sftpclient/wolfsftp -h 51 | if [ $? -eq 0 ]; then 52 | echo "Testing wolfsftp connection to $host : " 53 | echo "exit" | ./examples/sftpclient/wolfsftp -u $user -P $password -h $host -p 22 54 | RESULT=$? 55 | if [ $RESULT -ne 0 ]; then 56 | echo -e "failed to connect\n" 57 | do_cleanup 58 | exit 1 59 | else 60 | echo -e "Success\n" 61 | fi 62 | else 63 | echo -e "\n\nwolfSFTP client doesn't exist" 64 | fi 65 | 66 | echo -e "\nALL Tests Passed" 67 | 68 | exit 0 69 | 70 | -------------------------------------------------------------------------------- /scripts/include.am: -------------------------------------------------------------------------------- 1 | # vim:ft=automake 2 | # included from Top Level Makefile.am 3 | # All paths should be given relative to the root 4 | 5 | if BUILD_SFTP 6 | dist_noinst_SCRIPTS+= scripts/sftp.test 7 | dist_noinst_SCRIPTS+= scripts/get-put.test 8 | endif 9 | 10 | if BUILD_SCP 11 | dist_noinst_SCRIPTS+= scripts/scp.test 12 | endif 13 | 14 | dist_noinst_SCRIPTS+= scripts/external.test 15 | -------------------------------------------------------------------------------- /src/include.am: -------------------------------------------------------------------------------- 1 | # vim:ft=automake 2 | # included from Top Level Makefile.am 3 | # All paths should be given relative to the root 4 | 5 | lib_LTLIBRARIES += src/libwolfssh.la 6 | src_libwolfssh_la_SOURCES = src/ssh.c \ 7 | src/internal.c \ 8 | src/log.c \ 9 | src/io.c \ 10 | src/port.c 11 | src_libwolfssh_la_CPPFLAGS = -DBUILDING_WOLFSSH ${AM_CPPFLAGS} 12 | src_libwolfssh_la_LDFLAGS = -no-undefined -version-info ${WOLFSSH_LIBRARY_VERSION} 13 | 14 | if !BUILD_INLINE 15 | src_libwolfssh_la_SOURCES += src/misc.c 16 | endif 17 | 18 | if BUILD_KEYGEN 19 | src_libwolfssh_la_SOURCES += src/keygen.c 20 | endif 21 | 22 | if BUILD_SCP 23 | src_libwolfssh_la_SOURCES += src/wolfscp.c 24 | endif 25 | 26 | if BUILD_SFTP 27 | src_libwolfssh_la_SOURCES += src/wolfsftp.c 28 | endif 29 | 30 | if BUILD_TERM 31 | src_libwolfssh_la_SOURCES += src/wolfterm.c 32 | endif 33 | 34 | if BUILD_AGENT 35 | src_libwolfssh_la_SOURCES += src/agent.c 36 | endif 37 | 38 | if BUILD_CERTS 39 | src_libwolfssh_la_SOURCES += src/certman.c 40 | endif 41 | -------------------------------------------------------------------------------- /sshd_config: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gojimmypi/wolfssh/b7418a21a36ea3b7b67b5f01a86f5b2ea41aa151/sshd_config -------------------------------------------------------------------------------- /tests/api.h: -------------------------------------------------------------------------------- 1 | /* api.h 2 | * 3 | * Copyright (C) 2014-2024 wolfSSL Inc. 4 | * 5 | * This file is part of wolfSSH. 6 | * 7 | * wolfSSH is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * wolfSSH is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with wolfSSH. If not, see . 19 | */ 20 | 21 | #ifndef _WOLFSSH_TESTS_API_H_ 22 | #define _WOLFSSH_TESTS_API_H_ 23 | 24 | int wolfSSH_ApiTest(int argc, char** argv); 25 | 26 | #endif /* _WOLFSSH_TESTS_API_H_ */ 27 | -------------------------------------------------------------------------------- /tests/auth.h: -------------------------------------------------------------------------------- 1 | /* auth.h 2 | * 3 | * Copyright (C) 2025 wolfSSL Inc. 4 | * 5 | * This file is part of wolfSSH. 6 | * 7 | * wolfSSH is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * wolfSSH is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with wolfSSH. If not, see . 19 | */ 20 | 21 | #ifndef _WOLFSSH_TESTS_AUTH_H_ 22 | #define _WOLFSSH_TESTS_AUTH_H_ 23 | 24 | #include 25 | 26 | int wolfSSH_AuthTest(int argc, char** argv); 27 | 28 | typedef struct thread_args { 29 | int return_code; 30 | tcp_ready* signal; 31 | } thread_args; 32 | 33 | #endif /* _WOLFSSH_TESTS_AUTH_H_ */ 34 | -------------------------------------------------------------------------------- /tests/kex.h: -------------------------------------------------------------------------------- 1 | /* kex.h 2 | * 3 | * Copyright (C) 2025 wolfSSL Inc. 4 | * 5 | * This file is part of wolfSSH. 6 | * 7 | * wolfSSH is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * wolfSSH is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with wolfSSH. If not, see . 19 | */ 20 | 21 | #ifndef _WOLFSSH_TESTS_KEX_H_ 22 | #define _WOLFSSH_TESTS_KEX_H_ 23 | 24 | int wolfSSH_KexTest(int argc, char** argv); 25 | 26 | #endif /* _WOLFSSH_TESTS_KEX_H_ */ 27 | -------------------------------------------------------------------------------- /tests/sftp.h: -------------------------------------------------------------------------------- 1 | /* sftp.h 2 | * 3 | * Copyright (C) 2014-2024 wolfSSL Inc. 4 | * 5 | * This file is part of wolfSSH. 6 | * 7 | * wolfSSH is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * wolfSSH is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with wolfSSH. If not, see . 19 | */ 20 | 21 | #ifndef _WOLFSSH_TESTS_SFTP_H_ 22 | #define _WOLFSSH_TESTS_SFTP_H_ 23 | 24 | int wolfSSH_SftpTest(int flag); 25 | 26 | #endif /* _WOLFSSH_TESTS_SFTP_H_ */ 27 | -------------------------------------------------------------------------------- /tests/testsuite.h: -------------------------------------------------------------------------------- 1 | /* testsuite.h 2 | * 3 | * Copyright (C) 2014-2024 wolfSSL Inc. 4 | * 5 | * This file is part of wolfSSH. 6 | * 7 | * wolfSSH is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * wolfSSH is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with wolfSSH. If not, see . 19 | */ 20 | 21 | #ifndef _WOLFSSH_TESTS_TESTSUITE_H_ 22 | #define _WOLFSSH_TESTS_TESTSUITE_H_ 23 | 24 | int wolfSSH_TestsuiteTest(int argc, char** argv); 25 | 26 | #endif /* _WOLFSSH_TESTS_TESTSUITE_H_ */ 27 | -------------------------------------------------------------------------------- /tests/unit.h: -------------------------------------------------------------------------------- 1 | /* unit.h 2 | * 3 | * Copyright (C) 2014-2024 wolfSSL Inc. 4 | * 5 | * This file is part of wolfSSH. 6 | * 7 | * wolfSSH is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * wolfSSH is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with wolfSSH. If not, see . 19 | */ 20 | 21 | #ifndef _WOLFSSH_TESTS_UNIT_H_ 22 | #define _WOLFSSH_TESTS_UNIT_H_ 23 | 24 | int wolfSSH_UnitTest(int argc, char** argv); 25 | 26 | #endif /* _WOLFSSH_TESTS_UNIT_H_ */ 27 | -------------------------------------------------------------------------------- /wolfssh/certman.h: -------------------------------------------------------------------------------- 1 | /* certman.h 2 | * 3 | * Copyright (C) 2014-2024 wolfSSL Inc. 4 | * 5 | * This file is part of wolfSSH. 6 | * 7 | * wolfSSH is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * wolfSSH is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with wolfSSH. If not, see . 19 | */ 20 | 21 | 22 | /* 23 | * The certman module contains utility functions wrapping the wolfSSL 24 | * certificate manager functions to validate user certificates. 25 | */ 26 | 27 | 28 | #ifndef _WOLFSSH_CERTMAN_H_ 29 | #define _WOLFSSH_CERTMAN_H_ 30 | 31 | #include 32 | #include 33 | 34 | #ifdef __cplusplus 35 | extern "C" { 36 | #endif 37 | 38 | 39 | struct WOLFSSH_CERTMAN; 40 | typedef struct WOLFSSH_CERTMAN WOLFSSH_CERTMAN; 41 | 42 | 43 | WOLFSSH_API 44 | WOLFSSH_CERTMAN* wolfSSH_CERTMAN_new(void* heap); 45 | 46 | WOLFSSH_API 47 | void wolfSSH_CERTMAN_free(WOLFSSH_CERTMAN* cm); 48 | 49 | WOLFSSH_API 50 | int wolfSSH_CERTMAN_LoadRootCA_buffer(WOLFSSH_CERTMAN* cm, 51 | const unsigned char* rootCa, word32 rootCaSz); 52 | 53 | WOLFSSH_API 54 | int wolfSSH_CERTMAN_VerifyCerts_buffer(WOLFSSH_CERTMAN* cm, 55 | const unsigned char* cert, word32 certSz, word32 certCount); 56 | 57 | 58 | #ifdef __cplusplus 59 | } 60 | #endif 61 | 62 | #endif /* _WOLFSSH_CERTMAN_H_ */ 63 | -------------------------------------------------------------------------------- /wolfssh/include.am: -------------------------------------------------------------------------------- 1 | # vim:ft=automake 2 | # All paths should be given relative to the root 3 | # 4 | 5 | nobase_include_HEADERS+= \ 6 | wolfssh/agent.h \ 7 | wolfssh/certman.h \ 8 | wolfssh/version.h \ 9 | wolfssh/ssh.h \ 10 | wolfssh/keygen.h \ 11 | wolfssh/port.h \ 12 | wolfssh/settings.h \ 13 | wolfssh/error.h \ 14 | wolfssh/visibility.h \ 15 | wolfssh/wolfscp.h \ 16 | wolfssh/misc.h \ 17 | wolfssh/log.h \ 18 | wolfssh/test.h \ 19 | wolfssh/certs_test.h \ 20 | wolfssh/wolfsftp.h 21 | 22 | noinst_HEADERS+= wolfssh/internal.h 23 | 24 | -------------------------------------------------------------------------------- /wolfssh/keygen.h: -------------------------------------------------------------------------------- 1 | /* keygen.h 2 | * 3 | * Copyright (C) 2014-2024 wolfSSL Inc. 4 | * 5 | * This file is part of wolfSSH. 6 | * 7 | * wolfSSH is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * wolfSSH is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with wolfSSH. If not, see . 19 | */ 20 | 21 | 22 | /* 23 | * The keygen module contains utility functions wrapping the wolfCrypt 24 | * key generation functions to product SSH friendly keys. 25 | */ 26 | 27 | 28 | #ifndef _WOLFSSH_KEYGEN_H_ 29 | #define _WOLFSSH_KEYGEN_H_ 30 | 31 | #include 32 | #include 33 | 34 | #ifdef __cplusplus 35 | extern "C" { 36 | #endif 37 | 38 | 39 | #define WOLFSSH_RSAKEY_DEFAULT_SZ 2048 40 | #define WOLFSSH_RSAKEY_DEFAULT_E 65537 41 | #define WOLFSSH_ECDSAKEY_PRIME256 256 42 | #define WOLFSSH_ECDSAKEY_PRIME384 384 43 | #define WOLFSSH_ECDSAKEY_PRIME521 521 44 | 45 | 46 | WOLFSSH_API int wolfSSH_MakeRsaKey(byte* out, word32 outSz, 47 | word32 size, word32 e); 48 | WOLFSSH_API int wolfSSH_MakeEcdsaKey(byte* out, word32 outSz, word32 size); 49 | 50 | 51 | #ifdef __cplusplus 52 | } 53 | #endif 54 | 55 | #endif /* _WOLFSSH_KEYGEN_H_ */ 56 | 57 | -------------------------------------------------------------------------------- /wolfssh/log.h: -------------------------------------------------------------------------------- 1 | /* log.h 2 | * 3 | * Copyright (C) 2014-2024 wolfSSL Inc. 4 | * 5 | * This file is part of wolfSSH. 6 | * 7 | * wolfSSH is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * wolfSSH is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with wolfSSH. If not, see . 19 | */ 20 | 21 | 22 | /* 23 | * The log module contains the interface to the logging function. When 24 | * debugging is enabled and turned on, the logger will output to STDOUT. 25 | * A custom logging callback may be installed. 26 | */ 27 | 28 | 29 | #ifndef _WOLFSSH_LOG_H_ 30 | #define _WOLFSSH_LOG_H_ 31 | 32 | #include 33 | 34 | #ifdef __cplusplus 35 | extern "C" { 36 | #endif 37 | 38 | 39 | #ifdef NO_TIMESTAMP 40 | /* The NO_TIMESTAMP tag is deprecated. Convert to new name. */ 41 | #define WOLFSSH_NO_TIMESTAMP 42 | #endif 43 | 44 | 45 | enum wolfSSH_LogLevel { 46 | WS_LOG_CERTMAN = 9, 47 | WS_LOG_AGENT = 8, 48 | WS_LOG_SCP = 7, 49 | WS_LOG_SFTP = 6, 50 | WS_LOG_USER = 5, 51 | WS_LOG_ERROR = 4, 52 | WS_LOG_WARN = 3, 53 | WS_LOG_INFO = 2, 54 | WS_LOG_DEBUG = 1, 55 | WS_LOG_DEFAULT = WS_LOG_DEBUG 56 | }; 57 | 58 | 59 | typedef void (*wolfSSH_LoggingCb)(enum wolfSSH_LogLevel, 60 | const char *const logMsg); 61 | WOLFSSH_API void wolfSSH_SetLoggingCb(wolfSSH_LoggingCb logF); 62 | WOLFSSH_API int wolfSSH_LogEnabled(void); 63 | 64 | 65 | #ifdef __GNUC__ 66 | #define FMTCHECK __attribute__((format(printf,2,3))) 67 | #else 68 | #define FMTCHECK 69 | #endif /* __GNUC__ */ 70 | 71 | 72 | WOLFSSH_API void wolfSSH_Log(enum wolfSSH_LogLevel, 73 | const char *const, ...) FMTCHECK; 74 | 75 | #define WLOG(...) do { \ 76 | if (wolfSSH_LogEnabled()) \ 77 | wolfSSH_Log(__VA_ARGS__); \ 78 | } while (0) 79 | 80 | 81 | #ifdef __cplusplus 82 | } 83 | #endif 84 | 85 | #endif /* _WOLFSSH_LOG_H_ */ 86 | 87 | -------------------------------------------------------------------------------- /wolfssh/misc.h: -------------------------------------------------------------------------------- 1 | /* misc.h 2 | * 3 | * Copyright (C) 2014-2024 wolfSSL Inc. 4 | * 5 | * This file is part of wolfSSH. 6 | * 7 | * wolfSSH is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * wolfSSH is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with wolfSSH. If not, see . 19 | */ 20 | 21 | 22 | #ifndef _WOLFSSH_MISC_H_ 23 | #define _WOLFSSH_MISC_H_ 24 | 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | 31 | #include 32 | #include 33 | #include 34 | 35 | 36 | #ifdef NO_INLINE 37 | 38 | 39 | #ifndef min 40 | WOLFSSH_LOCAL word32 min(word32, word32); 41 | #endif /* min */ 42 | 43 | WOLFSSH_LOCAL void ato32(const byte*, word32*); 44 | WOLFSSH_LOCAL void c32toa(word32, byte*); 45 | WOLFSSH_LOCAL void ForceZero(const void*, word32); 46 | WOLFSSH_LOCAL int ConstantCompare(const byte*, const byte*, word32); 47 | 48 | 49 | #endif /* NO_INLINE */ 50 | 51 | 52 | #ifdef __cplusplus 53 | } /* extern "C" */ 54 | #endif 55 | 56 | #endif /* _WOLFSSH_MISC_H_ */ 57 | 58 | -------------------------------------------------------------------------------- /wolfssh/version.h: -------------------------------------------------------------------------------- 1 | /* version.h.in 2 | * 3 | * Copyright (C) 2014-2024 wolfSSL Inc. 4 | * 5 | * This file is part of wolfSSH. 6 | * 7 | * wolfSSH is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * wolfSSH is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with wolfSSH. If not, see . 19 | */ 20 | 21 | 22 | /* 23 | * The version header provides the current version number to the code 24 | * based and is updated automatically by the configure script. A copy 25 | * of the last generated copy of version.h is included with the 26 | * distribution for environments that do not use configure. 27 | */ 28 | 29 | 30 | #ifndef _WOLFSSH_VERSION_H_ 31 | #define _WOLFSSH_VERSION_H_ 32 | 33 | 34 | #ifdef __cplusplus 35 | extern "C" { 36 | #endif 37 | 38 | #define LIBWOLFSSH_VERSION_STRING "1.4.20" 39 | #define LIBWOLFSSH_VERSION_HEX 0x01004020 40 | 41 | #ifdef __cplusplus 42 | } 43 | #endif 44 | 45 | #endif /* _WOLFSSH_VERSION_H_ */ 46 | 47 | -------------------------------------------------------------------------------- /wolfssh/version.h.in: -------------------------------------------------------------------------------- 1 | /* version.h.in 2 | * 3 | * Copyright (C) 2014-2024 wolfSSL Inc. 4 | * 5 | * This file is part of wolfSSH. 6 | * 7 | * wolfSSH is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * wolfSSH is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with wolfSSH. If not, see . 19 | */ 20 | 21 | 22 | /* 23 | * The version header provides the current version number to the code 24 | * based and is updated automatically by the configure script. A copy 25 | * of the last generated copy of version.h is included with the 26 | * distribution for environments that do not use configure. 27 | */ 28 | 29 | 30 | #ifndef _WOLFSSH_VERSION_H_ 31 | #define _WOLFSSH_VERSION_H_ 32 | 33 | 34 | #ifdef __cplusplus 35 | extern "C" { 36 | #endif 37 | 38 | #define LIBWOLFSSH_VERSION_STRING "@VERSION@" 39 | #define LIBWOLFSSH_VERSION_HEX @HEX_VERSION@ 40 | 41 | #ifdef __cplusplus 42 | } 43 | #endif 44 | 45 | #endif /* _WOLFSSH_VERSION_H_ */ 46 | 47 | -------------------------------------------------------------------------------- /wolfssh/visibility.h: -------------------------------------------------------------------------------- 1 | /* visibility.h 2 | * 3 | * Copyright (C) 2014-2024 wolfSSL Inc. 4 | * 5 | * This file is part of wolfSSH. 6 | * 7 | * wolfSSH is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * wolfSSH is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with wolfSSH. If not, see . 19 | */ 20 | 21 | 22 | /* 23 | * The visibility header handles the visibility of function prototypes 24 | * between the local (used between modules in the library) and public 25 | * (exported for the library user) APIs. 26 | */ 27 | 28 | 29 | #ifndef _WOLFSSH_VISIBILITY_H_ 30 | #define _WOLFSSH_VISIBILITY_H_ 31 | 32 | 33 | #ifdef __cplusplus 34 | extern "C" { 35 | #endif 36 | 37 | /* WOLFSSH_API is used for the public API symbols. 38 | It either imports or exports (or does nothing for static builds) 39 | 40 | WOLFSSH_LOCAL is used for non-API symbols (private). 41 | */ 42 | 43 | #if defined(BUILDING_WOLFSSH) 44 | #if defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW32__) 45 | #ifdef WOLFSSH_DLL 46 | #define WOLFSSH_API extern __declspec(dllexport) 47 | #else 48 | #define WOLFSSH_API 49 | #endif 50 | #define WOLFSSH_LOCAL 51 | #elif defined(HAVE_VISIBILITY) && HAVE_VISIBILITY 52 | #define WOLFSSH_API __attribute__ ((visibility("default"))) 53 | #define WOLFSSH_LOCAL __attribute__ ((visibility("hidden"))) 54 | #elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550) 55 | #define WOLFSSH_API __global 56 | #define WOLFSSH_LOCAL __hidden 57 | #else 58 | #define WOLFSSH_API 59 | #define WOLFSSH_LOCAL 60 | #endif /* HAVE_VISIBILITY */ 61 | #else /* BUILDING_WOLFSSH */ 62 | #if defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW32__) 63 | #ifdef WOLFSSH_DLL 64 | #define WOLFSSH_API extern __declspec(dllimport) 65 | #else 66 | #define WOLFSSH_API 67 | #endif 68 | #define WOLFSSH_LOCAL 69 | #else 70 | #define WOLFSSH_API 71 | #define WOLFSSH_LOCAL 72 | #endif 73 | #endif /* BUILDING_WOLFSSH */ 74 | 75 | 76 | /* Do nothing tag to flag an API as deprecated. */ 77 | #define DEPRECATED 78 | 79 | 80 | #ifdef __cplusplus 81 | } 82 | #endif 83 | 84 | #endif /* _WOLFSSH_VISIBILITY_H_ */ 85 | 86 | -------------------------------------------------------------------------------- /zephyr/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if(CONFIG_WOLFSSH) 2 | zephyr_include_directories(${ZEPHYR_CURRENT_MODULE_DIR}) 3 | zephyr_include_directories(${ZEPHYR_CURRENT_MODULE_DIR}/zephyr) 4 | zephyr_library_include_directories(${ZEPHYR_CURRENT_MODULE_DIR}) 5 | FILE(GLOB wolfssh_sources ${ZEPHYR_CURRENT_MODULE_DIR}/src/*.c) 6 | target_sources(app PRIVATE ${wolfssh_sources}) 7 | if(CONFIG_WOLFSSH_DEBUG) 8 | target_compile_definitions(app PUBLIC DEBUG_WOLFSSH) 9 | endif() 10 | target_compile_definitions(app PUBLIC WOLFSSH_ZEPHYR) 11 | target_compile_definitions(app PUBLIC WOLFSSH_IGNORE_FILE_WARN) 12 | target_compile_definitions(app PUBLIC WOLFSSH_NO_TIMESTAMP) 13 | endif() 14 | -------------------------------------------------------------------------------- /zephyr/Kconfig: -------------------------------------------------------------------------------- 1 | menuconfig WOLFSSH 2 | bool "wolfSSH module support" 3 | select WOLFSSL 4 | 5 | if WOLFSSH 6 | config WOLFSSH_SETTINGS_FILE 7 | string "wolfSSH settings file" 8 | help 9 | Use a specific wolfSSH settings file. 10 | 11 | config WOLFSSH_SFTP_DEFAULT_DIR 12 | string "wolfSSH sftp default directory" 13 | help 14 | Use a specific directory as the default wolfSSH sftp working directory. 15 | 16 | config WOLFSSH_DEBUG 17 | bool "wolfSSH debug activation" 18 | help 19 | Enable debugging activation for wolfSSH. 20 | 21 | config ZEPHYR_WOLFSSH_MODULE 22 | bool 23 | depends on WOLFSSH 24 | endif 25 | 26 | -------------------------------------------------------------------------------- /zephyr/README.md: -------------------------------------------------------------------------------- 1 | Zephyr Project Port 2 | =================== 3 | 4 | ## Overview 5 | 6 | This port is for the Zephyr RTOS Project, available [here](https://www.zephyrproject.org/). 7 | 8 | 9 | It provides the following zephyr code. 10 | 11 | - modules/lib/wolfssh 12 | - wolfSSH library code 13 | - modules/lib/wolfssh/zephyr/ 14 | - Configuration and CMake files for wolfSSH as a Zephyr module 15 | - modules/lib/wolfssh/zephyr/samples/tests 16 | - wolfSSH tests 17 | 18 | ## How to setup as a Zephyr Module 19 | 20 | Follow the [instructions](https://docs.zephyrproject.org/latest/develop/getting_started/index.html) to setup a zephyr project. 21 | 22 | ### Modify your project's west manifest 23 | 24 | Add wolfSSH as a project to your west.yml: 25 | 26 | ``` 27 | manifest: 28 | remotes: 29 | # 30 | - name: wolfssh 31 | url-base: https://github.com/wolfssl 32 | 33 | projects: 34 | # 35 | - name: wolfssh 36 | path: modules/lib/wolfssh 37 | revision: master 38 | remote: wolfssh 39 | ``` 40 | 41 | Update west's modules: 42 | 43 | ```bash 44 | west update 45 | ``` 46 | 47 | Now west recognizes 'wolfssh' as a module, and will include it's Kconfig and 48 | CMakeFiles.txt in the build system. 49 | 50 | ## Build and Run Samples 51 | 52 | If you want to run build apps without running `west zephyr-export` then it is 53 | possible by setting the `CMAKE_PREFIX_PATH` variable to the location of the 54 | zephyr sdk and building from the `zephyr` directory. For example: 55 | 56 | ``` 57 | CMAKE_PREFIX_PATH=/path/to/zephyr-sdk- west build -p always -b qemu_x86 ../modules/lib/wolfssh/zephyr/samples/tests/ 58 | ``` 59 | 60 | ### Build and Run Tests 61 | 62 | build and execute `tests` 63 | 64 | ```bash 65 | cd [zephyrproject] 66 | west build -p auto -b qemu_x86 modules/lib/wolfssh/zephyr/samples/tests 67 | west build -t run 68 | ``` 69 | 70 | -------------------------------------------------------------------------------- /zephyr/module.yml: -------------------------------------------------------------------------------- 1 | name: wolfssh 2 | build: 3 | cmake: zephyr 4 | kconfig: zephyr/Kconfig 5 | depends: 6 | - wolfssl 7 | -------------------------------------------------------------------------------- /zephyr/samples/tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.20.0) 2 | 3 | find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) 4 | project(wolfssl_tests) 5 | 6 | FILE(GLOB app_sources ../../../tests/*.c ../../../examples/client/client.c 7 | ../../../examples/client/common.c ../../../examples/echoserver/echoserver.c 8 | ../../../examples/sftpclient/sftpclient.c tests.c) 9 | target_sources(app PRIVATE ${app_sources}) 10 | add_definitions(-DWOLFSSL_ZEPHYR) 11 | add_definitions(-DWOLFSSL_USER_SETTINGS) 12 | -------------------------------------------------------------------------------- /zephyr/samples/tests/prj.conf: -------------------------------------------------------------------------------- 1 | # Kernel options 2 | CONFIG_MAIN_STACK_SIZE=32768 3 | CONFIG_ENTROPY_GENERATOR=y 4 | CONFIG_INIT_STACKS=y 5 | CONFIG_COMMON_LIBC_MALLOC_ARENA_SIZE=524288 6 | 7 | # Enable wolfSSH 8 | CONFIG_WOLFSSH=y 9 | CONFIG_WOLFSSH_SETTINGS_FILE="samples/tests/wolfssh_user_settings.h" 10 | CONFIG_WOLFSSH_SFTP_DEFAULT_DIR="/RAM:" 11 | 12 | # Pthreads 13 | CONFIG_PTHREAD_IPC=y 14 | 15 | # Clock for time() 16 | CONFIG_POSIX_CLOCK=y 17 | 18 | # Networking 19 | CONFIG_NETWORKING=y 20 | CONFIG_NET_TEST=y 21 | CONFIG_NET_IPV4=y 22 | CONFIG_NET_IPV6=n 23 | CONFIG_NET_TCP=y 24 | CONFIG_NET_SOCKETS=y 25 | CONFIG_NET_SOCKETS_POSIX_NAMES=y 26 | 27 | CONFIG_NET_TEST=y 28 | CONFIG_NET_LOOPBACK=y 29 | 30 | # Network driver config 31 | CONFIG_TEST_RANDOM_GENERATOR=y 32 | 33 | # Network address config 34 | CONFIG_NET_CONFIG_SETTINGS=y 35 | CONFIG_NET_CONFIG_NEED_IPV4=y 36 | CONFIG_NET_CONFIG_MY_IPV4_ADDR="192.0.2.1" 37 | CONFIG_NET_CONFIG_PEER_IPV4_ADDR="192.0.2.2" 38 | CONFIG_NET_CONFIG_MY_IPV4_GW="192.0.2.2" 39 | 40 | CONFIG_NET_PKT_TX_COUNT=10 41 | CONFIG_NET_BUF_DATA_SIZE=256 42 | 43 | # Logging 44 | CONFIG_PRINTK=y 45 | CONFIG_LOG=y 46 | CONFIG_LOG_MODE_IMMEDIATE=y 47 | #CONFIG_WOLFSSH_DEBUG=y 48 | #CONFIG_WOLFSSL_DEBUG=y 49 | #CONFIG_DEBUG=y 50 | 51 | # Enable logging using RTT and UART 52 | #CONFIG_CBPRINTF_LIBC_SUBSTS=y 53 | #CONFIG_CBPRINTF_FP_SUPPORT=y 54 | #CONFIG_CONSOLE=y 55 | #CONFIG_LOG_BACKEND_UART=y 56 | #CONFIG_LOG_BUFFER_SIZE=15360 57 | 58 | # TLS configuration 59 | CONFIG_WOLFSSL=y 60 | CONFIG_WOLFSSL_BUILTIN=y 61 | CONFIG_WOLFSSL_SETTINGS_FILE="samples/tests/wolfssl_user_settings.h" 62 | 63 | CONFIG_WOLFSSL_TLS_VERSION_1_2=y 64 | CONFIG_WOLFSSL_KEY_EXCHANGE_ALL_ENABLED=y 65 | CONFIG_WOLFSSL_CIPHER_ALL_ENABLED=y 66 | CONFIG_WOLFSSL_MAC_ALL_ENABLED=y 67 | CONFIG_WOLFSSL_HMAC_DRBG_ENABLED=y 68 | 69 | # FS 70 | CONFIG_DISK_ACCESS=y 71 | CONFIG_DISK_DRIVERS=y 72 | CONFIG_DISK_DRIVER_RAM=y 73 | CONFIG_DISK_RAM_VOLUME_SIZE=64 74 | CONFIG_FILE_SYSTEM=y 75 | CONFIG_FILE_SYSTEM_MKFS=y 76 | CONFIG_FAT_FILESYSTEM_ELM=y 77 | CONFIG_FS_FATFS_LFN=y 78 | CONFIG_FS_FATFS_LFN_MODE_STACK=y 79 | 80 | -------------------------------------------------------------------------------- /zephyr/samples/tests/prj_nofs.conf: -------------------------------------------------------------------------------- 1 | # Kernel options 2 | CONFIG_MAIN_STACK_SIZE=32768 3 | CONFIG_ENTROPY_GENERATOR=y 4 | CONFIG_INIT_STACKS=y 5 | CONFIG_COMMON_LIBC_MALLOC_ARENA_SIZE=131072 6 | 7 | # Enable wolfSSH 8 | CONFIG_WOLFSSH=y 9 | CONFIG_WOLFSSH_SETTINGS_FILE="samples/tests/wolfssh_user_settings_nofs.h" 10 | 11 | # Pthreads 12 | CONFIG_PTHREAD_IPC=y 13 | 14 | # Clock for time() 15 | CONFIG_POSIX_CLOCK=y 16 | 17 | # Networking 18 | CONFIG_NETWORKING=y 19 | CONFIG_NET_TEST=y 20 | CONFIG_NET_IPV4=y 21 | CONFIG_NET_IPV6=n 22 | CONFIG_NET_TCP=y 23 | CONFIG_NET_SOCKETS=y 24 | CONFIG_NET_SOCKETS_POSIX_NAMES=y 25 | 26 | CONFIG_NET_TEST=y 27 | CONFIG_NET_LOOPBACK=y 28 | 29 | # Network driver config 30 | CONFIG_TEST_RANDOM_GENERATOR=y 31 | 32 | # Network address config 33 | CONFIG_NET_CONFIG_SETTINGS=y 34 | CONFIG_NET_CONFIG_NEED_IPV4=y 35 | CONFIG_NET_CONFIG_MY_IPV4_ADDR="192.0.2.1" 36 | CONFIG_NET_CONFIG_PEER_IPV4_ADDR="192.0.2.2" 37 | CONFIG_NET_CONFIG_MY_IPV4_GW="192.0.2.2" 38 | 39 | CONFIG_NET_PKT_TX_COUNT=10 40 | CONFIG_NET_BUF_DATA_SIZE=256 41 | 42 | # Logging 43 | CONFIG_PRINTK=y 44 | CONFIG_LOG=y 45 | CONFIG_LOG_MODE_IMMEDIATE=y 46 | #CONFIG_WOLFSSH_DEBUG=y 47 | #CONFIG_WOLFSSL_DEBUG=y 48 | #CONFIG_DEBUG=y 49 | 50 | # Enable logging using RTT and UART 51 | #CONFIG_CBPRINTF_LIBC_SUBSTS=y 52 | #CONFIG_CBPRINTF_FP_SUPPORT=y 53 | #CONFIG_CONSOLE=y 54 | #CONFIG_LOG_BACKEND_UART=y 55 | #CONFIG_LOG_BUFFER_SIZE=15360 56 | 57 | # TLS configuration 58 | CONFIG_WOLFSSL=y 59 | CONFIG_WOLFSSL_BUILTIN=y 60 | CONFIG_WOLFSSL_SETTINGS_FILE="samples/tests/wolfssl_user_settings_nofs.h" 61 | 62 | CONFIG_WOLFSSL_TLS_VERSION_1_2=y 63 | CONFIG_WOLFSSL_KEY_EXCHANGE_ALL_ENABLED=y 64 | CONFIG_WOLFSSL_CIPHER_ALL_ENABLED=y 65 | CONFIG_WOLFSSL_MAC_ALL_ENABLED=y 66 | CONFIG_WOLFSSL_HMAC_DRBG_ENABLED=y 67 | 68 | -------------------------------------------------------------------------------- /zephyr/samples/tests/sample.yaml: -------------------------------------------------------------------------------- 1 | sample: 2 | description: wolfSSH tests 3 | name: wolfSSH tests 4 | common: 5 | harness: console 6 | harness_config: 7 | type: one_line 8 | regex: 9 | - "Zephyr wolfSSH tests passed" 10 | tests: 11 | sample.lib.wolfssh_tests: 12 | timeout: 200 13 | platform_allow: qemu_x86 14 | integration_platforms: 15 | - qemu_x86 16 | sample.lib.wolfssh_nofs_tests: 17 | timeout: 200 18 | platform_allow: qemu_x86 19 | extra_args: CONF_FILE="prj_nofs.conf" 20 | integration_platforms: 21 | - qemu_x86 22 | -------------------------------------------------------------------------------- /zephyr/samples/tests/wolfssh_user_settings.h: -------------------------------------------------------------------------------- 1 | /* user_settings.h 2 | * 3 | * Copyright (C) 2014-2024 wolfSSL Inc. 4 | * 5 | * This file is part of wolfSSH. 6 | * 7 | * wolfSSH is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * wolfSSH is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with wolfSSH. If not, see . 19 | */ 20 | 21 | #ifndef WOLFSSH_USER_SETTINGS_H 22 | #define WOLFSSH_USER_SETTINGS_H 23 | 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | #include 30 | 31 | #undef WOLFSSH_SFTP 32 | #define WOLFSSH_SFTP 33 | 34 | #undef WOLFSSH_SCP 35 | #define WOLFSSH_SCP 36 | 37 | #undef NO_AUTHTEST_MAIN_DRIVER 38 | #define NO_AUTHTEST_MAIN_DRIVER 39 | 40 | #undef NO_APITEST_MAIN_DRIVER 41 | #define NO_APITEST_MAIN_DRIVER 42 | 43 | #undef NO_TESTSUITE_MAIN_DRIVER 44 | #define NO_TESTSUITE_MAIN_DRIVER 45 | 46 | #undef NO_UNITTEST_MAIN_DRIVER 47 | #define NO_UNITTEST_MAIN_DRIVER 48 | 49 | #undef NO_MAIN_DRIVER 50 | #define NO_MAIN_DRIVER 51 | 52 | #undef WS_NO_SIGNAL 53 | #define WS_NO_SIGNAL 54 | 55 | #undef WS_USE_TEST_BUFFERS 56 | #define WS_USE_TEST_BUFFERS 57 | 58 | #undef NO_WOLFSSL_DIR 59 | #define NO_WOLFSSL_DIR 60 | 61 | #undef WOLFSSH_NO_NONBLOCKING 62 | #define WOLFSSH_NO_NONBLOCKING 63 | 64 | #define DEFAULT_WINDOW_SZ (128 * 128) 65 | #define WOLFSSH_MAX_SFTP_RW 8192 66 | 67 | #ifdef __cplusplus 68 | } 69 | #endif 70 | 71 | #endif 72 | -------------------------------------------------------------------------------- /zephyr/samples/tests/wolfssh_user_settings_nofs.h: -------------------------------------------------------------------------------- 1 | /* user_settings.h 2 | * 3 | * Copyright (C) 2014-2024 wolfSSL Inc. 4 | * 5 | * This file is part of wolfSSH. 6 | * 7 | * wolfSSH is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * wolfSSH is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with wolfSSH. If not, see . 19 | */ 20 | 21 | #ifndef WOLFSSH_USER_SETTINGS_H 22 | #define WOLFSSH_USER_SETTINGS_H 23 | 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | #include 30 | 31 | #undef WOLFSSH_SCP 32 | #define WOLFSSH_SCP 33 | 34 | #undef NO_AUTHTEST_MAIN_DRIVER 35 | #define NO_AUTHTEST_MAIN_DRIVER 36 | 37 | #undef NO_APITEST_MAIN_DRIVER 38 | #define NO_APITEST_MAIN_DRIVER 39 | 40 | #undef NO_TESTSUITE_MAIN_DRIVER 41 | #define NO_TESTSUITE_MAIN_DRIVER 42 | 43 | #undef NO_UNITTEST_MAIN_DRIVER 44 | #define NO_UNITTEST_MAIN_DRIVER 45 | 46 | #undef NO_MAIN_DRIVER 47 | #define NO_MAIN_DRIVER 48 | 49 | #undef WS_NO_SIGNAL 50 | #define WS_NO_SIGNAL 51 | 52 | #undef WS_USE_TEST_BUFFERS 53 | #define WS_USE_TEST_BUFFERS 54 | 55 | #undef NO_WOLFSSL_DIR 56 | #define NO_WOLFSSL_DIR 57 | 58 | #undef WOLFSSH_NO_NONBLOCKING 59 | #define WOLFSSH_NO_NONBLOCKING 60 | 61 | #define DEFAULT_WINDOW_SZ (128 * 128) 62 | #define WOLFSSH_MAX_SFTP_RW 8192 63 | 64 | #undef NO_FILESYSTEM 65 | #define NO_FILESYSTEM 66 | 67 | #ifdef __cplusplus 68 | } 69 | #endif 70 | 71 | #endif 72 | --------------------------------------------------------------------------------