1*eae57701Stb.\" $OpenBSD: SSL_get_shared_ciphers.3,v 1.5 2021/01/09 10:50:02 tb Exp $ 21c714dc6Sschwarze.\" 31c714dc6Sschwarze.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org> 41c714dc6Sschwarze.\" 51c714dc6Sschwarze.\" Permission to use, copy, modify, and distribute this software for any 61c714dc6Sschwarze.\" purpose with or without fee is hereby granted, provided that the above 71c714dc6Sschwarze.\" copyright notice and this permission notice appear in all copies. 81c714dc6Sschwarze.\" 91c714dc6Sschwarze.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 101c714dc6Sschwarze.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 111c714dc6Sschwarze.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 121c714dc6Sschwarze.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 131c714dc6Sschwarze.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 141c714dc6Sschwarze.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 151c714dc6Sschwarze.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 161c714dc6Sschwarze.\" 17*eae57701Stb.Dd $Mdocdate: January 9 2021 $ 181c714dc6Sschwarze.Dt SSL_GET_SHARED_CIPHERS 3 191c714dc6Sschwarze.Os 201c714dc6Sschwarze.Sh NAME 211c714dc6Sschwarze.Nm SSL_get_shared_ciphers 221c714dc6Sschwarze.Nd ciphers supported by both client and server 231c714dc6Sschwarze.Sh SYNOPSIS 241c714dc6Sschwarze.In openssl/ssl.h 251c714dc6Sschwarze.Ft char * 261c714dc6Sschwarze.Fo SSL_get_shared_ciphers 271c714dc6Sschwarze.Fa "const SSL *ssl" 281c714dc6Sschwarze.Fa "char *buf" 291c714dc6Sschwarze.Fa "int len" 301c714dc6Sschwarze.Fc 311c714dc6Sschwarze.Sh DESCRIPTION 32*eae57701StbIf 331c714dc6Sschwarze.Fa ssl 34*eae57701Stbcontains a session in server mode, 35*eae57701Stb.Fn SSL_get_shared_ciphers 36*eae57701Stbputs as many names of ciphers that are supported by both the client 37*eae57701Stband the server into the buffer 38*eae57701Stb.Fa buf 39*eae57701Stbas the buffer is long enough to contain. 401c714dc6SschwarzeNames are separated by colons. 411c714dc6SschwarzeAt most 421c714dc6Sschwarze.Fa len 431c714dc6Sschwarzebytes are written to 441c714dc6Sschwarze.Fa buf 451c714dc6Sschwarzeincluding the terminating NUL character. 461c714dc6Sschwarze.Sh RETURN VALUES 471c714dc6Sschwarze.Fn SSL_get_shared_ciphers 481c714dc6Sschwarzereturns 49*eae57701Stb.Fa buf 50*eae57701Stbon success or 51*eae57701Stb.Dv NULL 52*eae57701Stbon failure. 53*eae57701StbThe following situations cause failure: 54*eae57701Stb.Bl -bullet 55*eae57701Stb.It 56*eae57701Stb.Xr SSL_is_server 3 57*eae57701Stbis false, i.e., 58*eae57701Stb.Ar ssl 59*eae57701Stbis not set to server mode. 60*eae57701Stb.It 61*eae57701Stb.Xr SSL_get_ciphers 3 62*eae57701Stbis 63*eae57701Stb.Dv NULL 64*eae57701Stbor empty, i.e., no ciphers are available for use by the server. 65*eae57701Stb.It 66*eae57701Stb.Xr SSL_get_session 3 67*eae57701Stbis 68*eae57701Stb.Dv NULL , 69*eae57701Stbi.e., 70*eae57701Stb.Ar ssl 71*eae57701Stbcontains no session. 72*eae57701Stb.It 73*eae57701Stb.Xr SSL_get_client_ciphers 3 74*eae57701Stbis 75*eae57701Stb.Dv NULL 76*eae57701Stbor empty, i.e., 77*eae57701Stb.Ar ssl 78*eae57701Stbcontains no information about ciphers supported by the client, 79*eae57701Stbor the client does not support any ciphers. 80*eae57701Stb.It 81*eae57701StbThe 82*eae57701Stb.Fa len 83*eae57701Stbargument is less than 2. 84*eae57701Stb.El 857a73e666Sschwarze.Sh SEE ALSO 86*eae57701Stb.Xr ssl 3 , 87*eae57701Stb.Xr SSL_get_ciphers 3 881c714dc6Sschwarze.Sh HISTORY 891c714dc6Sschwarze.Fn SSL_get_shared_ciphers 9010e00d17Sschwarzefirst appeared in SSLeay 0.4.5b and has been available since 918fba1ec8Sschwarze.Ox 2.4 . 921c714dc6Sschwarze.Sh BUGS 931c714dc6SschwarzeIf the list is too long to fit into 941c714dc6Sschwarze.Fa len 951c714dc6Sschwarzebytes, it is silently truncated after the last cipher name that fits, 961c714dc6Sschwarzeand all following ciphers are skipped. 971c714dc6SschwarzeIf the buffer is very short such that even the first cipher name 981c714dc6Sschwarzedoes not fit, an empty string is returned even when some shared 991c714dc6Sschwarzeciphers are actually available. 1001c714dc6Sschwarze.Pp 1011c714dc6SschwarzeThere is no easy way to find out how much space is required for 1021c714dc6Sschwarze.Fa buf 1031c714dc6Sschwarzeor whether the supplied space was sufficient. 104