Varun
unread,Jun 8, 2012, 8:42:07 AM6/8/12You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
Team,
I am actually confused between the use cases for the above two macros?
I see, sometimes one works well, and sometimes the other, but I am not able to figure out when to prefer one over other. FOr now, I try one, and if doesn't work out, I try using other.
For isntance, I have X509 *ptr= NULL;
Once I have ptr valid and everything's done, I wanted to store this as char *(PEM formatted string).
therefore i used the following code
BIO *b = NULL;
char buff[2000] ={0,};
int len = 0;
b = BIO_new(BIO_s_mem());
PEM_write_bio_X509(b, ptr);
len = BIO_get_mem_data(b, &buff);
for (c =0; c < len; c++) printf(%c", buff[c]);
The output of this is weird and I didn't understand what was it,
anyway, when I replaced BIO_get_mem_data with BIO_get_mem_ptr, things worked out fine.
Any clarification, why one works here and other fails?
PS: Openssl didn't give any error in both cases, so both cases all API's were successful.