X-Git-Url: https://git.openssl.org/gitweb/?a=blobdiff_plain;f=doc%2Fman3%2FSSL_CIPHER_get_name.pod;h=c70e0d2799c9dfe68ed34b7ad9eec94bf7620354;hb=7525c930304c7814b3176d0724f271d2bbb1a09e;hp=e19bf2132ee0bd35a5cb28c0aae34d63a9e13c10;hpb=c4de074e6385a86a43a30fee574e77f9dcabb022;p=openssl.git diff --git a/doc/man3/SSL_CIPHER_get_name.pod b/doc/man3/SSL_CIPHER_get_name.pod index e19bf2132e..c70e0d2799 100644 --- a/doc/man3/SSL_CIPHER_get_name.pod +++ b/doc/man3/SSL_CIPHER_get_name.pod @@ -2,10 +2,21 @@ =head1 NAME -SSL_CIPHER_get_cipher_nid, SSL_CIPHER_get_digest_nid, SSL_CIPHER_get_kx_nid, -SSL_CIPHER_get_auth_nid, SSL_CIPHER_is_aead, -SSL_CIPHER_get_name, SSL_CIPHER_get_bits, -SSL_CIPHER_get_version, SSL_CIPHER_description +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 =head1 SYNOPSIS @@ -13,20 +24,36 @@ SSL_CIPHER_get_version, SSL_CIPHER_description #include 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); =head1 DESCRIPTION SSL_CIPHER_get_name() returns a pointer to the name of B. If the B is NULL, it returns "(NONE)". +SSL_CIPHER_standard_name() returns a pointer to the standard RFC name of +B. If the B is NULL, it returns "(NONE)". If the B +has no standard name, it returns B. If B was defined in both +SSLv3 and TLS, it returns the TLS name. + +OPENSSL_cipher_name() returns a pointer to the OpenSSL name of B. +If the B is NULL, or B has no corresponding OpenSSL name, +it returns "(NONE)". Where both exist, B should be the TLS name rather +than the SSLv3 name. + SSL_CIPHER_get_bits() returns the number of secret bits used for B. If B is NULL, 0 is returned. @@ -38,8 +65,12 @@ If there is no cipher (e.g. for cipher suites with no encryption) then B is returned. SSL_CIPHER_get_digest_nid() returns the digest NID corresponding to the MAC -used by B. If there is no digest (e.g. for AEAD cipher suites) then -B is returned. +used by B during record encryption/decryption. If there is no digest (e.g. +for AEAD cipher suites) then B is returned. + +SSL_CIPHER_get_handshake_digest() returns an EVP_MD for the digest used during +the SSL/TLS handshake when using the SSL_CIPHER B. Note that this may be +different to the digest used to calculate the MAC for encrypted records. SSL_CIPHER_get_kx_nid() returns the key exchange NID corresponding to the method used by B. If there is no key exchange, then B is returned. @@ -63,6 +94,19 @@ TLS 1.3 cipher suites) B is returned. Examples (not comprehensive) SSL_CIPHER_is_aead() returns 1 if the cipher B is AEAD (e.g. GCM or ChaCha20/Poly1305), and 0 if it is not AEAD. +SSL_CIPHER_find() returns a B structure which has the cipher ID stored +in B. The B parameter is a two element array of B, 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 +L. SSL_CIPHER_find() returns NULL if an +error occurs or the indicated cipher is not found. + +SSL_CIPHER_get_id() returns the OpenSSL-specific ID of the given cipher B. That ID is +not the same as the IANA-specific ID. + +SSL_CIPHER_get_protocol_id() returns the two-byte ID used in the TLS protocol of the given +cipher B. + SSL_CIPHER_description() returns a textual description of the cipher used into the buffer B of length B provided. If B is provided, it must be at least 128 bytes, otherwise a buffer will be allocated using @@ -80,7 +124,10 @@ Textual representation of the cipher name. =item -Protocol version, such as B, when the cipher was first defined. +The minimum protocol version that the ciphersuite supports, such as B. +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. =item Kx= @@ -106,24 +153,59 @@ Some examples for the output of SSL_CIPHER_description(): 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 -=head1 HISTORY +=head1 RETURN VALUES + +SSL_CIPHER_get_name(), SSL_CIPHER_standard_name(), OPENSSL_cipher_name(), +SSL_CIPHER_get_version() and SSL_CIPHER_description() return the corresponding +value in a null-terminated string for a specific cipher or "(NONE)" +if the cipher is not found. + +SSL_CIPHER_get_bits() returns a positive integer representing the number of +secret bits or 0 if an error occurred. + +SSL_CIPHER_get_cipher_nid(), SSL_CIPHER_get_digest_nid(), +SSL_CIPHER_get_kx_nid() and SSL_CIPHER_get_auth_nid() return the NID value or +B if an error occurred. -SSL_CIPHER_get_version() was updated to always return the correct protocol -string in OpenSSL 1.1. +SSL_CIPHER_get_handshake_digest() returns a valid B structure or NULL +if an error occurred. -SSL_CIPHER_description() was changed to return B on error, -rather than a fixed string, in OpenSSL 1.1 +SSL_CIPHER_is_aead() returns 1 if the cipher is AEAD or 0 otherwise. + +SSL_CIPHER_find() returns a valid B structure or NULL if an error +occurred. + +SSL_CIPHER_get_id() returns a 4-byte integer representing the OpenSSL-specific ID. + +SSL_CIPHER_get_protocol_id() returns a 2-byte integer representing the TLS +protocol-specific ID. =head1 SEE ALSO L, L, -L, L +L, L + +=head1 HISTORY + +The SSL_CIPHER_get_version() function was updated to always return the +correct protocol string in OpenSSL 1.1.0. + +The SSL_CIPHER_description() function was changed to return B on error, +rather than a fixed string, in OpenSSL 1.1.0. + +The SSL_CIPHER_get_handshake_digest() function was added in OpenSSL 1.1.1. + +The SSL_CIPHER_standard_name() function was globally available in OpenSSL 1.1.1. + Before OpenSSL 1.1.1, tracing (B argument to Configure) was +required to enable this function. + +The OPENSSL_cipher_name() function was added in OpenSSL 1.1.1. =head1 COPYRIGHT -Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2000-2019 The OpenSSL Project Authors. All Rights Reserved. -Licensed under the OpenSSL license (the "License"). You may not use +Licensed under the Apache License 2.0 (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 L.