xref: /openbsd/lib/libcrypto/man/des_read_pw.3 (revision 274d7c50)
1.\"	$OpenBSD: des_read_pw.3,v 1.8 2018/03/27 17:35:50 schwarze Exp $
2.\"	OpenSSL doc/crypto/ui_compat.pod May 14 11:28:00 2006 +0000
3.\"	OpenSSL doc/crypto/des.pod 2a9aca32 Oct 25 08:44:10 2001 +0000
4.\"
5.\" This file was written by Ulf Moeller <ulf@openssl.org> and
6.\" Richard Levitte <levitte@openssl.org>.
7.\" Copyright (c) 2000, 2001 The OpenSSL Project.  All rights reserved.
8.\"
9.\" Redistribution and use in source and binary forms, with or without
10.\" modification, are permitted provided that the following conditions
11.\" are met:
12.\"
13.\" 1. Redistributions of source code must retain the above copyright
14.\"    notice, this list of conditions and the following disclaimer.
15.\"
16.\" 2. Redistributions in binary form must reproduce the above copyright
17.\"    notice, this list of conditions and the following disclaimer in
18.\"    the documentation and/or other materials provided with the
19.\"    distribution.
20.\"
21.\" 3. All advertising materials mentioning features or use of this
22.\"    software must display the following acknowledgment:
23.\"    "This product includes software developed by the OpenSSL Project
24.\"    for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
25.\"
26.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
27.\"    endorse or promote products derived from this software without
28.\"    prior written permission. For written permission, please contact
29.\"    openssl-core@openssl.org.
30.\"
31.\" 5. Products derived from this software may not be called "OpenSSL"
32.\"    nor may "OpenSSL" appear in their names without prior written
33.\"    permission of the OpenSSL Project.
34.\"
35.\" 6. Redistributions of any form whatsoever must retain the following
36.\"    acknowledgment:
37.\"    "This product includes software developed by the OpenSSL Project
38.\"    for use in the OpenSSL Toolkit (http://www.openssl.org/)"
39.\"
40.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
41.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
42.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
43.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR
44.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
45.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
46.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
47.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
49.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
50.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
51.\" OF THE POSSIBILITY OF SUCH DAMAGE.
52.\"
53.Dd $Mdocdate: March 27 2018 $
54.Dt DES_READ_PW 3
55.Os
56.Sh NAME
57.Nm des_read_pw ,
58.Nm des_read_pw_string ,
59.Nm EVP_read_pw_string
60.Nd compatibility user interface functions
61.Sh SYNOPSIS
62.In openssl/ui_compat.h
63.Ft int
64.Fo des_read_pw
65.Fa "char *buf"
66.Fa "char *buff"
67.Fa "int length"
68.Fa "const char *prompt"
69.Fa "int verify"
70.Fc
71.Ft int
72.Fo des_read_pw_string
73.Fa "char *buf"
74.Fa "int length"
75.Fa "const char *prompt"
76.Fa "int verify"
77.Fc
78.In openssl/evp.h
79.Ft int
80.Fo EVP_read_pw_string
81.Fa "char *buf"
82.Fa "int length"
83.Fa "const char *prompt"
84.Fa "int verify"
85.Fc
86.Sh DESCRIPTION
87The DES library contained a few routines to prompt for passwords.
88These aren't necessarily dependent on DES, and have therefore become
89part of the UI compatibility library.
90.Pp
91.Fn des_read_pw
92writes the string specified by
93.Fa prompt
94to standard output, turns echo off, and reads an input string from the
95terminal.
96The string is returned in
97.Fa buf ,
98which must have space for at least
99.Fa length
100bytes.
101If
102.Fa verify
103is set, the user is asked for the password twice and unless the two
104copies match, an error is returned.
105The second password is stored in
106.Fa buff ,
107which must therefore also be at least
108.Fa length
109bytes.
110A return code of -1 indicates a system error, 1 failure due to use
111interaction, and 0 is success.
112.Pp
113.Fn des_read_pw_string
114is a variant of
115.Fn des_read_pw
116that provides a buffer if
117.Fa verify
118is set.
119It is available in the MIT Kerberos library as well.
120If
121.Fa length
122exceeds
123.Dv BUFSIZ ,
124.Fn des_read_pw_string
125uses
126.Dv BUFSIZ .
127.Pp
128.Fn EVP_read_pw_string
129is functionally similar to
130.Fn des_read_pw_string .
131.Sh SEE ALSO
132.Xr UI_new 3
133.Sh HISTORY
134.Fn des_read_pw_string
135appeared in SSLeay 0.4 or earlier.
136.Fn EVP_read_pw_string
137first appeared in SSLeay 0.5.1.
138.Fn des_read_pw
139first appeared in SSLeay 0.8.0.
140These functions have been available since
141.Ox 2.4 .
142.Sh AUTHORS
143.An Richard Levitte Aq Mt richard@levitte.org
144for the OpenSSL project.
145