Topic: [SOLVED] Undefined RSA functions from wolfssl.lib
Hello,
Firstly, I am having a blast working with your library (even though nothing is working yet) - kudos!
Anyways, I have created a user_setting.h file (defined WOLFSSL_USER_SETTINGS in <IDE\WIN\user_settings.h>)with intentions of creating a code singing scheme eventually, but for now, my app is just trying to create a file and dump the generated key-pair in the file. I have been following the 'signature' example in your GitHub (I do need a plaintext file since when the future embedded target needs both keys)... The following settings are enabled:
#define NO_DES3
#define NO_DSA
#define NO_MD4
#define NO_RC4
#define NO_RABBIT
#define NO_HC128
#define NO_SESSION_CACHE
#undef NO_PSK
#define NO_PSK
#define WOLFSSL_KEY_GEN
#define SINGLE_THREADED
I have built wolfSSL with these settings and that is fine - wolfssl.lib sits at 4.3 Mb (a little too big but not the concern right now).
I think I have linked the wolfssl.lib in my application in Visual Studio as I normally would do correctly (very basic stuff) while including the necessary headers in my app code:
#include <stdio.h>
#include <wolfssl/options.h>
#include <wolfssl/ssl.h>
#include <wolfssl/wolfcrypt/random.h>
#include <wolfssl/wolfcrypt/rsa.h>
#include <wolfssl/wolfcrypt/types.h>
The problems start arising when I compile my app and see the following warnings in the log:
...
c:\wolfssl\test_apps\src\genkeyfiles.c(123): warning C4013: 'wc_MakeRsaKey' undefined; assuming extern returning int
c:\wolfssl\test_apps\src\genkeyfiles.c(134): warning C4013: 'wc_RsaKeyToDer' undefined; assuming extern returning int
c:\wolfssl\test_apps\src\genkeyfiles.c(149): warning C4013: 'wc_RsaKeyToPublicDer' undefined; assuming extern returning int
So it looks as if my app can't find the definitions of these functions but sees the declaration in the headers provided, and I didn't turn off anything that RSA needs from my settings (I think?).
Note: I have tried building my app with default settings and the same warnings about 'warning C4013: 'wc_RsaXxxXxx' undefined still occurs.
When build, the linker has errors (expected since the .exe I am trying to create can't find the essential RSA functions):
wolfssl.lib(wolfio.obj) : error LNK2019: unresolved external symbol __imp__recv@16 referenced in function _wolfIO_Recv
wolfssl.lib(wolfio.obj) : error LNK2019: unresolved external symbol __imp__send@16 referenced in function _wolfIO_Send
wolfssl.lib(wolfio.obj) : error LNK2019: unresolved external symbol __imp__WSAGetLastError@0 referenced in function _LastError
Any insight on why the compiler can't find these functions: wc_MakeRsaKey, wc_RsaKeyToDer, & wc_RsaKeyToPublicDer would be greatly appreciated!
Thanks and Regards,
Dylan