I recommend using a master key that is easier to access. As far as I know, the pre-master key only exists ephemerally on the stack in OpenSSL. The master key is available in ssl_session_st (defined in ssl.h in the 1.0.2 branch, but ported to ssl_locl.h in a later version). The SSL member session element is a pointer to its ssl_session_st (aka SSL_SESSION ).
Wireshark can use a master key as well as a preliminary master key to decrypt connections. Here are the formats that Wireshark supports at the time of this writing:
RSA xxxx yyyy Where xxxx is the first 8 bytes of the encrypted pre-master secret (with hexadecimal encoding) Where yyyy is the pre-master secret key (hex-encoded) (this is the original format entered with error 4349)
RSA Session-ID:xxxx Master-Key:yyyy where xxxx is the SSL session identifier (with hexadecimal encoding) that nothing specific rsa about it.
PMS_CLIENT_RANDOM xxxx yyyy Where xxxx is the client_random from ClientHello (with hexadecimal encoding) Where yyyy is the secret key pre-master (hex-encoded) (This format allows you to decrypt SSL connections if the user can capture the ICP but cannot recover the MS for a specific session with the SSL server.)
CLIENT_RANDOM xxxx yyyy Where xxxx is the client_random from ClientHello (with hexadecimal encoding) Where yyyy is the secret plaintext key (with hexadecimal encoding) (This format allows you to decrypt SSL connections without RSA, i.e. ECDHE-RSA.)
Note that neither the primary key nor the primary key is a symmetric key (the title of the question implies that you might think that it is). The symmetric key is derived from the master key and random client / server data.
source share