SSL_GET_PEER_TMP_KEY(3ossl)
π SSL_GET_PEER_TMP_KEY π
okay bestie, welcome to the 3ossl corner of the manual-verse β¨ this one's all about peeking at the lil' temporary keys your connection is out here using during a handshake. not the long-term identity keys, the ephemeral ones β the ones that get made, used, and yeeted. very demure, very forward-secret. π¦
πΈ 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 β¨
SSL_get_peer_tmp_key() β okay so this one hands you the temporary key that the peer gave you, the one that got used during key exchange. like, if ECDHE is what's happening, then this is literally the peer's public ECDHE key. π
on success it drops a pointer to the key into *key. and bestie, listen: it is the caller's responsibility to free that key after use, using EVP_PKEY_free(3). no cap. you own it now. free it. π«Ά
SSL_get_server_tmp_key() β this one is a backwards compatibility alias for SSL_get_peer_tmp_key(). back in the day under that name it only worked on the client side of the connection, and its behaviour on the server end is release-dependent. so likeβ¦ vintage behaviour, y2k energy, handle with care. π
SSL_get_tmp_key() β same vibe, but for the local end of the connection. it's giving "the equivalent information, but for you." π
π₯ RETURN VALUES π₯
all three of these return 1 on success and 0 otherwise. that's it. binary. slay. β
π NOTES π
this function is implemented as a macro. yes, a macro. so don't go trying to take its address or whatever, iykyk. π
π 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>.
and that's the whole page, bestie π§ this was OpenSSL 3.5.9, dated 2026-09-29, and it lives under the name SSL_GET_PEER_TMP_KEY(3ossl). go forth and free your EVP_PKEYs. ππβ¨
π¦ where this page comes from
- fedora 43: openssl-devel 1:3.5.9-1.fc43 Β· Apache-2.0
- fedora 43: openssl-devel 1:3.5.9-1.fc43 Β· Apache-2.0
- fedora 44: openssl-devel 1:3.5.9-1.fc44 Β· Apache-2.0
- fedora 44: openssl-devel 1:3.5.9-1.fc44 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms