Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wolfssh_echoserver Example Fails to Compile Due to wc_SSH_KDF Implicit Declaration #781

Open
clutch2sft opened this issue Feb 19, 2025 · 4 comments
Assignees

Comments

@clutch2sft
Copy link

When compiling the wolfssh_echoserver example located at wolfssh/ide/Espressif/ESP-IDF/examples/wolfssh_echoserver, the build fails with the following error:

~/wolfssh/src/internal.c: In function 'GenerateKey':
~/wolfssh/src/internal.c:2215:15: error: implicit declaration of function 'wc_SSH_KDF'; did you mean 'wc_HKDF'? [-Wimplicit-function-declaration]
 2215 |         ret = wc_SSH_KDF(hashId, keyId, key, keySz,
      |               ^~~~~~~~~~
      |               wc_HKDF

t appears that wc_SSH_KDF is conditionally compiled behind a feature flag. The only workaround I found was to add the following definition in components/wolfssl/include/user_settings.h:

#define WOLFSSL_WOLFSSH

Steps to Reproduce:

Clone the repository.
Navigate to wolfssh/ide/Espressif/ESP-IDF/examples/wolfssh_echoserver.
Attempt to build the example using ESP-IDF.
Observe the compile error in wolfssh/src/internal.c regarding wc_SSH_KDF.
Observed Behavior:
The build fails because wc_SSH_KDF is implicitly declared, suggesting that the corresponding feature is not enabled by default.

Expected Behavior:
The example should compile out-of-the-box without requiring manual modifications. If enabling the SSH functionality via a flag like WOLFSSL_WOLFSSH is intended, the documentation should clearly state this requirement.

Potential Workaround:
Adding the following line in components/wolfssl/include/user_settings.h resolves the compilation error:

#define WOLFSSL_WOLFSSH

Request for Clarification/Action:

Could the maintainers confirm if this is the intended configuration for building the wolfssh_echoserver example?
If so, would it be possible to update the documentation or the build configuration to automatically define WOLFSSL_WOLFSSH for this example?
Alternatively, if there is another configuration method intended for this setup, please provide guidance on how to correctly enable the feature.
Thank you for your time and consideration. I’m happy to help further if needed!

@LinuxJedi
Copy link
Member

@gojimmypi can you please take a look at this?

@gojimmypi
Copy link
Contributor

Hi @clutch2sft and thanks for your interest in wolfSSH as a Managed Component!

Sorry that you've had a difficult time. You are absolutely correct that things need to be improved. I've been working on this and have things nearly finished.

The WOLFSSL_WOLFSSH does need to be defined. See this line of my updated user_settings.h.

I've been struggling with some of the issues related to Staging Components and inter-component dependencies to test before actually publishing releases to the wolfSSL Managed Components. See related:

The TL;DR is that the component manager needs to be kept updated:

pip install -U idf-component-manager

With those updates, staging components now work slightly differently than before. If you'd like to take the wolfSSH Managed Component for a test drive, see my 1.4.18-preview1r echo server example . Be sure to set the IDF_COMPONENT_REGISTRY_URL value:

export IDF_COMPONENT_REGISTRY_URL=https://components-staging.espressif.com

I'm very close to finishing this up. I have a Getting Started with wolfSSL Using Visual Studio 2022 webinar that I am preparing for this morning, (Feb 19, 10AM Pacific; hope you can attend!) and this wolfSSH is the next item on my agenda.

@clutch2sft
Copy link
Author

@gojimmypi
Thank you for such a detailed response. I'm glad you're on top of these things. As for now I had given up on managed component (though I am in love with the idea of a managed component) as I wasn't moving my toward my objective fast enough with that.

The staging thing is interesting I'll keep an eye on that - I'm just learning my way around this esp platform at the same time I'm learning my way around the wolfssl/ssh components. Happy to circle back and test it as time permits! With the of WOLFSSL_WOLFSSH I am able to keep my own project going forward, well that and the fix I put in the directory search stuff.

Again truly apricate the thoughtful response and your work. I'm not married to my fixes making it into production on the repo but I like to share the information incase it is helpful since so much effort is put out on your parts.

@gojimmypi
Copy link
Contributor

Hi @clutch2sft - As noted in the related #782, I've updated the Managed Components for wolfSSL to v5.7.6 and for wolfSSH to 1.4.18.

The wolfssh_echoserver example works for me, tested on ESP-IDF v5.2. I was hoping you could take it for a test drive and confirm before I upgrade the wolfSSH library to the latest release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants