Topic: Linker errors

I am currently working on a wrapper using wolfcrpypt, and im running into a a couple of problems and im not sure why.

1. I have wolfssl/wolfcrypt/Blake2B.h included, and i have the wolfssl static lib i compiled from the solution provided with the wolfssl download, and i am getting linker errors saying that the Init, Update, & Final Blake2B hashing funcs are unresolved.

https://puu.sh/F9nFx/6485c5e1c0.png

2. Even though I have Blake2B.h included, I have to define HAVE_BLAKE2 and HAVE_BLAKE2B otherwise the functions wc_InitBlake2b, wc_Blake2bUpdate, and wc_Blake2bFinal are undefined,is this intentional? Because for MD4/5 and SHA/SHA256 I dont have to define anything for the funcs defined in the header to be recognized by VS, however with SHA224/SHA384/SHA512 and Blake2B/Blake2S I have to define the associated preprocessor definitions otherwise the functions are undefined when trying to call them

https://puu.sh/F9nFe/9f6a15ebe5.png

Share

Re: Linker errors

@ThaPrintz,

Thank you so much for reaching out with your questions.

Please try adding the settings to a custom user_settings.h and globally define WOLFSSL_USER_SETTINGS. At the application level you need to always include the <wolfssl/wolfcrypt/settings.h> before any other wolfSSL headers.

All other custom settings like user_settings.h should be included inside wolfssl/wolfcrypt/settings.h. user_settings.h is included in wolfssl/wolfcrypt/settings.h when WOLFSSL_USER_SETTINGS is defined globally.

Regards,

K

3 (edited by ThaPrintz 2020-02-13 03:25:22)

Re: Linker errors

Kaleb J. Himes wrote:

@ThaPrintz,

Thank you so much for reaching out with your questions.

Please try adding the settings to a custom user_settings.h and globally define WOLFSSL_USER_SETTINGS. At the application level you need to always include the <wolfssl/wolfcrypt/settings.h> before any other wolfSSL headers.

All other custom settings like user_settings.h should be included inside wolfssl/wolfcrypt/settings.h. user_settings.h is included in wolfssl/wolfcrypt/settings.h when WOLFSSL_USER_SETTINGS is defined globally.

Regards,

K

Kaleb,

Thanks for you response, however i do have WOLFSSL_USER_SETTINS globally defined, and i do have user_settings.h (this is where all my HAVE_MD2, HAVE_SHA256, etc etc are located).

I still get linker errors for:

  • MD2

  • Blake2B/S

  • poly1305

  • Camellia

  • HC128

  • ChaCha

  • RSA

All of the other cryptographic methods compile fine with no linker errors

Share

Re: Linker errors

ThaPrintz,

There are some features that are default enabled and to turn them off you use a setting like NO_<FEATURE> IE NO_MD5. There are other features that are default disabled and need to be specifically turned on with HAVE_<FEATURE> or WOLFSSL_<FEATURE> for example HAVE_ECC or WOLFSSL_SHA512. Chapter 2 of the wolfSSL manual goes over these in detail, here is a link: https://www.wolfssl.com/documentation/w … Manual.pdf

Please see 2.4.4 Enabling Features Disabled by Default.

Warm Regards,

K

Re: Linker errors

So I recompiled with the preprocessors you mentioned, and everything seems to be working. However I am running into 1 issue, when trying to use HMAC
https://puu.sh/FecMr/d56db298ed.png

I am getting these linker errors, and I have WOLFSSL_SHA3, WOLFSSL_SHA512 both defined, any ideas?

Share

Re: Linker errors

ThePrintz,

You need to specify WOLFSSL_SHA3 also notice those are not sha512 or sha384 only those are sha3-384 and sha3-512. Sha3 is the final version NIST adopted based on Keccak which won the sha3 contest.

Warm Regards,

K

Re: Linker errors

https://puu.sh/FeA8G/c9779785fc.png

This is my user_settings file that wolfssl.lib is compiled with, and I am still getting these linker errors

Share

Re: Linker errors

Can you double check that the source file wolfcrypt/src/sha3.c is in the Makefile?

- K