The problem is likely to be here:
FILE *test = NULL;
//int len=RSA_size(rsa) - 11; /********* Giving Core Dump Always *******/
Since RSA_size requires a pointer to an RSA, handing it a null, will probably give a memory access violation, triggering a core dump.
Try handing it a pointer to an actual RSA object!
Typo, I missed the "_size" off "RSA_size" - OriginalGriff[/edit]
I have modified like this
int len = RSA_size(rsa);
But still gives coredump message as "in BN_num_bits()". Don't know from where its referring this . Any clue ????"
Yes - read what I said.
rsa is a variable, which holds a pointer to an RSA object.
You do not assign a valid RSA object to the rsa variable.
When RSA_Size tries to use the RSA object you hand it the pointer of, it accesses the wrong memory.
Would you expect this to work?
*i = 6;
Or should it be this?
i = &j;
*i = 6;