summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorschwarze <>2023-09-10 13:58:46 +0000
committerschwarze <>2023-09-10 13:58:46 +0000
commit36b807f4dccf55f0e0eef2111b2946d6dd5ec754 (patch)
tree7b78ba51e44e749e9df251bb766e4de86a69a328 /src/lib
parentd48ffcb8e488f937955038957be5dc80f8fd7b30 (diff)
downloadopenbsd-36b807f4dccf55f0e0eef2111b2946d6dd5ec754.tar.gz
openbsd-36b807f4dccf55f0e0eef2111b2946d6dd5ec754.tar.bz2
openbsd-36b807f4dccf55f0e0eef2111b2946d6dd5ec754.zip
Document the deprecated functions EVP_set_pw_prompt(3) and
EVP_get_pw_prompt(3) because some software out there still uses them. While here, also improve the description of EVP_read_pw_string(3). Delete documentation for des_read_pw(3) and des_read_pw_string(3). They couldn't be used in LibreSSL since at least 2016 because they were never in Symbols.list, and in 2022, jsing@ also removed them from <openssl/ui_compat.h>. Delete the misleading AUTHORS section. Richard Levitte did not write the original implementation of these functions, and the compatibility wrapper around the UI_process(3) API that he did write is not notable enough to be mentioned so prominently.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libcrypto/man/des_read_pw.3157
1 files changed, 86 insertions, 71 deletions
diff --git a/src/lib/libcrypto/man/des_read_pw.3 b/src/lib/libcrypto/man/des_read_pw.3
index 30ae099dc6..41f8553de1 100644
--- a/src/lib/libcrypto/man/des_read_pw.3
+++ b/src/lib/libcrypto/man/des_read_pw.3
@@ -1,10 +1,26 @@
1.\" $OpenBSD: des_read_pw.3,v 1.10 2020/06/19 17:17:13 schwarze Exp $ 1.\" $OpenBSD: des_read_pw.3,v 1.11 2023/09/10 13:58:46 schwarze Exp $
2.\" OpenSSL doc/crypto/ui_compat.pod May 14 11:28:00 2006 +0000 2.\" full merge up to: OpenSSL doc/crypto/des.pod
3.\" OpenSSL doc/crypto/des.pod 2a9aca32 Oct 25 08:44:10 2001 +0000 3.\" 53934822 Jun 9 16:39:19 2016 -0400
4.\" 4.\"
5.\" This file was written by Ulf Moeller <ulf@openssl.org> and 5.\" This file is a derived work.
6.\" Richard Levitte <levitte@openssl.org>. 6.\" The changes are covered by the following Copyright and license:
7.\" Copyright (c) 2000, 2001 The OpenSSL Project. All rights reserved. 7.\"
8.\" Copyright (c) 2023 Ingo Schwarze <schwarze@openbsd.org>
9.\"
10.\" Permission to use, copy, modify, and distribute this software for any
11.\" purpose with or without fee is hereby granted, provided that the above
12.\" copyright notice and this permission notice appear in all copies.
13.\"
14.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
15.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
16.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
17.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
18.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
19.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
20.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
21.\"
22.\" The original file was written by Ulf Moeller <ulf@openssl.org>.
23.\" Copyright (c) 2000 The OpenSSL Project. All rights reserved.
8.\" 24.\"
9.\" Redistribution and use in source and binary forms, with or without 25.\" Redistribution and use in source and binary forms, with or without
10.\" modification, are permitted provided that the following conditions 26.\" modification, are permitted provided that the following conditions
@@ -50,32 +66,16 @@
50.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 66.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
51.\" OF THE POSSIBILITY OF SUCH DAMAGE. 67.\" OF THE POSSIBILITY OF SUCH DAMAGE.
52.\" 68.\"
53.Dd $Mdocdate: June 19 2020 $ 69.Dd $Mdocdate: September 10 2023 $
54.Dt DES_READ_PW 3 70.Dt DES_READ_PW 3
55.Os 71.Os
56.Sh NAME 72.Sh NAME
57.Nm des_read_pw ,
58.Nm des_read_pw_string ,
59.Nm EVP_read_pw_string , 73.Nm EVP_read_pw_string ,
60.Nm EVP_read_pw_string_min 74.Nm EVP_read_pw_string_min ,
75.Nm EVP_set_pw_prompt ,
76.Nm EVP_get_pw_prompt
61.Nd compatibility user interface functions 77.Nd compatibility user interface functions
62.Sh SYNOPSIS 78.Sh SYNOPSIS
63.In openssl/ui_compat.h
64.Ft int
65.Fo des_read_pw
66.Fa "char *buf"
67.Fa "char *buff"
68.Fa "int length"
69.Fa "const char *prompt"
70.Fa "int verify"
71.Fc
72.Ft int
73.Fo des_read_pw_string
74.Fa "char *buf"
75.Fa "int length"
76.Fa "const char *prompt"
77.Fa "int verify"
78.Fc
79.In openssl/evp.h 79.In openssl/evp.h
80.Ft int 80.Ft int
81.Fo EVP_read_pw_string 81.Fo EVP_read_pw_string
@@ -92,73 +92,86 @@
92.Fa "const char *prompt" 92.Fa "const char *prompt"
93.Fa "int verify" 93.Fa "int verify"
94.Fc 94.Fc
95.Ft void
96.Fo EVP_set_pw_prompt
97.Fa "const char *default_prompt"
98.Fc
99.Ft char *
100.Fn EVP_get_pw_prompt void
95.Sh DESCRIPTION 101.Sh DESCRIPTION
96These functions are deprecated. 102These functions are deprecated.
97Use 103Use
98.Xr UI_UTIL_read_pw 3 104.Xr UI_UTIL_read_pw 3
99instead. 105instead.
100.Pp 106.Pp
101The DES library contained a few routines to prompt for passwords. 107.Fn EVP_read_pw_string
102These aren't necessarily dependent on DES, and have therefore become 108writes the
103part of the UI compatibility library.
104.Pp
105.Fn des_read_pw
106writes the string specified by
107.Fa prompt 109.Fa prompt
108to standard output, turns echo off, and reads an input string from the 110to
109terminal. 111.Pa /dev/tty ,
112or, if that could not be opened, to standard output, turns echo off,
113and reads an input string from
114.Pa /dev/tty ,
115or, if that could not be opened, from standard input.
110The string is returned in 116The string is returned in
111.Fa buf , 117.Fa buf ,
112which must have space for at least 118which must have space for at least
113.Fa length 119.Fa length
114bytes. 120bytes.
121If the
122.Fa length
123argument exceeds
124.Dv BUFSIZ ,
125.Dv BUFSIZ
126is used instead.
115If 127If
116.Fa verify 128.Fa verify
117is set, the user is asked for the password twice and unless the two 129is set, the user is asked for the password twice and unless the two
118copies match, an error is returned. 130copies match, an error is returned.
119The second password is stored in
120.Fa buff ,
121which must therefore also be at least
122.Fa length
123bytes.
124.Pp 131.Pp
125.Fn des_read_pw_string
126is a variant of
127.Fn des_read_pw
128that provides a buffer if
129.Fa verify
130is set.
131It is available in the MIT Kerberos library as well.
132If
133.Fa length
134exceeds
135.Dv BUFSIZ ,
136.Fn des_read_pw_string
137uses
138.Dv BUFSIZ .
139.Pp
140.Fn EVP_read_pw_string
141and
142.Fn EVP_read_pw_string_min
143are functionally similar to
144.Fn des_read_pw_string .
145.Fn EVP_read_pw_string_min 132.Fn EVP_read_pw_string_min
146additionally checks that the password is at least 133additionally checks that the password is at least
147.Fa min_length 134.Fa min_length
148bytes long. 135bytes long.
136.Pp
137.Fn EVP_set_pw_prompt
138sets a default prompt to a copy of
139.Fa default_prompt ,
140or clears the default prompt if the
141.Fa default_prompt
142argument is
143.Dv NULL
144or an empty string.
145If the
146.Fa default_prompt
147argument is longer than 79 bytes,
148the copy is silently truncated to a string length of 79 bytes.
149.Pp
150As long as a default prompt is set,
151.Fn EVP_read_pw_string
152and
153.Fn EVP_read_pw_string_min
154can be called with a
155.Fa prompt
156argument of
157.Dv NULL ,
158in which case the default prompt is used instead.
149.Sh RETURN VALUES 159.Sh RETURN VALUES
150These functions return 0 on success and a negative value on failure. 160.Fn EVP_read_pw_string
161and
162.Fn EVP_read_pw_string_min
163return 0 on success or a negative value on failure.
151.Pp 164.Pp
152They return -1 if 165They return \-1 if
153.Fa length 166.Fa length
154is less than or equal to zero or on memory allocation failure. 167is less than or equal to zero or on memory allocation failure.
155They return -1 or -2 if the internal call to 168They return \-1 or \-2 if the internal call to
156.Xr UI_process 3 169.Xr UI_process 3
157fails. 170fails.
158.Pp 171.Pp
159In addition, 172In addition,
160.Fa EVP_read_pw_string_min 173.Fa EVP_read_pw_string_min
161returns -1 if 174returns \-1 if
162.Fa min_length 175.Fa min_length
163is negative, if 176is negative, if
164.Fa length 177.Fa length
@@ -166,16 +179,21 @@ is less than or equal to
166.Fa min_length , 179.Fa min_length ,
167or if the user entered a password shorter than 180or if the user entered a password shorter than
168.Fa min_length . 181.Fa min_length .
182.Pp
183.Fn EVP_get_pw_prompt
184returns an internal pointer to static memory containing the default prompt, or
185.Dv NULL
186if no default prompt is set.
169.Sh SEE ALSO 187.Sh SEE ALSO
170.Xr UI_new 3 , 188.Xr UI_new 3 ,
171.Xr UI_UTIL_read_pw 3 189.Xr UI_UTIL_read_pw 3
172.Sh HISTORY 190.Sh HISTORY
173.Fn des_read_pw_string
174appeared in SSLeay 0.4 or earlier.
175.Fn EVP_read_pw_string 191.Fn EVP_read_pw_string
176first appeared in SSLeay 0.5.1. 192first appeared in SSLeay 0.5.1 and
177.Fn des_read_pw 193.Fn EVP_set_pw_prompt
178first appeared in SSLeay 0.8.0. 194and
195.Fn EVP_get_pw_prompt
196in SSLeay 0.6.0.
179These functions have been available since 197These functions have been available since
180.Ox 2.4 . 198.Ox 2.4 .
181.Pp 199.Pp
@@ -183,6 +201,3 @@ These functions have been available since
183first appeared in OpenSSL 1.0.0 201first appeared in OpenSSL 1.0.0
184and has been available since 202and has been available since
185.Ox 4.9 . 203.Ox 4.9 .
186.Sh AUTHORS
187.An Richard Levitte Aq Mt richard@levitte.org
188for the OpenSSL project.