Update configurable sigalgs documentation for providers
[openssl.git] / doc / man3 / SSL_free.pod
1 =pod
2
3 =head1 NAME
4
5 SSL_free - free an allocated SSL structure
6
7 =head1 SYNOPSIS
8
9  #include <openssl/ssl.h>
10
11  void SSL_free(SSL *ssl);
12
13 =head1 DESCRIPTION
14
15 SSL_free() decrements the reference count of B<ssl>, and removes the SSL
16 structure pointed to by B<ssl> and frees up the allocated memory if the
17 reference count has reached 0.
18 If B<ssl> is NULL nothing is done.
19
20 =head1 NOTES
21
22 SSL_free() also calls the free()ing procedures for indirectly affected items, if
23 applicable: the buffering BIO, the read and write BIOs,
24 cipher lists specially created for this B<ssl>, the B<SSL_SESSION>.
25 Do not explicitly free these indirectly freed up items before or after
26 calling SSL_free(), as trying to free things twice may lead to program
27 failure.
28
29 The ssl session has reference counts from two users: the SSL object, for
30 which the reference count is removed by SSL_free() and the internal
31 session cache. If the session is considered bad, because
32 L<SSL_shutdown(3)> was not called for the connection
33 and L<SSL_set_shutdown(3)> was not used to set the
34 SSL_SENT_SHUTDOWN state, the session will also be removed
35 from the session cache as required by RFC2246.
36
37 When used to free a QUIC stream SSL object, the respective sending and receiving
38 parts of the stream are reset unless those parts have already been concluded
39 normally:
40
41 =over 4
42
43 =item
44
45 If the stream has a sending part (in other words, if it is bidirectional or a
46 locally-initiated unidirectional stream) and that part has not been concluded
47 via a call to L<SSL_stream_conclude(3)> or L<SSL_stream_reset(3)> on the QUIC
48 stream SSL object, a call to SSL_free() automatically resets the sending part of
49 the stream as though L<SSL_stream_reset(3)> were called with a QUIC application
50 error code of 0.
51
52 =item
53
54 If the stream has a receiving part (in other words, if it is bidirectional or a
55 remotely-initiated unidirectional stream), and the peer has not yet concluded
56 that part of the stream normally (such as via a call to
57 L<SSL_stream_conclude(3)> on its own end), a call to SSL_free() automatically
58 requests the reset of the receiving part of the stream using a QUIC STOP_SENDING
59 frame with a QUIC application error code of 0. Note that as per the QUIC
60 protocol, this will automatically cause the peer to reset that part of the
61 stream in turn (which is its sending part).
62
63 =back
64
65 A QUIC stream SSL object maintains a reference to a QUIC connection SSL object
66 internally, therefore a QUIC stream SSL object and its parent QUIC connection
67 SSL object can be freed in either order.
68
69 =head1 RETURN VALUES
70
71 SSL_free() does not provide diagnostic information.
72
73 L<SSL_new(3)>, L<SSL_clear(3)>,
74 L<SSL_shutdown(3)>, L<SSL_set_shutdown(3)>,
75 L<ssl(7)>
76
77 =head1 COPYRIGHT
78
79 Copyright 2000-2023 The OpenSSL Project Authors. All Rights Reserved.
80
81 Licensed under the Apache License 2.0 (the "License").  You may not use
82 this file except in compliance with the License.  You can obtain a copy
83 in the file LICENSE in the source distribution or at
84 L<https://www.openssl.org/source/license.html>.
85
86 =cut