1 (edited by whloo 2021-11-18 15:47:32)

Topic: building wolfEngine (stuck on wolfssl) on Windows 10

Hi all,

I'm trying to build wolfEngine (https://github.com/wolfSSL/wolfEngine#b … on-windows) on Windows, and I've been running into some compilation issues. I will try to be as detailed as possible, in case I didn't configure something simple correctly; all terminal output I'm showing is using bash, unless otherwise stated.

Windows specification:
Edition    Windows 10 Pro
Version    21H2
Installed on    5/22/2020
OS build    19044.1348
Experience    Windows Feature Experience Pack 120.2212.3920.0

In my project folder, I have to following to mirror the expected directory structure

$ ls
openssl  wolfEngine  wolfssl

The openssl folder contains the source code for openssl version 1.1.1l (L).
wolfssl source folder is on master branch (commit c80e63a822c0080fa0f368d357551be6eb48c956)

I call the following using "x64 Native Tools Command Prompt for VS 2019", while in  the openssl folder, and following the OpenSSL section (https://github.com/wolfSSL/wolfEngine#openssl-1):

> perl Configure VC-WIN64A
[Configure output ...]
> nmake clean
[clean output ...]
> nmake
[compilation output ...]

So far so good, now I try building wolfSSL (https://github.com/wolfSSL/wolfEngine#wolfssl-1). I open the wolfssl64.sln in Visual Studio 2019 Community (Version 16.11.6), From here, things get a little out of hand with the number of build errors that pop up.

- building the solution without modifying user_settings.h:
    - 18 errors, most prevalent being:
    4>wolfssl.lib(ssl.obj) : error LNK2001: unresolved external symbol _wc_PRF
    4>wolfssl.lib(tls.obj) : error LNK2001: unresolved external symbol _wc_PRF_TLS
    fatal error LNK1120: 2 unresolved externals
- building solution after adding defines specified in README to user_settings.h:
    - a ton more errors pop-up numbering in the hundreds; among them, syntax errors and complaints of undefined identifiers, structs, etc. Excel file provided with the full list of errors from Visual Studio.

Any assistance in potentially reproducing my situation, and some advice on things to try to get it built would be greatly appreciated! The ultimate goal is to also build wolfEngine and make sure the tests work on windows.

Post's attachments

wolfssl64sln_visualstudio_errors.xlsx 15.31 kb, 2 downloads since 2021-11-18 

You don't have the permssions to download the attachments of this post.

Share

Re: building wolfEngine (stuck on wolfssl) on Windows 10

Hi whloo,

Thanks for your detailed message. As a first step, I suggest we try to get wolfssl64.sln building without touching user_settings.h, as you initially tried. I'm not able to reproduce the errors you're encountering, unfortunately. Can you send me your user_settings.h? I want to make sure it's identical to mine. I would also suggest you start from scratch, download wolfSSL 5.0.0 from here https://github.com/wolfSSL/wolfssl/rele … .0-stable, and rebuild the wolfssl64 solution.

Thanks,

Hayden Roche
wolfSSL Software Engineer

Share

Re: building wolfEngine (stuck on wolfssl) on Windows 10

Hi Hayden,

Thanks for your reply; I started from scratch with wolfssl version 5.0.0: it yields a successful build of wolfssl64.sln overall (no user_settings.h changes)

Now if I proceed with building wolfEngine.sln, the wolfEngine component appears to build properly, but the test component fails with 22 unresolved external symbols; looking through the wolfssl source code, in the unresolved symbols appear to stem from certain defines not being specified in wolfssl's user_settings.h.

On the other end of the spectrum, if I add all the defines to user_settings.h as specified in the wolfEngine readme, wolfssl build fails with many errors, as described in my last post. Commenting out

#define OPENSSL_COEXIST

makes the build pass again. If I carry over from this successful build to try building the wolfEngine solution, wolfEngine builds, but the test project fails with less errors than before (pasting here since it seems I'm only allowed one attachment per post):

Severity    Code    Description    Project    File    Line
Error    LNK2019    unresolved external symbol wc_Dh_ffdhe2048_Get referenced in function we_dh_pkey_ctrl_str    test    wolfEngine\test\wolfEngine.lib(we_dh.obj)    1
Error    LNK2019    unresolved external symbol wc_Dh_ffdhe3072_Get referenced in function we_dh_pkey_ctrl_str    test    wolfEngine\test\wolfEngine.lib(we_dh.obj)    1
Error    LNK2019    unresolved external symbol wc_Dh_ffdhe4096_Get referenced in function we_dh_pkey_ctrl_str    test    wolfEngine\test\wolfEngine.lib(we_dh.obj)    1
Error    LNK1120    3 unresolved externals    test    wolfEngine\x64\Debug\test.exe    1

Also attached is my user_settings.h for wolfssl, with the single define commented out.

Currently under the assumption that the wolfEngine test project not building is always an indication that something was configured incorrectly, at the very least.

Post's attachments

user_settings.h 3.55 kb, 2 downloads since 2021-11-19 

You don't have the permssions to download the attachments of this post.

Share

Re: building wolfEngine (stuck on wolfssl) on Windows 10

Hi whloo,

I've modified the user_settings.h you sent and attached it here. You need to remove all defines that aren't mentioned in README.md. Please let me know if this helps resolve the issues you're seeing.

Thanks!

Hayden

Share

5 (edited by hayden 2021-11-29 17:03:14)

Re: building wolfEngine (stuck on wolfssl) on Windows 10

Forgot the attachment!

Post's attachments

user_settings.h 1.58 kb, 3 downloads since 2021-11-30 

You don't have the permssions to download the attachments of this post.

Share

Re: building wolfEngine (stuck on wolfssl) on Windows 10

Hi Hayden,

Thanks for you help, the attached header works great for getting wolfssl and wolfEngine to build. However, I did have to make one slight tweak and add the following:

#define HAVE_PUBLIC_FFDHE

otherwise one unresolved reference would pop up.

The test suite for wolfssl works fine; the test suite for wolfEngine almost works (after installing the wolfEngine DLL in the OpenSSL engines folder); all tests pass except the very first test: did some digging in the test source code (test_logging.c), but I'm really not sure what could be the cause of the error. Test output provided below, isolated to only the failing test:

$ ./test.exe 1
Run test case: 1

Running tests using dynamic engine.
wolfEngine Leaving wolfengine_ctrl, return 1
wolfEngine Entering we_ciphers
wolfEngine Leaving we_ciphers, return 12
wolfEngine Entering we_digests
wolfEngine Leaving we_digests, return 6
wolfEngine Entering we_pkey
Returning 11 supported public key NIDs
wolfEngine Leaving we_pkey, return 11
Found engine rdrand : Intel RDRAND engine
Found engine dynamic : Dynamic engine loading support
Found engine wolfEngine : An engine using wolfSSL
wolfEngine Entering wolfengine_ctrl
wolfEngine Leaving wolfengine_ctrl, return 1
###### TESTSUITE START

#### Start: 1 - test_logging
MSG: Enable debug logging
wolfEngine Entering wolfengine_ctrl
wolfEngine Leaving wolfengine_ctrl, return 1
MSG: Set logging level
wolfEngine Entering wolfengine_ctrl
MSG: Set logging callback
MSG: Disable debug logging
MSG: Enable debug logging, test setting log level to 0
MSG: Testing setting log component levels
ERR: Failed to set only WE_LOG_ENGINE component log
wolfEngine user logging callback registered
#### FAILED: 1 - test_logging

## FAIL: 1: test_logging
###### TESTSUITE FAILED
Returning 11 supported public key NIDs

Can you provide any guidance on possible solutions, and/or comment on the importance of this specific test failure?

Thanks again for your help!

Share

Re: building wolfEngine (stuck on wolfssl) on Windows 10

Hi whloo,

I think there are some differences between the way you and I are building and running the tests. I'm not copying the wolfEngine DLL anywhere. In Visual Studio, you should be able to right click on the "test" project in the wolfEngine solution, go to Debug, and select "Start New Instance." That launches the test program, and all tests pass for me. This is using the wolfEngine and wolfSSL master branches and OpenSSL 1.1.1b.

I'm attaching my updated user_settings.h files for wolfSSL and wolfEngine, respectively, just to make sure we're on the same page. My apologies for leaving out HAVE_PUBLIC_FFDHE earlier!

Thanks,

Hayden

Post's attachments

user_settings_wolfssl.h 1.66 kb, 2 downloads since 2021-12-03 

You don't have the permssions to download the attachments of this post.

Share

Re: building wolfEngine (stuck on wolfssl) on Windows 10

And the wolfEngine user_settings.h.

Post's attachments

user_settings_wolfengine.h 2.4 kb, 2 downloads since 2021-12-03 

You don't have the permssions to download the attachments of this post.

Share

Re: building wolfEngine (stuck on wolfssl) on Windows 10

Hi Hayden,

Thanks again for all your help! Everything builds and tests all pass now!

Share

Re: building wolfEngine (stuck on wolfssl) on Windows 10

Hi whloo,

That's great! I'm glad you're up and running now.

Would you mind sharing a bit about the project you're working on with wolfEngine? We're always interested to see how our products are being used in the wild.

Thanks,

Hayden

Share

Re: building wolfEngine (stuck on wolfssl) on Windows 10

Hi Hayden,

Unfortunately, I can't say much besides the fact that we're trying use wolfEngine to replace an existing openssl native engine solution for what we're working on, for certain compliance purposes. Someone else from my group has been in contact with your company.

Share

Re: building wolfEngine (stuck on wolfssl) on Windows 10

Hi whloo,

Understood! No worries. In the future, if you would like to discuss support questions in a private channel, please email support@wolfssl.com. You're likely to get a faster response there, too. smile

Thanks,

Hayden

Share

13 (edited by asigrijenny 2023-01-02 13:20:20)

Re: building wolfEngine (stuck on wolfssl) on Windows 10

Hello! How did you solve your issue? I’m new to wolf Engine and also experience some similar issues. The reason might be that I didn’t set the right configurations, but the large number of files is overwhelming me and I’m not sure what exactly to do next. I’m using OpenSSL, and I think that either the configuration file is not supported or I made a mistake and I’m stuck. I’ve looked at other forums, but I’m overwhelmed with the instruction, because I have little knowledge with this engine. Maybe I should try another version of wolfSSL. I purchased a windows 10 reddit key recently, and I’m wondering if that can also affect the performance of wolf Engine.

Share

Re: building wolfEngine (stuck on wolfssl) on Windows 10

Hi asigrijenny,

Welcome to the forums. The solution was posted here:
https://www.wolfssl.com/forums/post6393.html#p6393

Thanks,
Eric - wolfSSL Support