|
Packit Service |
084de1 |
=pod
|
|
Packit Service |
084de1 |
|
|
Packit Service |
084de1 |
=head1 NAME
|
|
Packit Service |
084de1 |
|
|
Packit Service |
084de1 |
SSL_SESSION_new,
|
|
Packit Service |
084de1 |
SSL_SESSION_dup,
|
|
Packit Service |
084de1 |
SSL_SESSION_up_ref,
|
|
Packit Service |
084de1 |
SSL_SESSION_free - create, free and manage SSL_SESSION structures
|
|
Packit Service |
084de1 |
|
|
Packit Service |
084de1 |
=head1 SYNOPSIS
|
|
Packit Service |
084de1 |
|
|
Packit Service |
084de1 |
#include <openssl/ssl.h>
|
|
Packit Service |
084de1 |
|
|
Packit Service |
084de1 |
SSL_SESSION *SSL_SESSION_new(void);
|
|
Packit Service |
084de1 |
SSL_SESSION *SSL_SESSION_dup(SSL_SESSION *src);
|
|
Packit Service |
084de1 |
int SSL_SESSION_up_ref(SSL_SESSION *ses);
|
|
Packit Service |
084de1 |
void SSL_SESSION_free(SSL_SESSION *session);
|
|
Packit Service |
084de1 |
|
|
Packit Service |
084de1 |
=head1 DESCRIPTION
|
|
Packit Service |
084de1 |
|
|
Packit Service |
084de1 |
SSL_SESSION_new() creates a new SSL_SESSION structure and returns a pointer to
|
|
Packit Service |
084de1 |
it.
|
|
Packit Service |
084de1 |
|
|
Packit Service |
084de1 |
SSL_SESSION_dup() copies the contents of the SSL_SESSION structure in B<src>
|
|
Packit Service |
084de1 |
and returns a pointer to it.
|
|
Packit Service |
084de1 |
|
|
Packit Service |
084de1 |
SSL_SESSION_up_ref() increments the reference count on the given SSL_SESSION
|
|
Packit Service |
084de1 |
structure.
|
|
Packit Service |
084de1 |
|
|
Packit Service |
084de1 |
SSL_SESSION_free() decrements the reference count of B<session> and removes
|
|
Packit Service |
084de1 |
the B<SSL_SESSION> structure pointed to by B<session> and frees up the allocated
|
|
Packit Service |
084de1 |
memory, if the reference count has reached 0.
|
|
Packit Service |
084de1 |
If B<session> is NULL nothing is done.
|
|
Packit Service |
084de1 |
|
|
Packit Service |
084de1 |
=head1 NOTES
|
|
Packit Service |
084de1 |
|
|
Packit Service |
084de1 |
SSL_SESSION objects are allocated, when a TLS/SSL handshake operation
|
|
Packit Service |
084de1 |
is successfully completed. Depending on the settings, see
|
|
Packit Service |
084de1 |
L<SSL_CTX_set_session_cache_mode(3)>,
|
|
Packit Service |
084de1 |
the SSL_SESSION objects are internally referenced by the SSL_CTX and
|
|
Packit Service |
084de1 |
linked into its session cache. SSL objects may be using the SSL_SESSION object;
|
|
Packit Service |
084de1 |
as a session may be reused, several SSL objects may be using one SSL_SESSION
|
|
Packit Service |
084de1 |
object at the same time. It is therefore crucial to keep the reference
|
|
Packit Service |
084de1 |
count (usage information) correct and not delete a SSL_SESSION object
|
|
Packit Service |
084de1 |
that is still used, as this may lead to program failures due to
|
|
Packit Service |
084de1 |
dangling pointers. These failures may also appear delayed, e.g.
|
|
Packit Service |
084de1 |
when an SSL_SESSION object was completely freed as the reference count
|
|
Packit Service |
084de1 |
incorrectly became 0, but it is still referenced in the internal
|
|
Packit Service |
084de1 |
session cache and the cache list is processed during a
|
|
Packit Service |
084de1 |
L<SSL_CTX_flush_sessions(3)> operation.
|
|
Packit Service |
084de1 |
|
|
Packit Service |
084de1 |
SSL_SESSION_free() must only be called for SSL_SESSION objects, for
|
|
Packit Service |
084de1 |
which the reference count was explicitly incremented (e.g.
|
|
Packit Service |
084de1 |
by calling SSL_get1_session(), see L<SSL_get_session(3)>)
|
|
Packit Service |
084de1 |
or when the SSL_SESSION object was generated outside a TLS handshake
|
|
Packit Service |
084de1 |
operation, e.g. by using L<d2i_SSL_SESSION(3)>.
|
|
Packit Service |
084de1 |
It must not be called on other SSL_SESSION objects, as this would cause
|
|
Packit Service |
084de1 |
incorrect reference counts and therefore program failures.
|
|
Packit Service |
084de1 |
|
|
Packit Service |
084de1 |
=head1 RETURN VALUES
|
|
Packit Service |
084de1 |
|
|
Packit Service |
084de1 |
SSL_SESSION_new returns a pointer to the newly allocated SSL_SESSION structure
|
|
Packit Service |
084de1 |
or NULL on error.
|
|
Packit Service |
084de1 |
|
|
Packit Service |
084de1 |
SSL_SESSION_up_ref returns 1 on success or 0 on error.
|
|
Packit Service |
084de1 |
|
|
Packit Service |
084de1 |
=head1 SEE ALSO
|
|
Packit Service |
084de1 |
|
|
Packit Service |
084de1 |
L<ssl(7)>, L<SSL_get_session(3)>,
|
|
Packit Service |
084de1 |
L<SSL_CTX_set_session_cache_mode(3)>,
|
|
Packit Service |
084de1 |
L<SSL_CTX_flush_sessions(3)>,
|
|
Packit Service |
084de1 |
L<d2i_SSL_SESSION(3)>
|
|
Packit Service |
084de1 |
|
|
Packit Service |
084de1 |
=head1 HISTORY
|
|
Packit Service |
084de1 |
|
|
Packit Service |
084de1 |
The SSL_SESSION_dup() function was added in OpenSSL 1.1.1.
|
|
Packit Service |
084de1 |
|
|
Packit Service |
084de1 |
=head1 COPYRIGHT
|
|
Packit Service |
084de1 |
|
|
Packit Service |
084de1 |
Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved.
|
|
Packit Service |
084de1 |
|
|
Packit Service |
084de1 |
Licensed under the OpenSSL license (the "License"). You may not use
|
|
Packit Service |
084de1 |
this file except in compliance with the License. You can obtain a copy
|
|
Packit Service |
084de1 |
in the file LICENSE in the source distribution or at
|
|
Packit Service |
084de1 |
L<https://www.openssl.org/source/license.html>.
|
|
Packit Service |
084de1 |
|
|
Packit Service |
084de1 |
=cut
|