blob: 4b0bf2b52acbacdd32f8a9b71fb0598d0d3d9c7a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
|
.Dd $Mdocdate: November 15 2015 $
.Dt DES_READ_PW 3
.Os
.Sh NAME
.Nm des_read_password ,
.Nm des_read_2passwords ,
.Nm des_read_pw_string ,
.Nm des_read_pw
.Nd Compatibility user interface functions
.Sh SYNOPSIS
.In openssl/des_old.h
.Ft int
.Fo des_read_password
.Fa "DES_cblock *key"
.Fa "const char *prompt"
.Fa "int verify"
.Fc
.Ft int
.Fo des_read_2passwords
.Fa "DES_cblock *key1"
.Fa "DES_cblock *key2"
.Fa "const char *prompt"
.Fa "int verify"
.Fc
.Ft int
.Fo des_read_pw_string
.Fa "char *buf"
.Fa "int length"
.Fa "const char *prompt"
.Fa "int verify"
.Fc
.Ft int
.Fo des_read_pw
.Fa "char *buf"
.Fa "char *buff"
.Fa "int size"
.Fa "const char *prompt"
.Fa "int verify"
.Fc
.Sh DESCRIPTION
The DES library contained a few routines to prompt for passwords.
These aren't necessarily dependent on DES, and have therefore become
part of the UI compatibility library.
.Pp
.Fn des_read_pw
writes the string specified by
.Fa prompt
to standard output turns echo off and reads an input string from the
terminal.
The string is returned in
.Fa buf ,
which must have space for at least
.Fa size
bytes.
If
.Fa verify
is set, the user is asked for the password twice and unless the two
copies match, an error is returned.
The second password is stored in
.Fa buff ,
which must therefore also be at least
.Fa size
bytes.
A return code of -1 indicates a system error, 1 failure due to use
interaction, and 0 is success.
All other functions described here use
.Fn des_read_pw
to do the work.
.Pp
.Fn des_read_pw_string
is a variant of
.Fn des_read_pw
that provides a buffer for you if
.Fa verify
is set.
.Pp
.Fn des_read_password
calls
.Fn des_read_pw
and converts the password to a DES key by calling
.Xr DES_string_to_key 3 ;
.Fn des_read_2passwords
operates in the same way as
.Fn des_read_password
except that it generates two keys by using the
.Xr DES_string_to_2key 3
function.
.Sh NOTES
.Fn des_read_pw_string
is available in the MIT Kerberos library as well, and is also available
under the name
.Xr EVP_read_pw_string 3 .
.Sh SEE ALSO
.Xr UI_new 3
.Sh AUTHORS
.An Richard Levitte Aq Mt richard@levitte.org
for the OpenSSL project.
|