Author: d-fand-fan
Date: May 20, 2008 14:24
void decodebio( unsigned char *encbuf, unsigned char * decbuf, int
destbuf ) {
/* Read Base64 encoded data from standard input and write the
decoded data to standard output: */
BIO *b64, *bio ;
long i ;
char buffer[512] ;
memset(buffer, 0, 512) ;
b64 = BIO_new(BIO_f_base64() ) ;
bio = BIO_new(BIO_s_mem()) ;
i=BIO_write(bio, encbuf, strlen(encbuf)) ;
bio = BIO_push(b64, bio) ;
//i = BIO_ctrl_pending(bio);
i = BIO_read(bio, decbuf, 1024) ;
printf( "the old buffer size is %%d %%d\n\r", i, strlen(decbuf)) ;
|