SSL_GET_PEER_TMP_KEY(3ossl)
π SSL_GET_PEER_TMP_KEY β bestie edition π
okay so this is the 3ossl page for the OpenSSL functions SSL_get_peer_tmp_key, SSL_get_server_tmp_key, and SSL_get_tmp_key β they're all about getting info on the temporary keys used during a handshake, and honestly? kind of iconic. let's get into it β¨
πΈ NAME πΈ
SSL_get_peer_tmp_key, SSL_get_server_tmp_key, SSL_get_tmp_key β get information about temporary keys used during a handshake π
β¨ SYNOPSIS β¨
#include <openssl/ssl.h>
long SSL_get_peer_tmp_key(SSL *ssl, EVP_PKEY **key);
long SSL_get_server_tmp_key(SSL *ssl, EVP_PKEY **key);
long SSL_get_tmp_key(SSL *ssl, EVP_PKEY **key);
π¦ DESCRIPTION π¦
So SSL_get_peer_tmp_key() hands you back the temporary key that the peer provided and that got used during key exchange. Like, for example, if ECDHE is in use, then this represents the peer's public ECDHE key. On success, a pointer to the key gets stored in *key.
π«Ά Heads up bestie: it is the caller's responsibility to free this key after use, using EVP_PKEY_free(3). Don't just leave it there, okay? no cap.
SSL_get_server_tmp_key() is a backwards compatibility alias for SSL_get_peer_tmp_key(). Under that name it worked just on the client side of the connection β and its behaviour on the server end is release-dependent (iykyk, it varies by release π).
SSL_get_tmp_key() returns the equivalent information, but for the local end of the connection. main character energy, but for your side of the wire π
π₯ RETURN VALUES π₯
All these functions return 1 on success and 0 otherwise. that's it, that's the vibe check β
π NOTES π
This function is implemented as a macro. (yes, really β don't come for me, that's just how it is π)
π SEE ALSO π
π COPYRIGHT π
Copyright 2017-2018 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at <https://www.openssl.org/source/license.html>.
aaand that's the whole page, bestie π this one's from OpenSSL 3.5.0, dated 2026-09-25 β go forth and free your EVP_PKEYs ππ¦β¨
π¦ where this page comes from
- opensuse-leap 16.0: openssl-3-doc 3.5.0-160000.11.1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms