OpenSSL compilation errors in Windows

Matt Caswell matt at
Mon Oct 21 21:26:32 UTC 2019

On 20/10/2019 08:43, Nagalakshmi V J wrote:
> Hi Matt,
> This link is having few APIS. But for getting master_key_length, I don't
> find any API. Not sure if we need to use getMasterKey API for that.

You can use SSL_SESSION_get_master_key() for this.

Note this comment in the RETURN VALUES section:

"For the other functions, if outlen is greater than 0 then these
functions return the number of bytes actually copied, which will be less
than or equal to outlen. If outlen is 0 then these functions return the
maximum number of bytes they would copy -- that is, the length of the
underlying field."

So to discover the master_key_length call the function with outlen to
zero. You can then allocate an appropriate sized buffer and call the
function again in order to get the actual master key.


> I will try to use these APIs and get back.
> Thanks & Regards,
> Nagalakshmi V J
> ------------------------------------------------------------------------
> *From:* Matt Caswell <matt at>
> *Sent:* 18 October 2019 14:48:33
> *To:* Nagalakshmi V J <nagalakshmi.j at>;
> openssl-users at <openssl-users at>
> *Subject:* Re: OpenSSL compilation errors in Windows
> ** This mail has been sent from an external source **
> On 18/10/2019 11:49, Nagalakshmi V J wrote:
>> Now the issue is SSL_session structure is also having accessor APIs
>> which I am not aware of. So I need to get the APIs for accessing the
>> master_key_length,etc.. given in the above code. Those are not listed
>> in the openssl link referred.
> On this page look a the various functions beginning with "SSL_SESSION_"
> in the name:
> From the code sample you gave you are probably mostly interested in the
> functions on this page:
> Matt
> =====================================================
> Please refer to
> for important disclosures regarding this electronic communication.
> =====================================================

More information about the openssl-users mailing list