Note about contribtions from the US
[openssl.git] / doc / ssl / SSL_CIPHER_get_name.pod
1 =pod
2
3 =head1 NAME
4
5 SSL_CIPHER_get_name, SSL_CIPHER_get_bits, SSL_CIPHER_get_version,
6 SSL_CIPHER_description - get SSL_CIPHER properties
7
8 =head1 SYNOPSIS
9
10  #include <openssl/ssl.h>
11
12  const char *SSL_CIPHER_get_name(SSL_CIPHER *cipher);
13  int SSL_CIPHER_get_bits(SSL_CIPHER *cipher, int *alg_bits);
14  char *SSL_CIPHER_get_version(SSL_CIPHER *cipher);
15  char *SSL_CIPHER_description(SSL_CIPHER *cipher, char *buf, int size);
16
17 =head1 DESCRIPTION
18
19 SSL_CIPHER_get_name() returns a pointer to the name of B<cipher>. If the
20 argument is the NULL pointer, a pointer to the constant value "NONE" is
21 returned.
22
23 SSL_CIPHER_get_bits() returns the number of secret bits used for B<cipher>. If
24 B<alg_bits> is not NULL, it contains the number of bits processed by the
25 chosen algorithm. If B<cipher> is NULL, 0 is returned.
26
27 SSL_CIPHER_get_version() returns the protocol version for B<cipher>, currently
28 "SSLv2", "SSLv3", or "TLSv1". If B<cipher> is NULL, "(NONE)" is returned.
29
30 SSL_CIPHER_description() returns a textual description of the cipher used
31 into the buffer B<buf> of length B<len> provided. B<len> must be at least
32 128 bytes, otherwise the string "Buffer too small" is returned. If B<buf>
33 is NULL, a buffer of 128 bytes is allocated using OPENSSL_malloc(). If the
34 allocation fails, the string "OPENSSL_malloc Error" is returned.
35
36 =head1 NOTES
37
38 The number of bits processed can be different from the secret bits. An
39 export cipher like e.g. EXP-RC4-MD5 has only 40 secret bits. The algorithm
40 does use the full 128 bits (which would be returned for B<alg_bits>), of
41 which however 88bits are fixed. The search space is hence only 40 bits.
42
43 =head1 BUGS
44
45 If SSL_CIPHER_description() is called with B<cipher> being NULL, the
46 library crashes.
47
48 =head1 RETURN VALUES
49
50 See DESCRIPTION
51
52 =head1 SEE ALSO
53
54 L<ssl(3)|ssl(3)>, L<SSL_get_current_cipher(3)|SSL_get_current_cipher(3)>,
55 L<SSL_get_ciphers(3)|SSL_get_ciphers(3)>
56
57 =cut