xref: /freebsd/crypto/openssl/doc/man3/SSL_get_current_cipher.pod (revision b077aed33b7b6aefca7b17ddb250cf521f938613)
1e71b7053SJung-uk Kim=pod
2e71b7053SJung-uk Kim
3e71b7053SJung-uk Kim=head1 NAME
4e71b7053SJung-uk Kim
5e71b7053SJung-uk KimSSL_get_current_cipher, SSL_get_cipher_name, SSL_get_cipher,
6e71b7053SJung-uk KimSSL_get_cipher_bits, SSL_get_cipher_version,
7e71b7053SJung-uk KimSSL_get_pending_cipher - get SSL_CIPHER of a connection
8e71b7053SJung-uk Kim
9e71b7053SJung-uk Kim=head1 SYNOPSIS
10e71b7053SJung-uk Kim
11e71b7053SJung-uk Kim #include <openssl/ssl.h>
12e71b7053SJung-uk Kim
1364cbf7ceSJung-uk Kim const SSL_CIPHER *SSL_get_current_cipher(const SSL *ssl);
1464cbf7ceSJung-uk Kim const SSL_CIPHER *SSL_get_pending_cipher(const SSL *ssl);
15e71b7053SJung-uk Kim
16e71b7053SJung-uk Kim const char *SSL_get_cipher_name(const SSL *s);
17e71b7053SJung-uk Kim const char *SSL_get_cipher(const SSL *s);
18e71b7053SJung-uk Kim int SSL_get_cipher_bits(const SSL *s, int *np);
19e71b7053SJung-uk Kim const char *SSL_get_cipher_version(const SSL *s);
20e71b7053SJung-uk Kim
21e71b7053SJung-uk Kim=head1 DESCRIPTION
22e71b7053SJung-uk Kim
23e71b7053SJung-uk KimSSL_get_current_cipher() returns a pointer to an SSL_CIPHER object containing
24e71b7053SJung-uk Kimthe description of the actually used cipher of a connection established with
25e71b7053SJung-uk Kimthe B<ssl> object.
26e71b7053SJung-uk KimSee L<SSL_CIPHER_get_name(3)> for more details.
27e71b7053SJung-uk Kim
28e71b7053SJung-uk KimSSL_get_cipher_name() obtains the
29e71b7053SJung-uk Kimname of the currently used cipher.
30e71b7053SJung-uk KimSSL_get_cipher() is identical to SSL_get_cipher_name().
31e71b7053SJung-uk KimSSL_get_cipher_bits() is a
32e71b7053SJung-uk Kimmacro to obtain the number of secret/algorithm bits used and
33e71b7053SJung-uk KimSSL_get_cipher_version() returns the protocol name.
34e71b7053SJung-uk Kim
35e71b7053SJung-uk KimSSL_get_pending_cipher() returns a pointer to an SSL_CIPHER object containing
36e71b7053SJung-uk Kimthe description of the cipher (if any) that has been negotiated for future use
37e71b7053SJung-uk Kimon the connection established with the B<ssl> object, but is not yet in use.
38e71b7053SJung-uk KimThis may be the case during handshake processing, when control flow can be
39e71b7053SJung-uk Kimreturned to the application via any of several callback methods.  The internal
40e71b7053SJung-uk Kimsequencing of handshake processing and callback invocation is not guaranteed
41e71b7053SJung-uk Kimto be stable from release to release, and at present only the callback set
42e71b7053SJung-uk Kimby SSL_CTX_set_alpn_select_cb() is guaranteed to have a non-NULL return value.
43e71b7053SJung-uk KimOther callbacks may be added to this list over time.
44e71b7053SJung-uk Kim
45e71b7053SJung-uk Kim=head1 RETURN VALUES
46e71b7053SJung-uk Kim
47e71b7053SJung-uk KimSSL_get_current_cipher() returns the cipher actually used, or NULL if
48e71b7053SJung-uk Kimno session has been established.
49e71b7053SJung-uk Kim
50e71b7053SJung-uk KimSSL_get_pending_cipher() returns the cipher to be used at the next change
51e71b7053SJung-uk Kimof cipher suite, or NULL if no such cipher is known.
52e71b7053SJung-uk Kim
53e71b7053SJung-uk Kim=head1 NOTES
54e71b7053SJung-uk Kim
55e71b7053SJung-uk KimSSL_get_cipher, SSL_get_cipher_bits, SSL_get_cipher_version, and
56e71b7053SJung-uk KimSSL_get_cipher_name are implemented as macros.
57e71b7053SJung-uk Kim
58e71b7053SJung-uk Kim=head1 SEE ALSO
59e71b7053SJung-uk Kim
60e71b7053SJung-uk KimL<ssl(7)>, L<SSL_CIPHER_get_name(3)>
61e71b7053SJung-uk Kim
62e71b7053SJung-uk Kim=head1 COPYRIGHT
63e71b7053SJung-uk Kim
6464cbf7ceSJung-uk KimCopyright 2000-2022 The OpenSSL Project Authors. All Rights Reserved.
65e71b7053SJung-uk Kim
66*b077aed3SPierre ProncheryLicensed under the Apache License 2.0 (the "License").  You may not use
67e71b7053SJung-uk Kimthis file except in compliance with the License.  You can obtain a copy
68e71b7053SJung-uk Kimin the file LICENSE in the source distribution or at
69e71b7053SJung-uk KimL<https://www.openssl.org/source/license.html>.
70e71b7053SJung-uk Kim
71e71b7053SJung-uk Kim=cut
72