SSL_free.pod 3.0 KB

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