summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorschwarze <>2018-02-27 14:13:52 +0000
committerschwarze <>2018-02-27 14:13:52 +0000
commitfefe4861e4c1cadad558991fb9fe3dea2642edef (patch)
treeedf23066d3fa02e9414d0b80d7255182e65e3b17 /src
parentc21b6c12413a6f65811e18e20da3a0c659d04215 (diff)
downloadopenbsd-fefe4861e4c1cadad558991fb9fe3dea2642edef.tar.gz
openbsd-fefe4861e4c1cadad558991fb9fe3dea2642edef.tar.bz2
openbsd-fefe4861e4c1cadad558991fb9fe3dea2642edef.zip
Merge the documentation of SSL_CIPHER_get_id(3) and
the new RETURN VALUES section from OpenSSL, tweaked by me. While here, correct the description of SSL_CIPHER_description(3).
Diffstat (limited to 'src')
-rw-r--r--src/lib/libssl/man/SSL_CIPHER_get_name.3113
1 files changed, 71 insertions, 42 deletions
diff --git a/src/lib/libssl/man/SSL_CIPHER_get_name.3 b/src/lib/libssl/man/SSL_CIPHER_get_name.3
index b85fdffe8d..9a1446efba 100644
--- a/src/lib/libssl/man/SSL_CIPHER_get_name.3
+++ b/src/lib/libssl/man/SSL_CIPHER_get_name.3
@@ -1,8 +1,10 @@
1.\" $OpenBSD: SSL_CIPHER_get_name.3,v 1.3 2017/07/05 11:43:09 schwarze Exp $ 1.\" $OpenBSD: SSL_CIPHER_get_name.3,v 1.4 2018/02/27 14:13:52 schwarze Exp $
2.\" OpenSSL 45f55f6a Nov 30 15:35:22 2014 +0100 2.\" full merge up to: OpenSSL 45f55f6a Nov 30 15:35:22 2014 +0100
3.\" selective merge up to: OpenSSL 61f805c1 Jan 16 01:01:46 2018 +0800
3.\" 4.\"
4.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>. 5.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>
5.\" Copyright (c) 2000, 2001, 2005, 2009, 2013, 2014 The OpenSSL Project. 6.\" and Paul Yang <yang.yang@baishancloud.com>.
7.\" Copyright (c) 2000, 2005, 2009, 2013, 2014, 2017 The OpenSSL Project.
6.\" All rights reserved. 8.\" All rights reserved.
7.\" 9.\"
8.\" Redistribution and use in source and binary forms, with or without 10.\" Redistribution and use in source and binary forms, with or without
@@ -49,13 +51,14 @@
49.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 51.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
50.\" OF THE POSSIBILITY OF SUCH DAMAGE. 52.\" OF THE POSSIBILITY OF SUCH DAMAGE.
51.\" 53.\"
52.Dd $Mdocdate: July 5 2017 $ 54.Dd $Mdocdate: February 27 2018 $
53.Dt SSL_CIPHER_GET_NAME 3 55.Dt SSL_CIPHER_GET_NAME 3
54.Os 56.Os
55.Sh NAME 57.Sh NAME
56.Nm SSL_CIPHER_get_name , 58.Nm SSL_CIPHER_get_name ,
57.Nm SSL_CIPHER_get_bits , 59.Nm SSL_CIPHER_get_bits ,
58.Nm SSL_CIPHER_get_version , 60.Nm SSL_CIPHER_get_version ,
61.Nm SSL_CIPHER_get_id ,
59.Nm SSL_CIPHER_description 62.Nm SSL_CIPHER_description
60.Nd get SSL_CIPHER properties 63.Nd get SSL_CIPHER properties
61.Sh SYNOPSIS 64.Sh SYNOPSIS
@@ -66,18 +69,14 @@
66.Fn SSL_CIPHER_get_bits "const SSL_CIPHER *cipher" "int *alg_bits" 69.Fn SSL_CIPHER_get_bits "const SSL_CIPHER *cipher" "int *alg_bits"
67.Ft char * 70.Ft char *
68.Fn SSL_CIPHER_get_version "const SSL_CIPHER *cipher" 71.Fn SSL_CIPHER_get_version "const SSL_CIPHER *cipher"
72.Ft unsigned long
73.Fn SSL_CIPHER_get_id "const SSL_CIPHER *cipher"
69.Ft char * 74.Ft char *
70.Fn SSL_CIPHER_description "const SSL_CIPHER *cipher" "char *buf" "int size" 75.Fn SSL_CIPHER_description "const SSL_CIPHER *cipher" "char *buf" "int size"
71.Sh DESCRIPTION 76.Sh DESCRIPTION
72.Fn SSL_CIPHER_get_name 77.Fn SSL_CIPHER_get_name
73returns a pointer to the name of 78returns a pointer to the name of
74.Fa cipher . 79.Fa cipher .
75If the
76.Fa cipher
77is
78.Dv NULL ,
79it returns
80.Qq (NONE) .
81.Pp 80.Pp
82.Fn SSL_CIPHER_get_bits 81.Fn SSL_CIPHER_get_bits
83returns the number of secret bits used for 82returns the number of secret bits used for
@@ -86,13 +85,7 @@ If
86.Fa alg_bits 85.Fa alg_bits
87is not 86is not
88.Dv NULL , 87.Dv NULL ,
89it contains the number of bits processed by the 88the number of bits processed by the chosen algorithm is stored into it.
90chosen algorithm.
91If
92.Fa cipher
93is
94.Dv NULL ,
950 is returned.
96.Pp 89.Pp
97.Fn SSL_CIPHER_get_version 90.Fn SSL_CIPHER_get_version
98returns a string which indicates the SSL/TLS protocol version that first 91returns a string which indicates the SSL/TLS protocol version that first
@@ -104,19 +97,32 @@ In some cases it should possibly return
104but the function does not; use 97but the function does not; use
105.Fn SSL_CIPHER_description 98.Fn SSL_CIPHER_description
106instead. 99instead.
107If 100.Pp
108.Fa cipher 101.Fn SSL_CIPHER_get_id
109is 102returns the ID of the given
110.Dv NULL , 103.Fa cipher ,
111.Qq (NONE) 104which must not be
112is returned. 105.Dv NULL .
106The ID here is an OpenSSL-specific concept, which stores a prefix
107of 0x0300 in the higher two bytes and the IANA-specified chipher
108suite ID in the lower two bytes.
109For instance, TLS_RSA_WITH_NULL_MD5 has IANA ID "0x00, 0x01", so
110.Fn SSL_CIPHER_get_id
111returns 0x03000001.
113.Pp 112.Pp
114.Fn SSL_CIPHER_description 113.Fn SSL_CIPHER_description
115returns a textual description of the cipher used into the buffer 114copies a textual description of
116.Fa buf 115.Fa cipher
117of length 116into the buffer
118.Fa len 117.Fa buf ,
119provided. 118which must be at least
119.Fa size
120bytes long.
121The
122.Fa cipher
123argument must not be a
124.Dv NULL
125pointer.
120If 126If
121.Fa buf 127.Fa buf
122is 128is
@@ -128,13 +134,16 @@ that buffer should be freed using the
128function. 134function.
129If 135If
130.Fa len 136.Fa len
131is too small, or if 137is too small to hold the description, a pointer to the static string
132.Fa buf
133is
134.Dv NULL
135and the allocation fails, a pointer to the string
136.Qq Buffer too small 138.Qq Buffer too small
137is returned. 139is returned.
140If memory allocation fails, which can happen even if a
141.Fa buf
142of sufficient size is provided, a pointer to the static string
143.Qq OPENSSL_malloc Error
144is returned and the content of
145.Fa buf
146remains unchanged.
138.Pp 147.Pp
139The string returned by 148The string returned by
140.Fn SSL_CIPHER_description 149.Fn SSL_CIPHER_description
@@ -196,6 +205,34 @@ Message digest:
196.Sy STREEBOG256 , 205.Sy STREEBOG256 ,
197.Sy STREEBOG512 . 206.Sy STREEBOG512 .
198.El 207.El
208.Sh RETURN VALUES
209.Fn SSL_CIPHER_get_name
210returns an internal pointer to a NUL-terminated string.
211.Fn SSL_CIPHER_get_version
212returns a pointer to a static NUL-terminated string.
213If
214.Fa cipher
215is a
216.Dv NULL
217pointer, both functions return a pointer to the static string
218.Qq Pq NONE .
219.Pp
220.Fn SSL_CIPHER_get_bits
221returns a positive integer representing the number of secret bits
222or 0 if
223.Fa cipher
224is a
225.Dv NULL
226pointer.
227.Pp
228.Fn SSL_CIPHER_get_id
229returns a 32-bit unsigned integer.
230.Pp
231.Fn SSL_CIPHER_description
232returns
233.Fa buf
234or a newly allocated string on success or a pointer to a static
235string on error.
199.Sh EXAMPLES 236.Sh EXAMPLES
200An example for the output of 237An example for the output of
201.Fn SSL_CIPHER_description : 238.Fn SSL_CIPHER_description :
@@ -214,14 +251,6 @@ A complete list can be retrieved by invoking the following command:
214.Sh BUGS 251.Sh BUGS
215If 252If
216.Fn SSL_CIPHER_description 253.Fn SSL_CIPHER_description
217is called with
218.Fa cipher
219being
220.Dv NULL ,
221the library crashes.
222.Pp
223If
224.Fn SSL_CIPHER_description
225cannot handle a built-in cipher, 254cannot handle a built-in cipher,
226the according description of the cipher property is 255the according description of the cipher property is
227.Qq unknown . 256.Qq unknown .