SSL_CIPHER_get_name.pod revision 269682
172613Skris=pod
272613Skris
372613Skris=head1 NAME
472613Skris
5205128SsimonSSL_CIPHER_get_name, SSL_CIPHER_get_bits, SSL_CIPHER_get_version, SSL_CIPHER_description - get SSL_CIPHER properties
672613Skris
772613Skris=head1 SYNOPSIS
872613Skris
972613Skris #include <openssl/ssl.h>
1072613Skris
1172613Skris const char *SSL_CIPHER_get_name(const SSL_CIPHER *cipher);
1272613Skris int SSL_CIPHER_get_bits(const SSL_CIPHER *cipher, int *alg_bits);
1372613Skris char *SSL_CIPHER_get_version(const SSL_CIPHER *cipher);
14205128Ssimon char *SSL_CIPHER_description(const SSL_CIPHER *cipher, char *buf, int size);
15205128Ssimon
16205128Ssimon=head1 DESCRIPTION
1772613Skris
1872613SkrisSSL_CIPHER_get_name() returns a pointer to the name of B<cipher>. If the
1972613Skrisargument is the NULL pointer, a pointer to the constant value "NONE" is
20205128Ssimonreturned.
21205128Ssimon
2272613SkrisSSL_CIPHER_get_bits() returns the number of secret bits used for B<cipher>. If
2372613SkrisB<alg_bits> is not NULL, it contains the number of bits processed by the
24205128Ssimonchosen algorithm. If B<cipher> is NULL, 0 is returned.
25205128Ssimon
2672613SkrisSSL_CIPHER_get_version() returns string which indicates the SSL/TLS protocol
2789837Skrisversion that first defined the cipher.
2872613SkrisThis is currently B<SSLv2> or B<TLSv1/SSLv3>.
2972613SkrisIn some cases it should possibly return "TLSv1.2" but does not;
3089837Skrisuse SSL_CIPHER_description() instead.
3172613SkrisIf B<cipher> is NULL, "(NONE)" is returned.
32205128Ssimon
33205128SsimonSSL_CIPHER_description() returns a textual description of the cipher used
34205128Ssimoninto the buffer B<buf> of length B<len> provided. B<len> must be at least
35205128Ssimon128 bytes, otherwise a pointer to the string "Buffer too small" is
36205128Ssimonreturned. If B<buf> is NULL, a buffer of 128 bytes is allocated using
3772613SkrisOPENSSL_malloc(). If the allocation fails, a pointer to the string
3872613Skris"OPENSSL_malloc Error" is returned.
3972613Skris
4072613Skris=head1 NOTES
41205128Ssimon
42205128SsimonThe number of bits processed can be different from the secret bits. An
43205128Ssimonexport cipher like e.g. EXP-RC4-MD5 has only 40 secret bits. The algorithm
4472613Skrisdoes use the full 128 bits (which would be returned for B<alg_bits>), of
4572613Skriswhich however 88bits are fixed. The search space is hence only 40 bits.
4672613Skris
4772613SkrisThe string returned by SSL_CIPHER_description() in case of success consists
48205128Ssimonof cleartext information separated by one or more blanks in the following
4972613Skrissequence:
5089837Skris
5189837Skris=over 4
5289837Skris
53100936Snectar=item <ciphername>
5489837Skris
5589837SkrisTextual representation of the cipher name.
5672613Skris
5772613Skris=item <protocol version>
5872613Skris
5972613SkrisProtocol version: B<SSLv2>, B<SSLv3>, B<TLSv1.2>. The TLSv1.0 ciphers are
6072613Skrisflagged with SSLv3. No new ciphers were added by TLSv1.1.
6172613Skris
6272613Skris=item Kx=<key exchange>
6372613Skris
6472613SkrisKey exchange method: B<RSA> (for export ciphers as B<RSA(512)> or
6572613SkrisB<RSA(1024)>), B<DH> (for export ciphers as B<DH(512)> or B<DH(1024)>),
6672613SkrisB<DH/RSA>, B<DH/DSS>, B<Fortezza>.
6772613Skris
6872613Skris=item Au=<authentication>
6972613Skris
7072613SkrisAuthentication method: B<RSA>, B<DSS>, B<DH>, B<None>. None is the
7172613Skrisrepresentation of anonymous ciphers.
7272613Skris
7372613Skris=item Enc=<symmetric encryption method>
7472613Skris
7572613SkrisEncryption method with number of secret bits: B<DES(40)>, B<DES(56)>,
7676866SkrisB<3DES(168)>, B<RC4(40)>, B<RC4(56)>, B<RC4(64)>, B<RC4(128)>,
7772613SkrisB<RC2(40)>, B<RC2(56)>, B<RC2(128)>, B<IDEA(128)>, B<Fortezza>, B<None>.
7872613Skris
7972613Skris=item Mac=<message authentication code>
8072613Skris
81216166SsimonMessage digest: B<MD5>, B<SHA1>.
8272613Skris
8372613Skris=item <export flag>
8472613Skris
8572613SkrisIf the cipher is flagged exportable with respect to old US crypto
8672613Skrisregulations, the word "B<export>" is printed.
8772613Skris
8872613Skris=back
8972613Skris
9072613Skris=head1 EXAMPLES
91261037Sjkim
9272613SkrisSome examples for the output of SSL_CIPHER_description():
93261037Sjkim
94261037Sjkim EDH-RSA-DES-CBC3-SHA    SSLv3 Kx=DH       Au=RSA  Enc=3DES(168) Mac=SHA1
9572613Skris EDH-DSS-DES-CBC3-SHA    SSLv3 Kx=DH       Au=DSS  Enc=3DES(168) Mac=SHA1
9672613Skris RC4-MD5                 SSLv3 Kx=RSA      Au=RSA  Enc=RC4(128)  Mac=MD5
9772613Skris EXP-RC4-MD5             SSLv3 Kx=RSA(512) Au=RSA  Enc=RC4(40)   Mac=MD5  export
9872613Skris
9972613SkrisA comp[lete list can be retrieved by invoking the following command:
10072613Skris
10172613Skris openssl ciphers -v ALL
10272613Skris
10372613Skris=head1 BUGS
10472613Skris
10572613SkrisIf SSL_CIPHER_description() is called with B<cipher> being NULL, the
10672613Skrislibrary crashes.
10772613Skris
108100936SnectarIf SSL_CIPHER_description() cannot handle a built-in cipher, the according
109100936Snectardescription of the cipher property is B<unknown>. This case should not
110100936Snectaroccur.
111100936Snectar
112100936Snectar=head1 RETURN VALUES
113100936Snectar
114100936SnectarSee DESCRIPTION
115267256Sjkim
116267256Sjkim=head1 SEE ALSO
117267256Sjkim
118267256SjkimL<ssl(3)|ssl(3)>, L<SSL_get_current_cipher(3)|SSL_get_current_cipher(3)>,
119267256SjkimL<SSL_get_ciphers(3)|SSL_get_ciphers(3)>, L<ciphers(1)|ciphers(1)>
120267256Sjkim
12172613Skris=cut
12272613Skris