Hi all!!
 
Thanks a lot for your answers!!! they were really useful !!!
Now I have another question..... Is there an OpenSSL function to perform a pure base64 (not PEM)  encoding of a buffer??
 
I've read in OpenSSL docs that the bio's filters could be useful but I made a little test and this fails.... next my code:
 
BIO *bio=NULL, *b64=NULL;
char mensaje[] = "Mensaje de Prueba base64\n";
char mensaje_b64[64];
int res;
 
int main (void) 
{
   OpenSSL_add_all_algorithms();
   OpenSSL_add_all_ciphers();
 
   b64 = BIO_new(BIO_f_base64()); 
   bio = BIO_new(BIO_s_mem());
   b64 = BIO_push(b64, bio);
 
   res = BIO_write (b64, mensaje, strlen(mensaje));
 
   res = BIO_read (bio, mensaje_b64, res);
   printf("%d\n%s\n",res,mensaje_b64);
}
 
res is always -1, so ... what do I'm making wrong???
 
Thanks a lot for your answers in advance!
Zainos



Do You Yahoo!?
Yahoo! Net: La mejor conexión a internet y 25MB extra a tu correo por $100 al mes.

Reply via email to