Blame doc/man3/SSL_key_update.pod

Packit c4476c
=pod
Packit c4476c
Packit c4476c
=head1 NAME
Packit c4476c
Packit c4476c
SSL_key_update,
Packit c4476c
SSL_get_key_update_type,
Packit c4476c
SSL_renegotiate,
Packit c4476c
SSL_renegotiate_abbreviated,
Packit c4476c
SSL_renegotiate_pending
Packit c4476c
- initiate and obtain information about updating connection keys
Packit c4476c
Packit c4476c
=head1 SYNOPSIS
Packit c4476c
Packit c4476c
 #include <openssl/ssl.h>
Packit c4476c
Packit c4476c
 int SSL_key_update(SSL *s, int updatetype);
Packit c4476c
 int SSL_get_key_update_type(const SSL *s);
Packit c4476c
Packit c4476c
 int SSL_renegotiate(SSL *s);
Packit c4476c
 int SSL_renegotiate_abbreviated(SSL *s);
Packit c4476c
 int SSL_renegotiate_pending(const SSL *s);
Packit c4476c
Packit c4476c
=head1 DESCRIPTION
Packit c4476c
Packit c4476c
SSL_key_update() schedules an update of the keys for the current TLS connection.
Packit c4476c
If the B<updatetype> parameter is set to B<SSL_KEY_UPDATE_NOT_REQUESTED> then
Packit c4476c
the sending keys for this connection will be updated and the peer will be
Packit c4476c
informed of the change. If the B<updatetype> parameter is set to
Packit c4476c
B<SSL_KEY_UPDATE_REQUESTED> then the sending keys for this connection will be
Packit c4476c
updated and the peer will be informed of the change along with a request for the
Packit c4476c
peer to additionally update its sending keys. It is an error if B<updatetype> is
Packit c4476c
set to B<SSL_KEY_UPDATE_NONE>.
Packit c4476c
Packit c4476c
SSL_key_update() must only be called after the initial handshake has been
Packit c4476c
completed and TLSv1.3 has been negotiated. The key update will not take place
Packit c4476c
until the next time an IO operation such as SSL_read_ex() or SSL_write_ex()
Packit c4476c
takes place on the connection. Alternatively SSL_do_handshake() can be called to
Packit c4476c
force the update to take place immediately.
Packit c4476c
Packit c4476c
SSL_get_key_update_type() can be used to determine whether a key update
Packit c4476c
operation has been scheduled but not yet performed. The type of the pending key
Packit c4476c
update operation will be returned if there is one, or SSL_KEY_UPDATE_NONE
Packit c4476c
otherwise.
Packit c4476c
Packit c4476c
SSL_renegotiate() and SSL_renegotiate_abbreviated() should only be called for
Packit c4476c
connections that have negotiated TLSv1.2 or less. Calling them on any other
Packit c4476c
connection will result in an error.
Packit c4476c
Packit c4476c
When called from the client side, SSL_renegotiate() schedules a completely new
Packit c4476c
handshake over an existing SSL/TLS connection. The next time an IO operation
Packit c4476c
such as SSL_read_ex() or SSL_write_ex() takes place on the connection a check
Packit c4476c
will be performed to confirm that it is a suitable time to start a
Packit c4476c
renegotiation. If so, then it will be initiated immediately. OpenSSL will not
Packit c4476c
attempt to resume any session associated with the connection in the new
Packit c4476c
handshake.
Packit c4476c
Packit c4476c
When called from the client side, SSL_renegotiate_abbreviated() works in the
Packit c4476c
same was as SSL_renegotiate() except that OpenSSL will attempt to resume the
Packit c4476c
session associated with the current connection in the new handshake.
Packit c4476c
Packit c4476c
When called from the server side, SSL_renegotiate() and
Packit c4476c
SSL_renegotiate_abbreviated() behave identically. They both schedule a request
Packit c4476c
for a new handshake to be sent to the client. The next time an IO operation is
Packit c4476c
performed then the same checks as on the client side are performed and then, if
Packit c4476c
appropriate, the request is sent. The client may or may not respond with a new
Packit c4476c
handshake and it may or may not attempt to resume an existing session. If
Packit c4476c
a new handshake is started then this will be handled transparently by calling
Packit c4476c
any OpenSSL IO function.
Packit c4476c
Packit c4476c
If an OpenSSL client receives a renegotiation request from a server then again
Packit c4476c
this will be handled transparently through calling any OpenSSL IO function. For
Packit c4476c
a TLS connection the client will attempt to resume the current session in the
Packit c4476c
new handshake. For historical reasons, DTLS clients will not attempt to resume
Packit c4476c
the session in the new handshake.
Packit c4476c
Packit c4476c
The SSL_renegotiate_pending() function returns 1 if a renegotiation or
Packit c4476c
renegotiation request has been scheduled but not yet acted on, or 0 otherwise.
Packit c4476c
Packit c4476c
=head1 RETURN VALUES
Packit c4476c
Packit c4476c
SSL_key_update(), SSL_renegotiate() and SSL_renegotiate_abbreviated() return 1
Packit c4476c
on success or 0 on error.
Packit c4476c
Packit c4476c
SSL_get_key_update_type() returns the update type of the pending key update
Packit c4476c
operation or SSL_KEY_UPDATE_NONE if there is none.
Packit c4476c
Packit c4476c
SSL_renegotiate_pending() returns 1 if a renegotiation or renegotiation request
Packit c4476c
has been scheduled but not yet acted on, or 0 otherwise.
Packit c4476c
Packit c4476c
=head1 SEE ALSO
Packit c4476c
Packit c4476c
L<ssl(7)>, L<SSL_read_ex(3)>,
Packit c4476c
L<SSL_write_ex(3)>,
Packit c4476c
L<SSL_do_handshake(3)>
Packit c4476c
Packit c4476c
=head1 HISTORY
Packit c4476c
Packit c4476c
The SSL_key_update() and SSL_get_key_update_type() functions were added in
Packit c4476c
OpenSSL 1.1.1.
Packit c4476c
Packit c4476c
=head1 COPYRIGHT
Packit c4476c
Packit c4476c
Copyright 2017-2019 The OpenSSL Project Authors. All Rights Reserved.
Packit c4476c
Packit c4476c
Licensed under the OpenSSL license (the "License").  You may not use
Packit c4476c
this file except in compliance with the License.  You can obtain a copy
Packit c4476c
in the file LICENSE in the source distribution or at
Packit c4476c
L<https://www.openssl.org/source/license.html>.
Packit c4476c
Packit c4476c
=cut