Current Path : /usr/opt/openssl11/share/doc/openssl/html/man3/ |
FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64 |
Current File : //usr/opt/openssl11/share/doc/openssl/html/man3/SSL_CIPHER_standard_name.html |
<?xml version="1.0" ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>SSL_CIPHER_get_name</title> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <link rev="made" href="mailto:root@hsxx.drive.ne.jp" /> </head> <body style="background-color: white"> <!-- INDEX BEGIN --> <div name="index"> <p><a name="__index__"></a></p> <ul> <li><a href="#name">NAME</a></li> <li><a href="#synopsis">SYNOPSIS</a></li> <li><a href="#description">DESCRIPTION</a></li> <li><a href="#return_values">RETURN VALUES</a></li> <li><a href="#see_also">SEE ALSO</a></li> <li><a href="#history">HISTORY</a></li> <li><a href="#copyright">COPYRIGHT</a></li> </ul> <hr name="index" /> </div> <!-- INDEX END --> <p> </p> <hr /> <h1><a name="name">NAME</a></h1> <p>SSL_CIPHER_get_name, SSL_CIPHER_standard_name, OPENSSL_cipher_name, SSL_CIPHER_get_bits, SSL_CIPHER_get_version, SSL_CIPHER_description, SSL_CIPHER_get_cipher_nid, SSL_CIPHER_get_digest_nid, SSL_CIPHER_get_handshake_digest, SSL_CIPHER_get_kx_nid, SSL_CIPHER_get_auth_nid, SSL_CIPHER_is_aead, SSL_CIPHER_find, SSL_CIPHER_get_id, SSL_CIPHER_get_protocol_id - get SSL_CIPHER properties</p> <p> </p> <hr /> <h1><a name="synopsis">SYNOPSIS</a></h1> <pre> #include <openssl/ssl.h></pre> <pre> const char *SSL_CIPHER_get_name(const SSL_CIPHER *cipher); const char *SSL_CIPHER_standard_name(const SSL_CIPHER *cipher); const char *OPENSSL_cipher_name(const char *stdname); int SSL_CIPHER_get_bits(const SSL_CIPHER *cipher, int *alg_bits); char *SSL_CIPHER_get_version(const SSL_CIPHER *cipher); char *SSL_CIPHER_description(const SSL_CIPHER *cipher, char *buf, int size); int SSL_CIPHER_get_cipher_nid(const SSL_CIPHER *c); int SSL_CIPHER_get_digest_nid(const SSL_CIPHER *c); const EVP_MD *SSL_CIPHER_get_handshake_digest(const SSL_CIPHER *c); int SSL_CIPHER_get_kx_nid(const SSL_CIPHER *c); int SSL_CIPHER_get_auth_nid(const SSL_CIPHER *c); int SSL_CIPHER_is_aead(const SSL_CIPHER *c); const SSL_CIPHER *SSL_CIPHER_find(SSL *ssl, const unsigned char *ptr); uint32_t SSL_CIPHER_get_id(const SSL_CIPHER *c); uint32_t SSL_CIPHER_get_protocol_id(const SSL_CIPHER *c);</pre> <p> </p> <hr /> <h1><a name="description">DESCRIPTION</a></h1> <p><code>SSL_CIPHER_get_name()</code> returns a pointer to the name of <strong>cipher</strong>. If the <strong>cipher</strong> is NULL, it returns "(NONE)".</p> <p><code>SSL_CIPHER_standard_name()</code> returns a pointer to the standard RFC name of <strong>cipher</strong>. If the <strong>cipher</strong> is NULL, it returns "(NONE)". If the <strong>cipher</strong> has no standard name, it returns <strong>NULL</strong>. If <strong>cipher</strong> was defined in both SSLv3 and TLS, it returns the TLS name.</p> <p><code>OPENSSL_cipher_name()</code> returns a pointer to the OpenSSL name of <strong>stdname</strong>. If the <strong>stdname</strong> is NULL, or <strong>stdname</strong> has no corresponding OpenSSL name, it returns "(NONE)". Where both exist, <strong>stdname</strong> should be the TLS name rather than the SSLv3 name.</p> <p><code>SSL_CIPHER_get_bits()</code> returns the number of secret bits used for <strong>cipher</strong>. If <strong>cipher</strong> is NULL, 0 is returned.</p> <p><code>SSL_CIPHER_get_version()</code> returns string which indicates the SSL/TLS protocol version that first defined the cipher. It returns "(NONE)" if <strong>cipher</strong> is NULL.</p> <p><code>SSL_CIPHER_get_cipher_nid()</code> returns the cipher NID corresponding to <strong>c</strong>. If there is no cipher (e.g. for cipher suites with no encryption) then <strong>NID_undef</strong> is returned.</p> <p><code>SSL_CIPHER_get_digest_nid()</code> returns the digest NID corresponding to the MAC used by <strong>c</strong> during record encryption/decryption. If there is no digest (e.g. for AEAD cipher suites) then <strong>NID_undef</strong> is returned.</p> <p><code>SSL_CIPHER_get_handshake_digest()</code> returns an EVP_MD for the digest used during the SSL/TLS handshake when using the SSL_CIPHER <strong>c</strong>. Note that this may be different to the digest used to calculate the MAC for encrypted records.</p> <p><code>SSL_CIPHER_get_kx_nid()</code> returns the key exchange NID corresponding to the method used by <strong>c</strong>. If there is no key exchange, then <strong>NID_undef</strong> is returned. If any appropriate key exchange algorithm can be used (as in the case of TLS 1.3 cipher suites) <strong>NID_kx_any</strong> is returned. Examples (not comprehensive):</p> <pre> NID_kx_rsa NID_kx_ecdhe NID_kx_dhe NID_kx_psk</pre> <p><code>SSL_CIPHER_get_auth_nid()</code> returns the authentication NID corresponding to the method used by <strong>c</strong>. If there is no authentication, then <strong>NID_undef</strong> is returned. If any appropriate authentication algorithm can be used (as in the case of TLS 1.3 cipher suites) <strong>NID_auth_any</strong> is returned. Examples (not comprehensive):</p> <pre> NID_auth_rsa NID_auth_ecdsa NID_auth_psk</pre> <p><code>SSL_CIPHER_is_aead()</code> returns 1 if the cipher <strong>c</strong> is AEAD (e.g. GCM or ChaCha20/Poly1305), and 0 if it is not AEAD.</p> <p><code>SSL_CIPHER_find()</code> returns a <strong>SSL_CIPHER</strong> structure which has the cipher ID stored in <strong>ptr</strong>. The <strong>ptr</strong> parameter is a two element array of <strong>char</strong>, which stores the two-byte TLS cipher ID (as allocated by IANA) in network byte order. This parameter is usually retrieved from a TLS packet by using functions like <em>SSL_client_hello_get0_ciphers(3)</em>. <code>SSL_CIPHER_find()</code> returns NULL if an error occurs or the indicated cipher is not found.</p> <p><code>SSL_CIPHER_get_id()</code> returns the OpenSSL-specific ID of the given cipher <strong>c</strong>. That ID is not the same as the IANA-specific ID.</p> <p><code>SSL_CIPHER_get_protocol_id()</code> returns the two-byte ID used in the TLS protocol of the given cipher <strong>c</strong>.</p> <p><code>SSL_CIPHER_description()</code> returns a textual description of the cipher used into the buffer <strong>buf</strong> of length <strong>len</strong> provided. If <strong>buf</strong> is provided, it must be at least 128 bytes, otherwise a buffer will be allocated using <code>OPENSSL_malloc()</code>. If the provided buffer is too small, or the allocation fails, <strong>NULL</strong> is returned.</p> <p>The string returned by <code>SSL_CIPHER_description()</code> consists of several fields separated by whitespace:</p> <dl> <dt><strong><a name="ciphername" class="item"><ciphername></a></strong></dt> <dd> <p>Textual representation of the cipher name.</p> </dd> <dt><strong><a name="protocol_version" class="item"><protocol version></a></strong></dt> <dd> <p>The minimum protocol version that the ciphersuite supports, such as <strong>TLSv1.2</strong>. Note that this is not always the same as the protocol version in which the ciphersuite was first defined because some ciphersuites are backwards compatible with earlier protocol versions.</p> </dd> <dt><strong><a name="kx_key_exchange" class="item">Kx=<key exchange></a></strong></dt> <dd> <p>Key exchange method such as <strong>RSA</strong>, <strong>ECDHE</strong>, etc.</p> </dd> <dt><strong><a name="au_authentication" class="item">Au=<authentication></a></strong></dt> <dd> <p>Authentication method such as <strong>RSA</strong>, <strong>None</strong>, etc.. None is the representation of anonymous ciphers.</p> </dd> <dt><strong><a name="enc_symmetric_encryption_method" class="item">Enc=<symmetric encryption method></a></strong></dt> <dd> <p>Encryption method, with number of secret bits, such as <strong>AESGCM(128)</strong>.</p> </dd> <dt><strong><a name="mac_message_authentication_code" class="item">Mac=<message authentication code></a></strong></dt> <dd> <p>Message digest, such as <strong>SHA256</strong>.</p> </dd> </dl> <p>Some examples for the output of SSL_CIPHER_description():</p> <pre> ECDHE-RSA-AES256-GCM-SHA256 TLSv1.2 Kx=ECDH Au=RSA Enc=AESGCM(256) Mac=AEAD RSA-PSK-AES256-CBC-SHA384 TLSv1.0 Kx=RSAPSK Au=RSA Enc=AES(256) Mac=SHA384</pre> <p> </p> <hr /> <h1><a name="return_values">RETURN VALUES</a></h1> <p><code>SSL_CIPHER_get_name()</code>, <code>SSL_CIPHER_standard_name()</code>, <code>OPENSSL_cipher_name()</code>, <code>SSL_CIPHER_get_version()</code> and <code>SSL_CIPHER_description()</code> return the corresponding value in a null-terminated string for a specific cipher or "(NONE)" if the cipher is not found.</p> <p><code>SSL_CIPHER_get_bits()</code> returns a positive integer representing the number of secret bits or 0 if an error occurred.</p> <p><code>SSL_CIPHER_get_cipher_nid()</code>, <code>SSL_CIPHER_get_digest_nid()</code>, <code>SSL_CIPHER_get_kx_nid()</code> and <code>SSL_CIPHER_get_auth_nid()</code> return the NID value or <strong>NID_undef</strong> if an error occurred.</p> <p><code>SSL_CIPHER_get_handshake_digest()</code> returns a valid <strong>EVP_MD</strong> structure or NULL if an error occurred.</p> <p><code>SSL_CIPHER_is_aead()</code> returns 1 if the cipher is AEAD or 0 otherwise.</p> <p><code>SSL_CIPHER_find()</code> returns a valid <strong>SSL_CIPHER</strong> structure or NULL if an error occurred.</p> <p><code>SSL_CIPHER_get_id()</code> returns a 4-byte integer representing the OpenSSL-specific ID.</p> <p><code>SSL_CIPHER_get_protocol_id()</code> returns a 2-byte integer representing the TLS protocol-specific ID.</p> <p> </p> <hr /> <h1><a name="see_also">SEE ALSO</a></h1> <p><em>ssl(7)</em>, <em>SSL_get_current_cipher(3)</em>, <em>SSL_get_ciphers(3)</em>, <em>ciphers(1)</em></p> <p> </p> <hr /> <h1><a name="history">HISTORY</a></h1> <p>The <code>SSL_CIPHER_get_version()</code> function was updated to always return the correct protocol string in OpenSSL 1.1.0.</p> <p>The <code>SSL_CIPHER_description()</code> function was changed to return <strong>NULL</strong> on error, rather than a fixed string, in OpenSSL 1.1.0.</p> <p>The <code>SSL_CIPHER_get_handshake_digest()</code> function was added in OpenSSL 1.1.1.</p> <p>The <code>SSL_CIPHER_standard_name()</code> function was globally available in OpenSSL 1.1.1. Before OpenSSL 1.1.1, tracing (<strong>enable-ssl-trace</strong> argument to Configure) was required to enable this function.</p> <p>The <code>OPENSSL_cipher_name()</code> function was added in OpenSSL 1.1.1.</p> <p> </p> <hr /> <h1><a name="copyright">COPYRIGHT</a></h1> <p>Copyright 2000-2019 The OpenSSL Project Authors. All Rights Reserved.</p> <p>Licensed under the OpenSSL license (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at <a href="https://www.openssl.org/source/license.html">https://www.openssl.org/source/license.html</a>.</p> </body> </html>