The problem is likely to be here:
RSA* rsa=NULL;
FILE *test = NULL;
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!
[edit]Typo, I missed the "_size" off "RSA_size" - OriginalGriff[/edit]
"Hi ,
I have modified like this
RSA *rsa;
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?
int *i;
*i = 6;
Or should it be this?
int *i;
int j;
i = &j;
*i = 6;