I'm trying to get the Keygen function of CyaSSL to work using the example in section 7.7 from here: http://www.yassl.com/yaSSL/Docs-cyassl-manual-7-keys-and-certificates.html
I'm using CyaSSL 3.2.0 with the --enable-keygen option, but couldn't get it working with 3.1.0 either.
This is the code:
#include <stdio.h>
#include <cyassl/ctaocrypt/asn.h>
#include <cyassl/ctaocrypt/rsa.h>
int main() {
RsaKey genKey;
RNG rng;
int ret;
printf("%d\n",InitRng(&rng));
printf("%d\n",InitRsaKey(&genKey, 0));
ret = MakeRsaKey(&genKey, 1024, 65537, &rng);
printf("ret: %d\n",ret);
return 0;
}
I get a segmentation fault in the line with InitRsaKey, presumably because of an invalid write or something.
Anyone got an idea where my issue may be? Any help is appreciated