SSL_key_update.pod 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. =pod
  2. =head1 NAME
  3. SSL_key_update,
  4. SSL_get_key_update_type,
  5. SSL_renegotiate,
  6. SSL_renegotiate_abbreviated,
  7. SSL_renegotiate_pending
  8. - initiate and obtain information about updating connection keys
  9. =head1 SYNOPSIS
  10. #include <openssl/ssl.h>
  11. int SSL_key_update(SSL *s, int updatetype);
  12. int SSL_get_key_update_type(SSL *s);
  13. int SSL_renegotiate(SSL *s);
  14. int SSL_renegotiate_abbreviated(SSL *s);
  15. int SSL_renegotiate_pending(SSL *s);
  16. =head1 DESCRIPTION
  17. SSL_key_update() schedules an update of the keys for the current TLS connection.
  18. If the B<updatetype> parameter is set to B<SSL_KEY_UPDATE_NOT_REQUESTED> then
  19. the sending keys for this connection will be updated and the peer will be
  20. informed of the change. If the B<updatetype> parameter is set to
  21. B<SSL_KEY_UPDATE_REQUESTED> then the sending keys for this connection will be
  22. updated and the peer will be informed of the change along with a request for the
  23. peer to additionally update its sending keys. It is an error if B<updatetype> is
  24. set to B<SSL_KEY_UPDATE_NONE>.
  25. SSL_key_update() must only be called after the initial handshake has been
  26. completed and TLSv1.3 has been negotiated. The key update will not take place
  27. until the next time an IO operation such as SSL_read_ex() or SSL_write_ex()
  28. takes place on the connection. Alternatively SSL_do_handshake() can be called to
  29. force the update to take place immediately.
  30. SSL_get_key_update_type() can be used to determine whether a key update
  31. operation has been scheduled but not yet performed. The type of the pending key
  32. update operation will be returned if there is one, or SSL_KEY_UPDATE_NONE
  33. otherwise.
  34. SSL_renegotiate() and SSL_renegotiate_abbreviated() should only be called for
  35. connections that have negotiated TLSv1.2 or less. Calling them on any other
  36. connection will result in an error.
  37. When called from the client side, SSL_renegotiate() schedules a completely new
  38. handshake over an existing SSL/TLS connection. The next time an IO operation
  39. such as SSL_read_ex() or SSL_write_ex() takes place on the connection a check
  40. will be performed to confirm that it is a suitable time to start a
  41. renegotiation. If so, then it will be initiated immediately. OpenSSL will not
  42. attempt to resume any session associated with the connection in the new
  43. handshake.
  44. When called from the client side, SSL_renegotiate_abbreviated() works in the
  45. same was as SSL_renegotiate() except that OpenSSL will attempt to resume the
  46. session associated with the current connection in the new handshake.
  47. When called from the server side, SSL_renegotiate() and
  48. SSL_renegotiate_abbreviated() behave identically. They both schedule a request
  49. for a new handshake to be sent to the client. The next time an IO operation is
  50. performed then the same checks as on the client side are performed and then, if
  51. appropriate, the request is sent. The client may or may not respond with a new
  52. handshake and it may or may not attempt to resume an existing session. If
  53. a new handshake is started then this will be handled transparently by calling
  54. any OpenSSL IO function.
  55. If an OpenSSL client receives a renegotiation request from a server then again
  56. this will be handled transparently through calling any OpenSSL IO function. For
  57. a TLS connection the client will attempt to resume the current session in the
  58. new handshake. For historical reasons, DTLS clients will not attempt to resume
  59. the session in the new handshake.
  60. The SSL_renegotiate_pending() function returns 1 if a renegotiation or
  61. renegotiation request has been scheduled but not yet acted on, or 0 otherwise.
  62. =head1 RETURN VALUES
  63. SSL_key_update(), SSL_renegotiate() and SSL_renegotiate_abbreviated() return 1
  64. on success or 0 on error.
  65. SSL_get_key_update_type() returns the update type of the pending key update
  66. operation or SSL_KEY_UPDATE_NONE if there is none.
  67. SSL_renegotiate_pending() returns 1 if a renegotiation or renegotiation request
  68. has been scheduled but not yet acted on, or 0 otherwise.
  69. =head1 SEE ALSO
  70. L<ssl(7)>, L<SSL_read_ex(3)>,
  71. L<SSL_write_ex(3)>,
  72. L<SSL_do_handshake(3)>
  73. =head1 HISTORY
  74. The SSL_key_update() and SSL_get_key_update_type() functions were added in
  75. OpenSSL 1.1.1.
  76. =head1 COPYRIGHT
  77. Copyright 2017 The OpenSSL Project Authors. All Rights Reserved.
  78. Licensed under the OpenSSL license (the "License"). You may not use
  79. this file except in compliance with the License. You can obtain a copy
  80. in the file LICENSE in the source distribution or at
  81. L<https://www.openssl.org/source/license.html>.
  82. =cut