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