wolfSSL / wolfssh

wolfSSH is a small, fast, portable SSH implementation, including support for SCP and SFTP.
https://www.wolfssl.com
367 stars 88 forks source link

wolfssh_template / wolfssh_echoserver don't build #697

Closed keredson closed 3 months ago

keredson commented 3 months ago

to replicate:

$ idf.py --version
ESP-IDF v5.2.1
$ idf.py create-project-from-example "wolfssl/wolfssh^1.4.15-stable-preview6:wolfssh_template"
[...]
$ cd wolfssh_template/
$ idf.py build
[...]
/tmp/wolfssh_template/managed_components/wolfssl__wolfssl/wolfssl/wolfcrypt/port/Espressif/esp32-crypt.h:890:10: error: #error "ESP32_CRYPT_HASH_SHA256 not supported on wolfSSL at this time"
  890 |         #error "ESP32_CRYPT_HASH_SHA256 not supported on wolfSSL at this time"
      |          ^~~~~
ninja: build stopped: subcommand failed.

same error for wolfssh_echoserver. this is on an esp32.

keredson commented 3 months ago

workaround:

  1. move managed_components/wolfssl__wolfssl to components/wolfssl__wolfssl.
  2. in ./components/wolfssl__wolfssl/include/user_settings.h, add the following inside #if defined(CONFIG_IDF_TARGET_ESP32):
    #define NO_WOLFSSL_ESP32_CRYPT_HASH_SHA256

    this leads to a bunch of sha244 related build errors, so

  3. comment out #define WOLFSSL_SHA224 in that same file.

and it works.

embhorn commented 3 months ago

Hi @keredson

Thanks for this report. Could you tell us a bit about your project using wolfSSH?

I've requested a review of this issue by our engineers.

gojimmypi commented 3 months ago

Hi @keredson and @embhorn

I've been able to reproduce this problem. The issue was related to concurrent SHA HW/SW interleave calculations and fixed in post 5.7.0 release in https://github.com/wolfSSL/wolfssl/pull/7505.

As an interim solution:

# Optionally set your source to wolfSSL in your project CMakeLists.txt like this:
set(WOLFSSL_ROOT "/mnt/c/workspace/wolfssl-gojimmypi-pr" )

Set the WOLFSSL_ROOT to the fully qualified path of a local, fresh clone of wolfssl.

I will update the published wolfSSL Managed Component this week.

keredson commented 3 months ago

🎉

gojimmypi commented 3 months ago

Hi @keredson

I see you've already closed this issue. Not sure if perhaps you saw some of my work in progress at the Expressif Registry.

I've updated the published components as noted in https://github.com/wolfSSL/wolfssh/pull/699

wolfSSH: https://components.espressif.com/components/wolfssl/wolfssh/versions/1.4.17-preview1m5

and

wolfSSL: https://components.espressif.com/components/wolfssl/wolfssl/versions/5.7.1-preview2d?language=en

I believe the examples should be working much better now. Please take it for a test drive and let me know how it goes.

The updated (preview) echoserver can be found here:

https://components.espressif.com/components/wolfssl/wolfssh/versions/1.4.17-preview1m5/examples/wolfssh_echoserver

idf.py create-project-from-example "wolfssl/wolfssh^1.4.17-preview1m5:wolfssh_echoserver"

Thank you.