Hi there,

I have a simple question, does the wolfCrypt engine support the specific RSA signing padding scheme RSASSA-PKCS1-v1_5?

Background:
Nor in source code or documentation (ex. No information in section 10.5 PKC - 10.5.1 RSA or other parts of the manual) that I have seen, was there direction for what the exact signature scheme is when using functions such as:

wc_SignatureGenerate()

As there is only four types accepted (but three usable enums) in this function,
WC_SIGNATURE_TYPE_RSA and WC_SIGNATURE_TYPE_RSA_W_ENC are the only choices for RSA as opposed to using ECC. I don't need to encrypt the signature created, only verify it on my embedded target, therefore I am currently using WC_SIGNATURE_TYPE_RSA.

Maybe there is another function to use in the API or a #define for PSS or PKCS1-v1_5 padding - any insight on this matter is much appreciated!


Best Regards,

Dylan

Kaleb,

Thanks for the quick response.

Adding user_settings.h and removing options.h from my application fixed the compiler warnings.

I figured it out the linker errors, I had to ...

#define WOLFSSL_USER_IO

in my user settings, removing the default auto settings for IO functions. I'd assume by using these RSA functions, the application was looking for socket from network.h (from the macros RECV_FUNCTION and SEND_FUNCTION) for SSL/TLS usage.

Thanks for the great support Kaleb!

Best Regards,

Dylan

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