1*1dcdf01fSchristos=pod
2*1dcdf01fSchristos
3*1dcdf01fSchristos=head1 NAME
4*1dcdf01fSchristos
5*1dcdf01fSchristosSSL_get_current_cipher, SSL_get_cipher_name, SSL_get_cipher,
6*1dcdf01fSchristosSSL_get_cipher_bits, SSL_get_cipher_version,
7*1dcdf01fSchristosSSL_get_pending_cipher - get SSL_CIPHER of a connection
8*1dcdf01fSchristos
9*1dcdf01fSchristos=head1 SYNOPSIS
10*1dcdf01fSchristos
11*1dcdf01fSchristos #include <openssl/ssl.h>
12*1dcdf01fSchristos
13*1dcdf01fSchristos const SSL_CIPHER *SSL_get_current_cipher(const SSL *ssl);
14*1dcdf01fSchristos const SSL_CIPHER *SSL_get_pending_cipher(const SSL *ssl);
15*1dcdf01fSchristos
16*1dcdf01fSchristos const char *SSL_get_cipher_name(const SSL *s);
17*1dcdf01fSchristos const char *SSL_get_cipher(const SSL *s);
18*1dcdf01fSchristos int SSL_get_cipher_bits(const SSL *s, int *np);
19*1dcdf01fSchristos const char *SSL_get_cipher_version(const SSL *s);
20*1dcdf01fSchristos
21*1dcdf01fSchristos=head1 DESCRIPTION
22*1dcdf01fSchristos
23*1dcdf01fSchristosSSL_get_current_cipher() returns a pointer to an SSL_CIPHER object containing
24*1dcdf01fSchristosthe description of the actually used cipher of a connection established with
25*1dcdf01fSchristosthe B<ssl> object.
26*1dcdf01fSchristosSee L<SSL_CIPHER_get_name(3)> for more details.
27*1dcdf01fSchristos
28*1dcdf01fSchristosSSL_get_cipher_name() obtains the
29*1dcdf01fSchristosname of the currently used cipher.
30*1dcdf01fSchristosSSL_get_cipher() is identical to SSL_get_cipher_name().
31*1dcdf01fSchristosSSL_get_cipher_bits() is a
32*1dcdf01fSchristosmacro to obtain the number of secret/algorithm bits used and
33*1dcdf01fSchristosSSL_get_cipher_version() returns the protocol name.
34*1dcdf01fSchristos
35*1dcdf01fSchristosSSL_get_pending_cipher() returns a pointer to an SSL_CIPHER object containing
36*1dcdf01fSchristosthe description of the cipher (if any) that has been negotiated for future use
37*1dcdf01fSchristoson the connection established with the B<ssl> object, but is not yet in use.
38*1dcdf01fSchristosThis may be the case during handshake processing, when control flow can be
39*1dcdf01fSchristosreturned to the application via any of several callback methods.  The internal
40*1dcdf01fSchristossequencing of handshake processing and callback invocation is not guaranteed
41*1dcdf01fSchristosto be stable from release to release, and at present only the callback set
42*1dcdf01fSchristosby SSL_CTX_set_alpn_select_cb() is guaranteed to have a non-NULL return value.
43*1dcdf01fSchristosOther callbacks may be added to this list over time.
44*1dcdf01fSchristos
45*1dcdf01fSchristos=head1 RETURN VALUES
46*1dcdf01fSchristos
47*1dcdf01fSchristosSSL_get_current_cipher() returns the cipher actually used, or NULL if
48*1dcdf01fSchristosno session has been established.
49*1dcdf01fSchristos
50*1dcdf01fSchristosSSL_get_pending_cipher() returns the cipher to be used at the next change
51*1dcdf01fSchristosof cipher suite, or NULL if no such cipher is known.
52*1dcdf01fSchristos
53*1dcdf01fSchristos=head1 NOTES
54*1dcdf01fSchristos
55*1dcdf01fSchristosSSL_get_cipher, SSL_get_cipher_bits, SSL_get_cipher_version, and
56*1dcdf01fSchristosSSL_get_cipher_name are implemented as macros.
57*1dcdf01fSchristos
58*1dcdf01fSchristos=head1 SEE ALSO
59*1dcdf01fSchristos
60*1dcdf01fSchristosL<ssl(7)>, L<SSL_CIPHER_get_name(3)>
61*1dcdf01fSchristos
62*1dcdf01fSchristos=head1 COPYRIGHT
63*1dcdf01fSchristos
64*1dcdf01fSchristosCopyright 2000-2022 The OpenSSL Project Authors. All Rights Reserved.
65*1dcdf01fSchristos
66*1dcdf01fSchristosLicensed under the OpenSSL license (the "License").  You may not use
67*1dcdf01fSchristosthis file except in compliance with the License.  You can obtain a copy
68*1dcdf01fSchristosin the file LICENSE in the source distribution or at
69*1dcdf01fSchristosL<https://www.openssl.org/source/license.html>.
70*1dcdf01fSchristos
71*1dcdf01fSchristos=cut
72