import libssl (LibreSSL 2.5.4)
[unleashed.git] / lib / libssl / man / SSL_get_ciphers.3
blob4c3bbc45cedfe91837193906a360e0b19d4b4981
1 .\"     $OpenBSD: SSL_get_ciphers.3,v 1.2 2016/12/03 09:00:46 schwarze Exp $
2 .\"     OpenSSL c3e64028 Mar 30 11:50:14 2005 +0000
3 .\"
4 .\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
5 .\" Copyright (c) 2000, 2005, 2015 The OpenSSL Project.  All rights reserved.
6 .\"
7 .\" Redistribution and use in source and binary forms, with or without
8 .\" modification, are permitted provided that the following conditions
9 .\" are met:
10 .\"
11 .\" 1. Redistributions of source code must retain the above copyright
12 .\"    notice, this list of conditions and the following disclaimer.
13 .\"
14 .\" 2. Redistributions in binary form must reproduce the above copyright
15 .\"    notice, this list of conditions and the following disclaimer in
16 .\"    the documentation and/or other materials provided with the
17 .\"    distribution.
18 .\"
19 .\" 3. All advertising materials mentioning features or use of this
20 .\"    software must display the following acknowledgment:
21 .\"    "This product includes software developed by the OpenSSL Project
22 .\"    for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
23 .\"
24 .\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
25 .\"    endorse or promote products derived from this software without
26 .\"    prior written permission. For written permission, please contact
27 .\"    openssl-core@openssl.org.
28 .\"
29 .\" 5. Products derived from this software may not be called "OpenSSL"
30 .\"    nor may "OpenSSL" appear in their names without prior written
31 .\"    permission of the OpenSSL Project.
32 .\"
33 .\" 6. Redistributions of any form whatsoever must retain the following
34 .\"    acknowledgment:
35 .\"    "This product includes software developed by the OpenSSL Project
36 .\"    for use in the OpenSSL Toolkit (http://www.openssl.org/)"
37 .\"
38 .\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
39 .\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
41 .\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR
42 .\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43 .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
44 .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
45 .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
47 .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49 .\" OF THE POSSIBILITY OF SUCH DAMAGE.
50 .\"
51 .Dd $Mdocdate: December 3 2016 $
52 .Dt SSL_GET_CIPHERS 3
53 .Os
54 .Sh NAME
55 .Nm SSL_get_ciphers ,
56 .Nm SSL_get_cipher_list
57 .Nd get list of available SSL_CIPHERs
58 .Sh SYNOPSIS
59 .In openssl/ssl.h
60 .Ft STACK_OF(SSL_CIPHER) *
61 .Fn SSL_get_ciphers "const SSL *ssl"
62 .Ft const char *
63 .Fn SSL_get_cipher_list "const SSL *ssl" "int priority"
64 .Sh DESCRIPTION
65 .Fn SSL_get_ciphers
66 returns the stack of available
67 .Vt SSL_CIPHER Ns s
68 for
69 .Fa ssl ,
70 sorted by preference.
72 .Fa ssl
74 .Dv NULL
75 or no ciphers are available,
76 .Dv NULL
77 is returned.
78 .Pp
79 .Fn SSL_get_ciphers
80 returns a pointer to an internal cipher stack, which will be freed
81 later on when the
82 .Vt SSL
83 object is freed.
84 Therefore, the calling code must not free the return value itself.
85 .Pp
86 The details of the ciphers obtained by
87 .Fn SSL_get_ciphers
88 can be obtained using the
89 .Xr SSL_CIPHER_get_name 3
90 family of functions.
91 .Pp
92 .Fn SSL_get_cipher_list
93 returns a pointer to the name of the
94 .Vt SSL_CIPHER
95 listed for
96 .Fa ssl
97 with
98 .Fa priority .
100 .Fa ssl
102 .Dv NULL ,
103 no ciphers are available, or there are fewer ciphers than
104 .Fa priority
105 available,
106 .Dv NULL
107 is returned.
109 Call
110 .Fn SSL_get_cipher_list
111 with
112 .Fa priority
113 starting from 0 to obtain the sorted list of available ciphers, until
114 .Dv NULL
115 is returned.
116 .Sh SEE ALSO
117 .Xr ssl 3 ,
118 .Xr SSL_CIPHER_get_name 3 ,
119 .Xr SSL_CTX_set_cipher_list 3