[#SSL_SESSION_get_master_key]
= SSL&lowbar;SESSION&lowbar;get&lowbar;master&lowbar;key
:mrdocs:

Copy the session master secret into a caller buffer (sensitive&semi; avoid exposing)&period;

== Synopsis

Declared in `&lt;openssl&sol;ssl&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
size&lowbar;t
SSL&lowbar;SESSION&lowbar;get&lowbar;master&lowbar;key(
    xref:SSL_SESSION.adoc[SSL&lowbar;SESSION] const* sess,
    unsigned char* out,
    size&lowbar;t outlen);
----

== Return Value

Number of bytes copied, or the full master&hyphen;secret length when `outlen` is 0&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *sess*
| Session whose master key is read&period;
| *out*
| Buffer that receives up to `outlen` bytes of the master secret&semi; ignored if `outlen` is 0&period;
| *outlen*
| Capacity of `out,` or 0 to query the master&hyphen;secret length only&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
