SSL_CIPHER_get_name.pod revision 194206
168651Skris=pod
268651Skris
368651Skris=head1 NAME
468651Skris
572613SkrisSSL_CIPHER_get_name, SSL_CIPHER_get_bits, SSL_CIPHER_get_version, SSL_CIPHER_description - get SSL_CIPHER properties
668651Skris
768651Skris=head1 SYNOPSIS
868651Skris
968651Skris #include <openssl/ssl.h>
1068651Skris
11160814Ssimon const char *SSL_CIPHER_get_name(const SSL_CIPHER *cipher);
12160814Ssimon int SSL_CIPHER_get_bits(const SSL_CIPHER *cipher, int *alg_bits);
13160814Ssimon char *SSL_CIPHER_get_version(const SSL_CIPHER *cipher);
1468651Skris char *SSL_CIPHER_description(SSL_CIPHER *cipher, char *buf, int size);
1568651Skris
1668651Skris=head1 DESCRIPTION
1768651Skris
1868651SkrisSSL_CIPHER_get_name() returns a pointer to the name of B<cipher>. If the
1968651Skrisargument is the NULL pointer, a pointer to the constant value "NONE" is
2068651Skrisreturned.
2168651Skris
2268651SkrisSSL_CIPHER_get_bits() returns the number of secret bits used for B<cipher>. If
2368651SkrisB<alg_bits> is not NULL, it contains the number of bits processed by the
2468651Skrischosen algorithm. If B<cipher> is NULL, 0 is returned.
2568651Skris
2668651SkrisSSL_CIPHER_get_version() returns the protocol version for B<cipher>, currently
2768651Skris"SSLv2", "SSLv3", or "TLSv1". If B<cipher> is NULL, "(NONE)" is returned.
2868651Skris
2968651SkrisSSL_CIPHER_description() returns a textual description of the cipher used
3068651Skrisinto the buffer B<buf> of length B<len> provided. B<len> must be at least
31194206Ssimon128 bytes, otherwise a pointer to the string "Buffer too small" is
3272613Skrisreturned. If B<buf> is NULL, a buffer of 128 bytes is allocated using
3372613SkrisOPENSSL_malloc(). If the allocation fails, a pointer to the string
3472613Skris"OPENSSL_malloc Error" is returned.
3568651Skris
3668651Skris=head1 NOTES
3768651Skris
3868651SkrisThe number of bits processed can be different from the secret bits. An
3968651Skrisexport cipher like e.g. EXP-RC4-MD5 has only 40 secret bits. The algorithm
4068651Skrisdoes use the full 128 bits (which would be returned for B<alg_bits>), of
4168651Skriswhich however 88bits are fixed. The search space is hence only 40 bits.
4268651Skris
4372613SkrisThe string returned by SSL_CIPHER_description() in case of success consists
4476866Skrisof cleartext information separated by one or more blanks in the following
4572613Skrissequence:
4672613Skris
4772613Skris=over 4
4872613Skris
4972613Skris=item <ciphername>
5072613Skris
5172613SkrisTextual representation of the cipher name.
5272613Skris
5372613Skris=item <protocol version>
5472613Skris
5572613SkrisProtocol version: B<SSLv2>, B<SSLv3>. The TLSv1 ciphers are flagged with SSLv3.
5672613Skris
5772613Skris=item Kx=<key exchange>
5872613Skris
5972613SkrisKey exchange method: B<RSA> (for export ciphers as B<RSA(512)> or
6072613SkrisB<RSA(1024)>), B<DH> (for export ciphers as B<DH(512)> or B<DH(1024)>),
6172613SkrisB<DH/RSA>, B<DH/DSS>, B<Fortezza>.
6272613Skris
6372613Skris=item Au=<authentication>
6472613Skris
6572613SkrisAuthentication method: B<RSA>, B<DSS>, B<DH>, B<None>. None is the
6672613Skrisrepresentation of anonymous ciphers.
6772613Skris
6876866Skris=item Enc=<symmetric encryption method>
6972613Skris
7072613SkrisEncryption method with number of secret bits: B<DES(40)>, B<DES(56)>,
7172613SkrisB<3DES(168)>, B<RC4(40)>, B<RC4(56)>, B<RC4(64)>, B<RC4(128)>,
7272613SkrisB<RC2(40)>, B<RC2(56)>, B<RC2(128)>, B<IDEA(128)>, B<Fortezza>, B<None>.
7372613Skris
7472613Skris=item Mac=<message authentication code>
7572613Skris
7672613SkrisMessage digest: B<MD5>, B<SHA1>.
7772613Skris
7872613Skris=item <export flag>
7972613Skris
8072613SkrisIf the cipher is flagged exportable with respect to old US crypto
8172613Skrisregulations, the word "B<export>" is printed.
8272613Skris
8372613Skris=back
8472613Skris
8572613Skris=head1 EXAMPLES
8672613Skris
8772613SkrisSome examples for the output of SSL_CIPHER_description():
8872613Skris
8972613Skris EDH-RSA-DES-CBC3-SHA    SSLv3 Kx=DH       Au=RSA  Enc=3DES(168) Mac=SHA1
9072613Skris EDH-DSS-DES-CBC3-SHA    SSLv3 Kx=DH       Au=DSS  Enc=3DES(168) Mac=SHA1
9172613Skris RC4-MD5                 SSLv3 Kx=RSA      Au=RSA  Enc=RC4(128)  Mac=MD5
9272613Skris EXP-RC4-MD5             SSLv3 Kx=RSA(512) Au=RSA  Enc=RC4(40)   Mac=MD5  export
9372613Skris
9468651Skris=head1 BUGS
9568651Skris
9668651SkrisIf SSL_CIPHER_description() is called with B<cipher> being NULL, the
9768651Skrislibrary crashes.
9868651Skris
9972613SkrisIf SSL_CIPHER_description() cannot handle a built-in cipher, the according
10072613Skrisdescription of the cipher property is B<unknown>. This case should not
10172613Skrisoccur.
10272613Skris
10368651Skris=head1 RETURN VALUES
10468651Skris
10568651SkrisSee DESCRIPTION
10668651Skris
10768651Skris=head1 SEE ALSO
10868651Skris
10968651SkrisL<ssl(3)|ssl(3)>, L<SSL_get_current_cipher(3)|SSL_get_current_cipher(3)>,
11072613SkrisL<SSL_get_ciphers(3)|SSL_get_ciphers(3)>, L<ciphers(1)|ciphers(1)>
11168651Skris
11268651Skris=cut
113