diff options
Diffstat (limited to 'src/lib/libssl/doc/SSL_SESSION_free.3')
-rw-r--r-- | src/lib/libssl/doc/SSL_SESSION_free.3 | 76 |
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 | ||
13 | decrements the reference count of | ||
14 | .Fa session | ||
15 | and removes the | ||
16 | .Vt SSL_SESSION | ||
17 | structure pointed to by | ||
18 | .Fa session | ||
19 | and frees up the allocated memory, if the reference count has reached 0. | ||
20 | .Sh NOTES | ||
21 | .Vt SSL_SESSION | ||
22 | objects are allocated when a TLS/SSL handshake operation is successfully | ||
23 | completed. | ||
24 | Depending on the settings, see | ||
25 | .Xr SSL_CTX_set_session_cache_mode 3 , | ||
26 | the | ||
27 | .Vt SSL_SESSION | ||
28 | objects are internally referenced by the | ||
29 | .Vt SSL_CTX | ||
30 | and linked into its session cache. | ||
31 | .Vt SSL | ||
32 | objects may be using the | ||
33 | .Vt SSL_SESSION | ||
34 | object; as a session may be reused, several | ||
35 | .Vt SSL | ||
36 | objects may be using one | ||
37 | .Vt SSL_SESSION | ||
38 | object at the same time. | ||
39 | It is therefore crucial to keep the reference count (usage information) correct | ||
40 | and not delete a | ||
41 | .Vt SSL_SESSION | ||
42 | object that is still used, as this may lead to program failures due to dangling | ||
43 | pointers. | ||
44 | These failures may also appear delayed, e.g., when an | ||
45 | .Vt SSL_SESSION | ||
46 | object is completely freed as the reference count incorrectly becomes 0, but it | ||
47 | is still referenced in the internal session cache and the cache list is | ||
48 | processed during a | ||
49 | .Xr SSL_CTX_flush_sessions 3 | ||
50 | operation. | ||
51 | .Pp | ||
52 | .Fn SSL_SESSION_free | ||
53 | must only be called for | ||
54 | .Vt SSL_SESSION | ||
55 | objects, for which the reference count was explicitly incremented (e.g., by | ||
56 | calling | ||
57 | .Xr SSL_get1_session 3 ; | ||
58 | see | ||
59 | .Xr SSL_get_session 3 ) | ||
60 | or when the | ||
61 | .Vt SSL_SESSION | ||
62 | object was generated outside a TLS handshake operation, e.g., by using | ||
63 | .Xr d2i_SSL_SESSION 3 . | ||
64 | It must not be called on other | ||
65 | .Vt SSL_SESSION | ||
66 | objects, as this would cause incorrect reference counts and therefore program | ||
67 | failures. | ||
68 | .Sh RETURN VALUES | ||
69 | .Fn SSL_SESSION_free | ||
70 | does 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 | ||