Edward Chan <[EMAIL PROTECTED]> wrote:

> But I think this always returned me 128 bytes.  So am I supposed to
> bzero the output buffer first?

Here's how I fixed the bug (not very elegant, it was a quick hack)


    int i, ret = DH_compute_key(secret, pkey, m_dh);
    if( ret > 0 && ret < 128 )
    {
        for(i = ret; i >= 0; i--)
            secret[i+1] = secret[i];

        memset(secret, 0, 128 - ret);
    }
    ReverseBytes(secret, size);


Christophe

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

Reply via email to