BIO_READ and BASE64 Decode

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

BIO_READ and BASE64 Decode

Adam Jones-2
I am trying to decode a base64 encoded string. There appears to be something wrong. The read tells me that I have read 21 which is correct, but my output buffer has nothing in it. Any suggestions on what is wrong with the code. Thanks in Advance!
 
int main
{
 
 char *sBase64[21]  // this variable contains the Base64 Encoded string
 int read=0;
 char *pOutBuff = 0;    // My output buffer

 b64 = BIO_new(BIO_f_base64());                    // create BIO filter
 bmem = BIO_new_mem_buf(sBase64, -1);      // create read only memory BIO to hold BASE64 encoded string
 bmem = BIO_push(bmem, b64);                    // chain memory BIO and BASE64 filter together
 read = BIO_read(bmem, &pOutBuff, 21);        // read string.
 BIO_flush(bmem);
 
BIO_free_all(bmem);
 
return 0;
}
Reply | Threaded
Open this post in threaded view
|

Re: BIO_READ and BASE64 Decode

Rich Salz
>  char *sBase64[21]  // this variable contains the Base64 Encoded string

That's not a char buffer.

I don't know what you're trying to do, but your code doesn't make
sense to me.

Did you see the sample code I posted the other day?

        /r$
--
Rich Salz                  Chief Security Architect
DataPower Technology       http://www.datapower.com
XS40 XML Security Gateway  http://www.datapower.com/products/xs40.html

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [hidden email]
Automated List Manager                           [hidden email]