On Wed, 2004-05-12 at 08:39, Patrick Coleman wrote:
> Hi,
> I'm a little confused as to how Diffie-Hellman works with openssl. Once the 
> key is generated, which part of the DH struct do you need to send to the 
> other party? I have tried printing dh->pub_key to a terminal, but all I got 
> was '0'. Is this normal? Is there a standard way of formatting such 
> information before it gets sent over the wire (or outputed to screen)?

The public key is a BIGNUM type.  I use the BN_bn2bin() function to
convert it to a binary buffer and then send that buffer to the other
side.  On the other side I use BN_bin2bn() to convert it back to a
BIGNUM type and put it back in the DH structure.


> Thanks in advance,
> Patrick

Troy


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

Reply via email to