summaryrefslogtreecommitdiff
path: root/src/lib/libssl/doc/SSL_SESSION_free.3
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libssl/doc/SSL_SESSION_free.3')
-rw-r--r--src/lib/libssl/doc/SSL_SESSION_free.376
1 files changed, 76 insertions, 0 deletions
diff --git a/src/lib/libssl/doc/SSL_SESSION_free.3 b/src/lib/libssl/doc/SSL_SESSION_free.3
new file mode 100644
index 0000000000..f7d2350b55
--- /dev/null
+++ b/src/lib/libssl/doc/SSL_SESSION_free.3
@@ -0,0 +1,76 @@
1.Dd $Mdocdate: October 12 2014 $
2.Dt SSL_SESSION_FREE 3
3.Os
4.Sh NAME
5.Nm SSL_SESSION_free
6.Nd free an allocated SSL_SESSION structure
7.Sh SYNOPSIS
8.In openssl/ssl.h
9.Ft void
10.Fn SSL_SESSION_free "SSL_SESSION *session"
11.Sh DESCRIPTION
12.Fn SSL_SESSION_free
13decrements the reference count of
14.Fa session
15and removes the
16.Vt SSL_SESSION
17structure pointed to by
18.Fa session
19and frees up the allocated memory, if the reference count has reached 0.
20.Sh NOTES
21.Vt SSL_SESSION
22objects are allocated when a TLS/SSL handshake operation is successfully
23completed.
24Depending on the settings, see
25.Xr SSL_CTX_set_session_cache_mode 3 ,
26the
27.Vt SSL_SESSION
28objects are internally referenced by the
29.Vt SSL_CTX
30and linked into its session cache.
31.Vt SSL
32objects may be using the
33.Vt SSL_SESSION
34object; as a session may be reused, several
35.Vt SSL
36objects may be using one
37.Vt SSL_SESSION
38object at the same time.
39It is therefore crucial to keep the reference count (usage information) correct
40and not delete a
41.Vt SSL_SESSION
42object that is still used, as this may lead to program failures due to dangling
43pointers.
44These failures may also appear delayed, e.g., when an
45.Vt SSL_SESSION
46object is completely freed as the reference count incorrectly becomes 0, but it
47is still referenced in the internal session cache and the cache list is
48processed during a
49.Xr SSL_CTX_flush_sessions 3
50operation.
51.Pp
52.Fn SSL_SESSION_free
53must only be called for
54.Vt SSL_SESSION
55objects, for which the reference count was explicitly incremented (e.g., by
56calling
57.Xr SSL_get1_session 3 ;
58see
59.Xr SSL_get_session 3 )
60or when the
61.Vt SSL_SESSION
62object was generated outside a TLS handshake operation, e.g., by using
63.Xr d2i_SSL_SESSION 3 .
64It must not be called on other
65.Vt SSL_SESSION
66objects, as this would cause incorrect reference counts and therefore program
67failures.
68.Sh RETURN VALUES
69.Fn SSL_SESSION_free
70does not provide diagnostic information.
71.Sh SEE ALSO
72.Xr d2i_SSL_SESSION 3 ,
73.Xr ssl 3 ,
74.Xr SSL_CTX_flush_sessions 3 ,
75.Xr SSL_CTX_set_session_cache_mode 3 ,
76.Xr SSL_get_session 3