BIO *mbio, *b64bio, *bio;

        mbio = BIO_new(BIO_s_mem());
        b64bio = BIO_new(BIO_f_base64());
        bio = BIO_push(b64bio, mbio);
        int bytes_stored = i2d_PKCS12_bio(bio, p12);
        BIO_flush(mbio2);

        BIO_get_mem_data(mbio, (unsigned char *)&p12_data_tmp); 
        p12_data = (unsigned char*)OPENSSL_malloc(bytes_stored + 1);
        strncpy(p12_data, p12_data_tmp, bytes_stored);
        p12_data[bytes_stored] = '\0';


bytes_stored gives me 4030 bytes, but, when I try to print or save the
p12_data, I am able to get only 3000 bytes and the program stops.
What am I doing wrong?

Thanks in advance
--Smith
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to