> char* hex = "0000";
> BN_hex2bn(&bignum, hex);
> buffer = (char*)malloc(2);
> BN_bn2bin(bignum, buffer);
> 
> 
> wont' do the same thing as
> 
> buffer = (char*) malloc(2);
> memset(buffer, 0, 2);


No, how would it?  How does BN_bn2bin() know that
buffer is 2 bytes?  There's no way for the function
to know how many bytes your buffer is.  Infact,
since BN_num_bytes() returns 0, the buffer you pass
it won't ever even be touched, so no data will be set.

-Brad
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [email protected]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to