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