SSL_COPY_SESSION_ID(3)

πŸ“¦ version 4.1.0, in opensuse-leap 16.0

πŸ’… SSL_COPY_SESSION_ID(3) β€” Library Functions Manual πŸ’…

✨ NAME ✨

SSL_copy_session_id β€” okay so this is the little function that copies session details between SSL objects, periodt.

🌸 SYNOPSIS 🌸

#include <openssl/ssl.h>

int
SSL_copy_session_id(SSL *to, const SSL *from);

πŸ¦‹ DESCRIPTION πŸ¦‹

SSL_copy_session_id() is giving β€œclone the session-ish bits from one SSL object into another.” It copies the following data from from to to:

  • the pointer to the SSL_SESSION object β€” and its reference count gets incremented by 1, no cap
  • the pointer to the SSL_METHOD object; if that changes the method, protocol-specific data is reinitialized
  • the pointer to the CERT object β€” reference count incremented by 1 too, slay
  • the session ID context

Fun fact iykyk: this function is used internally by SSL_dup(3) and by BIO_ssl_copy_session_id(3).

πŸŽ€ RETURN VALUES πŸŽ€

SSL_copy_session_id() returns 1 on success and 0 on error. That’s it, bestie.

🌈 SEE ALSO 🌈

πŸ‘‘ HISTORY πŸ‘‘

SSL_copy_session_id() appeared in SSLeay 0.4 or earlier and has been available since OpenBSD 2.4. lowkey iconic longevity.

πŸ’€ BUGS πŸ’€

okay so this is the sketchy part: failures of CRYPTO_add(3) are silently ignored and may leave to in an invalid or inconsistent state. not the vibe.

source/version + date sign-off: source/version: Debian Β· date: June 12, 2019 Β· page name: SSL_COPY_SESSION_ID(3) πŸ’–πŸ«Ά

πŸ“¦ where this page comes from