diff options
author | schwarze <> | 2017-03-26 00:06:10 +0000 |
---|---|---|
committer | schwarze <> | 2017-03-26 00:06:10 +0000 |
commit | de98901fd00f816ac1e5ce399e922734f7040580 (patch) | |
tree | 2f143f210222745299821f72d1e7c4ba6d26407c | |
parent | fc6e9613198740a5a8d30c697bdae2d6a46f8eb2 (diff) | |
download | openbsd-de98901fd00f816ac1e5ce399e922734f7040580.tar.gz openbsd-de98901fd00f816ac1e5ce399e922734f7040580.tar.bz2 openbsd-de98901fd00f816ac1e5ce399e922734f7040580.zip |
merge new UI documentation from OpenSSL
-rw-r--r-- | src/lib/libcrypto/man/Makefile | 5 | ||||
-rw-r--r-- | src/lib/libcrypto/man/UI_UTIL_read_pw.3 | 95 | ||||
-rw-r--r-- | src/lib/libcrypto/man/UI_create_method.3 | 262 | ||||
-rw-r--r-- | src/lib/libcrypto/man/UI_get_string_type.3 | 277 | ||||
-rw-r--r-- | src/lib/libcrypto/man/UI_new.3 | 25 |
5 files changed, 651 insertions, 13 deletions
diff --git a/src/lib/libcrypto/man/Makefile b/src/lib/libcrypto/man/Makefile index 20d04f2484..eec7ad39b0 100644 --- a/src/lib/libcrypto/man/Makefile +++ b/src/lib/libcrypto/man/Makefile | |||
@@ -1,4 +1,4 @@ | |||
1 | # $OpenBSD: Makefile,v 1.118 2017/03/25 22:21:21 schwarze Exp $ | 1 | # $OpenBSD: Makefile,v 1.119 2017/03/26 00:06:10 schwarze Exp $ |
2 | 2 | ||
3 | .include <bsd.own.mk> | 3 | .include <bsd.own.mk> |
4 | 4 | ||
@@ -193,6 +193,9 @@ MAN= \ | |||
193 | SMIME_write_PKCS7.3 \ | 193 | SMIME_write_PKCS7.3 \ |
194 | SXNET_new.3 \ | 194 | SXNET_new.3 \ |
195 | TS_REQ_new.3 \ | 195 | TS_REQ_new.3 \ |
196 | UI_UTIL_read_pw.3 \ | ||
197 | UI_create_method.3 \ | ||
198 | UI_get_string_type.3 \ | ||
196 | UI_new.3 \ | 199 | UI_new.3 \ |
197 | X509V3_get_d2i.3 \ | 200 | X509V3_get_d2i.3 \ |
198 | X509_ALGOR_dup.3 \ | 201 | X509_ALGOR_dup.3 \ |
diff --git a/src/lib/libcrypto/man/UI_UTIL_read_pw.3 b/src/lib/libcrypto/man/UI_UTIL_read_pw.3 new file mode 100644 index 0000000000..b2d69c455e --- /dev/null +++ b/src/lib/libcrypto/man/UI_UTIL_read_pw.3 | |||
@@ -0,0 +1,95 @@ | |||
1 | .\" $OpenBSD: UI_UTIL_read_pw.3,v 1.1 2017/03/26 00:06:10 schwarze Exp $ | ||
2 | .\" OpenSSL UI_UTIL_read_pw.pod 23103a52 Jan 12 15:17:42 2017 +0100 | ||
3 | .\" | ||
4 | .\" This file was written by Richard Levitte <levitte@openssl.org>. | ||
5 | .\" Copyright (c) 2017 The OpenSSL Project. All rights reserved. | ||
6 | .\" | ||
7 | .\" Redistribution and use in source and binary forms, with or without | ||
8 | .\" modification, are permitted provided that the following conditions | ||
9 | .\" are met: | ||
10 | .\" | ||
11 | .\" 1. Redistributions of source code must retain the above copyright | ||
12 | .\" notice, this list of conditions and the following disclaimer. | ||
13 | .\" | ||
14 | .\" 2. Redistributions in binary form must reproduce the above copyright | ||
15 | .\" notice, this list of conditions and the following disclaimer in | ||
16 | .\" the documentation and/or other materials provided with the | ||
17 | .\" distribution. | ||
18 | .\" | ||
19 | .\" 3. All advertising materials mentioning features or use of this | ||
20 | .\" software must display the following acknowledgment: | ||
21 | .\" "This product includes software developed by the OpenSSL Project | ||
22 | .\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)" | ||
23 | .\" | ||
24 | .\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
25 | .\" endorse or promote products derived from this software without | ||
26 | .\" prior written permission. For written permission, please contact | ||
27 | .\" openssl-core@openssl.org. | ||
28 | .\" | ||
29 | .\" 5. Products derived from this software may not be called "OpenSSL" | ||
30 | .\" nor may "OpenSSL" appear in their names without prior written | ||
31 | .\" permission of the OpenSSL Project. | ||
32 | .\" | ||
33 | .\" 6. Redistributions of any form whatsoever must retain the following | ||
34 | .\" acknowledgment: | ||
35 | .\" "This product includes software developed by the OpenSSL Project | ||
36 | .\" for use in the OpenSSL Toolkit (http://www.openssl.org/)" | ||
37 | .\" | ||
38 | .\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
39 | .\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
40 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
41 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
42 | .\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
43 | .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
44 | .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
45 | .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
46 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
47 | .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
48 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
49 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | ||
50 | .\" | ||
51 | .Dd $Mdocdate: March 26 2017 $ | ||
52 | .Dt UI_UTIL_READ_PW 3 | ||
53 | .Os | ||
54 | .Sh NAME | ||
55 | .Nm UI_UTIL_read_pw , | ||
56 | .Nm UI_UTIL_read_pw_string | ||
57 | .Nd get a password from the user | ||
58 | .Sh SYNOPSIS | ||
59 | .In openssl/ui.h | ||
60 | .Ft int | ||
61 | .Fo UI_UTIL_read_pw_string | ||
62 | .Fa "char *buf" | ||
63 | .Fa "int length" | ||
64 | .Fa "const char *prompt" | ||
65 | .Fa "int verify" | ||
66 | .Fc | ||
67 | .Ft int | ||
68 | .Fo UI_UTIL_read_pw | ||
69 | .Fa "char *buf" | ||
70 | .Fa "char *buff" | ||
71 | .Fa "int size" | ||
72 | .Fa "const char *prompt" | ||
73 | .Fa "int verify" | ||
74 | .Fc | ||
75 | .Sh DESCRIPTION | ||
76 | .Fn UI_UTIL_read_pw_string | ||
77 | asks for a passphrase, using | ||
78 | .Fa prompt | ||
79 | as a prompt, and stores it in | ||
80 | .Fa buf . | ||
81 | The maximum allowed size is given with | ||
82 | .Fa length , | ||
83 | including the terminating NUL byte. | ||
84 | If | ||
85 | .Fa verify | ||
86 | is non-zero, the password will be verified as well. | ||
87 | .Pp | ||
88 | .Fn UI_UTIL_read_pw | ||
89 | does the same as | ||
90 | .Fn UI_UTIL_read_pw_string , | ||
91 | but takes an external buffer | ||
92 | .Fa buff | ||
93 | for the verification passphrase. | ||
94 | .Sh SEE ALSO | ||
95 | .Xr UI_new 3 | ||
diff --git a/src/lib/libcrypto/man/UI_create_method.3 b/src/lib/libcrypto/man/UI_create_method.3 new file mode 100644 index 0000000000..a29a4bb930 --- /dev/null +++ b/src/lib/libcrypto/man/UI_create_method.3 | |||
@@ -0,0 +1,262 @@ | |||
1 | .\" $OpenBSD: UI_create_method.3,v 1.1 2017/03/26 00:06:10 schwarze Exp $ | ||
2 | .\" OpenSSL UI_create_method.pod 8e3d46e5 Mar 11 10:51:04 2017 +0100 | ||
3 | .\" | ||
4 | .\" This file was written by Richard Levitte <levitte@openssl.org>. | ||
5 | .\" Copyright (c) 2017 The OpenSSL Project. All rights reserved. | ||
6 | .\" | ||
7 | .\" Redistribution and use in source and binary forms, with or without | ||
8 | .\" modification, are permitted provided that the following conditions | ||
9 | .\" are met: | ||
10 | .\" | ||
11 | .\" 1. Redistributions of source code must retain the above copyright | ||
12 | .\" notice, this list of conditions and the following disclaimer. | ||
13 | .\" | ||
14 | .\" 2. Redistributions in binary form must reproduce the above copyright | ||
15 | .\" notice, this list of conditions and the following disclaimer in | ||
16 | .\" the documentation and/or other materials provided with the | ||
17 | .\" distribution. | ||
18 | .\" | ||
19 | .\" 3. All advertising materials mentioning features or use of this | ||
20 | .\" software must display the following acknowledgment: | ||
21 | .\" "This product includes software developed by the OpenSSL Project | ||
22 | .\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)" | ||
23 | .\" | ||
24 | .\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
25 | .\" endorse or promote products derived from this software without | ||
26 | .\" prior written permission. For written permission, please contact | ||
27 | .\" openssl-core@openssl.org. | ||
28 | .\" | ||
29 | .\" 5. Products derived from this software may not be called "OpenSSL" | ||
30 | .\" nor may "OpenSSL" appear in their names without prior written | ||
31 | .\" permission of the OpenSSL Project. | ||
32 | .\" | ||
33 | .\" 6. Redistributions of any form whatsoever must retain the following | ||
34 | .\" acknowledgment: | ||
35 | .\" "This product includes software developed by the OpenSSL Project | ||
36 | .\" for use in the OpenSSL Toolkit (http://www.openssl.org/)" | ||
37 | .\" | ||
38 | .\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
39 | .\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
40 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
41 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
42 | .\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
43 | .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
44 | .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
45 | .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
46 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
47 | .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
48 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
49 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | ||
50 | .\" | ||
51 | .Dd $Mdocdate: March 26 2017 $ | ||
52 | .Dt UI_CREATE_METHOD 3 | ||
53 | .Os | ||
54 | .Sh NAME | ||
55 | .Nm UI_create_method , | ||
56 | .Nm UI_destroy_method , | ||
57 | .Nm UI_method_set_opener , | ||
58 | .Nm UI_method_set_writer , | ||
59 | .Nm UI_method_set_flusher , | ||
60 | .Nm UI_method_set_reader , | ||
61 | .Nm UI_method_set_closer , | ||
62 | .Nm UI_method_set_prompt_constructor , | ||
63 | .Nm UI_method_get_opener , | ||
64 | .Nm UI_method_get_writer , | ||
65 | .Nm UI_method_get_flusher , | ||
66 | .Nm UI_method_get_reader , | ||
67 | .Nm UI_method_get_closer , | ||
68 | .Nm UI_method_get_prompt_constructor | ||
69 | .Nd user interface method creation and destruction | ||
70 | .Sh SYNOPSIS | ||
71 | .In openssl/ui.h | ||
72 | .Ft UI_METHOD * | ||
73 | .Fo UI_create_method | ||
74 | .Fa "char *name" | ||
75 | .Fc | ||
76 | .Ft void | ||
77 | .Fo UI_destroy_method | ||
78 | .Fa "UI_METHOD *ui_method" | ||
79 | .Fc | ||
80 | .Ft int | ||
81 | .Fo UI_method_set_opener | ||
82 | .Fa "UI_METHOD *method" | ||
83 | .Fa "int (*opener)(UI *ui)" | ||
84 | .Fc | ||
85 | .Ft int | ||
86 | .Fo UI_method_set_writer | ||
87 | .Fa "UI_METHOD *method" | ||
88 | .Fa "int (*writer)(UI *ui, UI_STRING *uis)" | ||
89 | .Fc | ||
90 | .Ft int | ||
91 | .Fo UI_method_set_flusher | ||
92 | .Fa "UI_METHOD *method" | ||
93 | .Fa "int (*flusher)(UI *ui)" | ||
94 | .Fc | ||
95 | .Ft int | ||
96 | .Fo UI_method_set_reader | ||
97 | .Fa "UI_METHOD *method" | ||
98 | .Fa "int (*reader)(UI *ui, UI_STRING *uis)" | ||
99 | .Fc | ||
100 | .Ft int | ||
101 | .Fo UI_method_set_closer | ||
102 | .Fa "UI_METHOD *method" | ||
103 | .Fa "int (*closer)(UI *ui)" | ||
104 | .Fc | ||
105 | .Ft int | ||
106 | .Fo UI_method_set_prompt_constructor | ||
107 | .Fa "UI_METHOD *method" | ||
108 | .Fa "char *(*prompt_constructor)(UI *ui, const char *object_desc,\ | ||
109 | const char *object_name)" | ||
110 | .Fc | ||
111 | .Ft int | ||
112 | .Fo "(*UI_method_get_opener(const UI_METHOD *method))" | ||
113 | .Fa "UI *"; | ||
114 | .Fc | ||
115 | .Ft int | ||
116 | .Fo "(*UI_method_get_writer(const UI_METHOD *method))" | ||
117 | .Fa "UI *" | ||
118 | .Fa "UI_STRING *" | ||
119 | .Fc | ||
120 | .Ft int | ||
121 | .Fo "(*UI_method_get_flusher(const UI_METHOD *method))" | ||
122 | .Fa "UI *" | ||
123 | .Fc | ||
124 | .Ft int | ||
125 | .Fo "(*UI_method_get_reader(const UI_METHOD *method))" | ||
126 | .Fa "UI *" | ||
127 | .Fa "UI_STRING *" | ||
128 | .Fc | ||
129 | .Ft int | ||
130 | .Fo "(*UI_method_get_closer(const UI_METHOD *method))" | ||
131 | .Fa "UI *" | ||
132 | .Fc | ||
133 | .Ft char * | ||
134 | .Fo "(*UI_method_get_prompt_constructor(UI_METHOD *method))" | ||
135 | .Fa "UI *" | ||
136 | .Fa "const char *" | ||
137 | .Fa "const char *" | ||
138 | .Fc | ||
139 | .Sh DESCRIPTION | ||
140 | A method contains a few functions that implement the low level of the | ||
141 | User Interface. | ||
142 | These functions are: | ||
143 | .Bl -tag -width Ds | ||
144 | .It an opener | ||
145 | This function takes a reference to a UI and starts a session, for | ||
146 | example by opening a channel to a tty, or by creating a dialog box. | ||
147 | .It a writer | ||
148 | This function takes a reference to a UI and a UI String, and writes the | ||
149 | string where appropriate, maybe to the tty, maybe added as a field label | ||
150 | in a dialog box. | ||
151 | Note that this gets fed all strings associated with a UI, one after the | ||
152 | other, so care must be taken which ones it actually uses. | ||
153 | .It a flusher | ||
154 | This function takes a reference to a UI, and flushes everything that has | ||
155 | been output so far. | ||
156 | For example, if the method builds up a dialog box, this can be used to | ||
157 | actually display it and accepting input ended with a pressed button. | ||
158 | .It a reader | ||
159 | This function takes a reference to a UI and a UI string and reads off | ||
160 | the given prompt, maybe from the tty, maybe from a field in a dialog | ||
161 | box. | ||
162 | Note that this gets fed all strings associated with a UI, one after the | ||
163 | other, so care must be taken which ones it actually uses. | ||
164 | .It a closer | ||
165 | This function takes a reference to a UI, and closes the session, maybe | ||
166 | by closing the channel to the tty, maybe by destroying a dialog box. | ||
167 | .El | ||
168 | .Pp | ||
169 | All of these functions are expected to return 0 on error, 1 on success, | ||
170 | or -1 on out-off-band events, for example if some prompting has been | ||
171 | cancelled (by pressing Ctrl-C, for example). | ||
172 | Only the flusher or the reader are expected to return -1. If returned by | ||
173 | another of the functions, it's treated as if 0 was returned. | ||
174 | .Pp | ||
175 | Regarding the writer and the reader, don't assume the former should only | ||
176 | write and don't assume the latter should only read. | ||
177 | This depends on the needs of the method. | ||
178 | .Pp | ||
179 | For example, a typical tty reader wouldn't write the prompts in the | ||
180 | write, but would rather do so in the reader, because of the sequential | ||
181 | nature of prompting on a tty. | ||
182 | This is how the | ||
183 | .Xr UI_OpenSSL 3 | ||
184 | method does it. | ||
185 | .Pp | ||
186 | In contrast, a method that builds up a dialog box would add all prompt | ||
187 | text in the writer, have all input read in the flusher and store the | ||
188 | results in some temporary buffer, and finally have the reader just fetch | ||
189 | those results. | ||
190 | .Pp | ||
191 | The central function that uses these method functions is | ||
192 | .Xr UI_process 3 , | ||
193 | and it does it in five steps: | ||
194 | .Bl -enum | ||
195 | .It | ||
196 | Open the session using the opener function if that one is defined. | ||
197 | If an error occurs, jump to 5. | ||
198 | .It | ||
199 | For every UI String associated with the UI, call the writer function if | ||
200 | that one is defined. | ||
201 | If an error occurs, jump to 5. | ||
202 | .It | ||
203 | Flush everything using the flusher function if that one is defined. | ||
204 | If an error occurs, jump to 5. | ||
205 | .It | ||
206 | For every UI String associated with the UI, call the reader function if | ||
207 | that one is defined. | ||
208 | If an error occurs, jump to 5. | ||
209 | .It | ||
210 | Close the session using the closer function if that one is defined. | ||
211 | .El | ||
212 | .Pp | ||
213 | .Fn UI_create_method | ||
214 | creates a new UI method with a given | ||
215 | .Fa name . | ||
216 | .Pp | ||
217 | .Fn UI_destroy_method | ||
218 | destroys the given | ||
219 | .Fa ui_method . | ||
220 | .Pp | ||
221 | .Fn UI_method_set_opener , | ||
222 | .Fn UI_method_set_writer , | ||
223 | .Fn UI_method_set_flusher , | ||
224 | .Fn UI_method_set_reader | ||
225 | and | ||
226 | .Fn UI_method_set_closer | ||
227 | set one of the five main methods to the given function pointer. | ||
228 | .Pp | ||
229 | .Fn UI_method_set_prompt_constructor | ||
230 | sets the prompt constructor, see | ||
231 | .Xr UI_construct_prompt 3 . | ||
232 | .Sh RETURN VALUES | ||
233 | .Fn UI_create_method | ||
234 | returns a | ||
235 | .Vt UI_METHOD | ||
236 | pointer on success or | ||
237 | .Dv NULL | ||
238 | on error. | ||
239 | .Pp | ||
240 | .Fn UI_method_set_opener , | ||
241 | .Fn UI_method_set_writer , | ||
242 | .Fn UI_method_set_flusher , | ||
243 | .Fn UI_method_set_reader , | ||
244 | .Fn UI_method_set_closer , | ||
245 | and | ||
246 | .Fn UI_method_set_prompt_constructor | ||
247 | return 0 on success or -1 if the given method is | ||
248 | .Dv NULL . | ||
249 | .Pp | ||
250 | .Fn UI_method_get_opener , | ||
251 | .Fn UI_method_get_writer , | ||
252 | .Fn UI_method_get_flusher , | ||
253 | .Fn UI_method_get_reader , | ||
254 | .Fn UI_method_get_closer , | ||
255 | and | ||
256 | .Fn UI_method_get_prompt_constructor | ||
257 | return the requested function pointer if it is set in the method, | ||
258 | or otherwise | ||
259 | .Dv NULL . | ||
260 | .Sh SEE ALSO | ||
261 | .Xr UI_get_string_type 3 , | ||
262 | .Xr UI_new 3 | ||
diff --git a/src/lib/libcrypto/man/UI_get_string_type.3 b/src/lib/libcrypto/man/UI_get_string_type.3 new file mode 100644 index 0000000000..d7cceadc75 --- /dev/null +++ b/src/lib/libcrypto/man/UI_get_string_type.3 | |||
@@ -0,0 +1,277 @@ | |||
1 | .\" $OpenBSD: UI_get_string_type.3,v 1.1 2017/03/26 00:06:10 schwarze Exp $ | ||
2 | .\" OpenSSL UI_STRING.pod 2ca2e917 Mar 20 16:25:22 2017 -0400 | ||
3 | .\" | ||
4 | .\" This file was written by Richard Levitte <levitte@openssl.org> | ||
5 | .\" Copyright (c) 2017 The OpenSSL Project. All rights reserved. | ||
6 | .\" | ||
7 | .\" Redistribution and use in source and binary forms, with or without | ||
8 | .\" modification, are permitted provided that the following conditions | ||
9 | .\" are met: | ||
10 | .\" | ||
11 | .\" 1. Redistributions of source code must retain the above copyright | ||
12 | .\" notice, this list of conditions and the following disclaimer. | ||
13 | .\" | ||
14 | .\" 2. Redistributions in binary form must reproduce the above copyright | ||
15 | .\" notice, this list of conditions and the following disclaimer in | ||
16 | .\" the documentation and/or other materials provided with the | ||
17 | .\" distribution. | ||
18 | .\" | ||
19 | .\" 3. All advertising materials mentioning features or use of this | ||
20 | .\" software must display the following acknowledgment: | ||
21 | .\" "This product includes software developed by the OpenSSL Project | ||
22 | .\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)" | ||
23 | .\" | ||
24 | .\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
25 | .\" endorse or promote products derived from this software without | ||
26 | .\" prior written permission. For written permission, please contact | ||
27 | .\" openssl-core@openssl.org. | ||
28 | .\" | ||
29 | .\" 5. Products derived from this software may not be called "OpenSSL" | ||
30 | .\" nor may "OpenSSL" appear in their names without prior written | ||
31 | .\" permission of the OpenSSL Project. | ||
32 | .\" | ||
33 | .\" 6. Redistributions of any form whatsoever must retain the following | ||
34 | .\" acknowledgment: | ||
35 | .\" "This product includes software developed by the OpenSSL Project | ||
36 | .\" for use in the OpenSSL Toolkit (http://www.openssl.org/)" | ||
37 | .\" | ||
38 | .\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
39 | .\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
40 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
41 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
42 | .\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
43 | .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
44 | .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
45 | .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
46 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
47 | .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
48 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
49 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | ||
50 | .\" | ||
51 | .Dd $Mdocdate: March 26 2017 $ | ||
52 | .Dt UI_GET_STRING_TYPE 3 | ||
53 | .Os | ||
54 | .Sh NAME | ||
55 | .Nm UI_get_string_type , | ||
56 | .Nm UI_get_input_flags , | ||
57 | .Nm UI_get0_output_string , | ||
58 | .Nm UI_get0_action_string , | ||
59 | .Nm UI_get0_result_string , | ||
60 | .Nm UI_get0_test_string , | ||
61 | .Nm UI_get_result_minsize , | ||
62 | .Nm UI_get_result_maxsize , | ||
63 | .Nm UI_set_result | ||
64 | .Nd OpenSSL user interface string parsing | ||
65 | .Sh SYNOPSIS | ||
66 | .In openssl/ui.h | ||
67 | .Bd -literal | ||
68 | enum UI_string_types { | ||
69 | UIT_NONE = 0, | ||
70 | UIT_PROMPT, /* Prompt for a string */ | ||
71 | UIT_VERIFY, /* Prompt for a string and verify */ | ||
72 | UIT_BOOLEAN, /* Prompt for a yes/no response */ | ||
73 | UIT_INFO, /* Send info to the user */ | ||
74 | UIT_ERROR /* Send an error message to the user */ | ||
75 | }; | ||
76 | .Ed | ||
77 | .Pp | ||
78 | .Ft enum UI_string_types | ||
79 | .Fo UI_get_string_type | ||
80 | .Fa "UI_STRING *uis" | ||
81 | .Fc | ||
82 | .Ft int | ||
83 | .Fo UI_get_input_flags | ||
84 | .Fa "UI_STRING *uis" | ||
85 | .Fc | ||
86 | .Ft const char * | ||
87 | .Fo UI_get0_output_string | ||
88 | .Fa "UI_STRING *uis" | ||
89 | .Fc | ||
90 | .Ft const char * | ||
91 | .Fo UI_get0_action_string | ||
92 | .Fa "UI_STRING *uis" | ||
93 | .Fc | ||
94 | .Ft const char * | ||
95 | .Fo UI_get0_result_string | ||
96 | .Fa "UI_STRING *uis" | ||
97 | .Fc | ||
98 | .Ft const char * | ||
99 | .Fo UI_get0_test_string | ||
100 | .Fa "UI_STRING *uis" | ||
101 | .Fc | ||
102 | .Ft int | ||
103 | .Fo UI_get_result_minsize | ||
104 | .Fa "UI_STRING *uis" | ||
105 | .Fc | ||
106 | .Ft int | ||
107 | .Fo UI_get_result_maxsize | ||
108 | .Fa "UI_STRING *uis" | ||
109 | .Fc | ||
110 | .Ft int | ||
111 | .Fo UI_set_result | ||
112 | .Fa "UI *ui" | ||
113 | .Fa "UI_STRING *uis" | ||
114 | .Fa "const char *result" | ||
115 | .Fc | ||
116 | .Sh DESCRIPTION | ||
117 | A | ||
118 | .Vt UI_STRING | ||
119 | gets created internally and added to a | ||
120 | .Vt UI | ||
121 | object whenever one of the functions | ||
122 | .Xr UI_add_input_string 3 , | ||
123 | .Xr UI_dup_input_string 3 , | ||
124 | .Xr UI_add_verify_string 3 , | ||
125 | .Xr UI_dup_verify_string 3 , | ||
126 | .Xr UI_add_input_boolean 3 , | ||
127 | .Xr UI_dup_input_boolean 3 , | ||
128 | .Xr UI_add_info_string 3 , | ||
129 | .Xr UI_dup_info_string 3 , | ||
130 | .Xr UI_add_error_string 3 | ||
131 | or | ||
132 | .Xr UI_dup_error_string 3 | ||
133 | is called. | ||
134 | For a | ||
135 | .Vt UI_METHOD | ||
136 | user, there's no need to know more. | ||
137 | For a | ||
138 | .Vt UI_METHOD | ||
139 | creator, it is of interest to fetch text from these | ||
140 | .Vt UI_STRING | ||
141 | objects as well as adding results to some of them. | ||
142 | .Pp | ||
143 | .Fn UI_get_string_type | ||
144 | is used to retrieve the type of the given | ||
145 | .Vt UI_STRING . | ||
146 | .Pp | ||
147 | .Fn UI_get_input_flags | ||
148 | is used to retrieve the flags associated with the given | ||
149 | .Vt UI_STRING . | ||
150 | .Pp | ||
151 | .Fn UI_get0_output_string | ||
152 | is used to retrieve the actual string to output (prompt, info, error, ...). | ||
153 | .Pp | ||
154 | .Fn UI_get0_action_string | ||
155 | is used to retrieve the action description associated with a | ||
156 | .Dv UIT_BOOLEAN | ||
157 | type | ||
158 | .Vt UI_STRING . | ||
159 | See | ||
160 | .Xr UI_add_input_boolean 3 . | ||
161 | .Pp | ||
162 | .Fn UI_get0_result_string | ||
163 | is used to retrieve the result of a prompt. | ||
164 | This is only useful for | ||
165 | .Dv UIT_PROMPT | ||
166 | and | ||
167 | .Dv UIT_VERIFY | ||
168 | type strings. | ||
169 | .Pp | ||
170 | .Fn UI_get0_test_string | ||
171 | is used to retrieve the string to compare the prompt result with. | ||
172 | This is only useful for | ||
173 | .Dv UIT_VERIFY | ||
174 | type strings. | ||
175 | .Pp | ||
176 | .Fn UI_get_result_minsize | ||
177 | and | ||
178 | .Fn UI_get_result_maxsize | ||
179 | are used to retrieve the minimum and maximum required size of the | ||
180 | result. | ||
181 | This is only useful for | ||
182 | .Dv UIT_PROMPT | ||
183 | and | ||
184 | .Dv UIT_VERIFY | ||
185 | type strings. | ||
186 | .Pp | ||
187 | .Fn UI_set_result | ||
188 | is used to set the result value of a prompt. | ||
189 | For | ||
190 | .Sy UIT_PROMPT | ||
191 | and | ||
192 | .Sy UIT_VERIFY | ||
193 | type UI strings, this sets the result retrievable with | ||
194 | .Fn UI_get0_result_string | ||
195 | by copying the contents of | ||
196 | .Fa result | ||
197 | if its length fits the minimum and maximum size requirements. | ||
198 | For | ||
199 | .Dv UIT_BOOLEAN | ||
200 | type UI strings, this sets the first character of the result retrievable | ||
201 | with | ||
202 | .Fn UI_get0_result_string | ||
203 | to the first of the | ||
204 | .Fa ok_chars | ||
205 | given with | ||
206 | .Xr UI_add_input_boolean 3 | ||
207 | or | ||
208 | .Xr UI_dup_input_boolean 3 | ||
209 | if the | ||
210 | .Fa result | ||
211 | matched any of them, or the first of the | ||
212 | .Fa cancel_chars | ||
213 | if the | ||
214 | .Fa result | ||
215 | matched any of them, otherwise it's set to the NUL char. | ||
216 | See | ||
217 | .Xr UI_add_input_boolean 3 | ||
218 | for more information on | ||
219 | .Fa ok_chars | ||
220 | and | ||
221 | .Fa cancel_chars . | ||
222 | .Sh RETURN VALUES | ||
223 | .Fn UI_get_string_type | ||
224 | returns the UI string type. | ||
225 | .Pp | ||
226 | .Fn UI_get_input_flags | ||
227 | returns the UI string flags. | ||
228 | .Pp | ||
229 | .Fn UI_get0_output_string | ||
230 | returns the UI string output string. | ||
231 | .Pp | ||
232 | .Fn UI_get0_action_string | ||
233 | returns the UI string action description string for | ||
234 | .Dv UIT_BOOLEAN | ||
235 | type UI strings, or | ||
236 | .Dv NULL | ||
237 | for any other type. | ||
238 | .Pp | ||
239 | .Fn UI_get0_result_string | ||
240 | returns the UI string action description string for | ||
241 | .Dv UIT_PROMPT | ||
242 | and | ||
243 | .Dv UIT_VERIFY | ||
244 | type UI strings, or | ||
245 | .Dv NULL | ||
246 | for any other type. | ||
247 | .Pp | ||
248 | .Fn UI_get0_test_string | ||
249 | returns the UI string action description string for | ||
250 | .Dv UIT_VERIFY | ||
251 | type UI strings, or | ||
252 | .Dv NULL | ||
253 | for any other type. | ||
254 | .Pp | ||
255 | .Fn UI_get_result_minsize | ||
256 | returns the minimum allowed result size for the UI string for | ||
257 | .Dv UIT_PROMPT | ||
258 | and | ||
259 | .Dv UIT_VERIFY | ||
260 | type strings, or -1 for any other type. | ||
261 | .Pp | ||
262 | .Fn UI_get_result_maxsize | ||
263 | returns the minimum allowed result size for the UI string for for | ||
264 | .Dv UIT_PROMPT | ||
265 | and | ||
266 | .Dv UIT_VERIFY | ||
267 | type strings, or -1 for any other type. | ||
268 | .Pp | ||
269 | .Fn UI_set_result | ||
270 | returns 0 on success or when the UI string is of any type other than | ||
271 | .Dv UIT_PROMPT , | ||
272 | .Dv UIT_VERIFY , | ||
273 | or | ||
274 | .Dv UIT_BOOLEAN , | ||
275 | or -1 on error. | ||
276 | .Sh SEE ALSO | ||
277 | .Xr UI_new 3 | ||
diff --git a/src/lib/libcrypto/man/UI_new.3 b/src/lib/libcrypto/man/UI_new.3 index 0974b00b02..2b0ce5b557 100644 --- a/src/lib/libcrypto/man/UI_new.3 +++ b/src/lib/libcrypto/man/UI_new.3 | |||
@@ -1,8 +1,9 @@ | |||
1 | .\" $OpenBSD: UI_new.3,v 1.5 2017/01/06 18:46:38 schwarze Exp $ | 1 | .\" $OpenBSD: UI_new.3,v 1.6 2017/03/26 00:06:10 schwarze Exp $ |
2 | .\" OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 | 2 | .\" OpenSSL UI_new.pod 5469600e Mar 11 00:51:53 2017 +0100 |
3 | .\" OpenSSL UI_new.pod 99d63d46 Oct 26 13:56:48 2016 -0400 | ||
3 | .\" | 4 | .\" |
4 | .\" This file was written by Richard Levitte <levitte@openssl.org>. | 5 | .\" This file was written by Richard Levitte <levitte@openssl.org>. |
5 | .\" Copyright (c) 2001, 2016 The OpenSSL Project. All rights reserved. | 6 | .\" Copyright (c) 2001, 2016, 2017 The OpenSSL Project. All rights reserved. |
6 | .\" | 7 | .\" |
7 | .\" Redistribution and use in source and binary forms, with or without | 8 | .\" Redistribution and use in source and binary forms, with or without |
8 | .\" modification, are permitted provided that the following conditions | 9 | .\" modification, are permitted provided that the following conditions |
@@ -48,7 +49,7 @@ | |||
48 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | 49 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED |
49 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | 50 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. |
50 | .\" | 51 | .\" |
51 | .Dd $Mdocdate: January 6 2017 $ | 52 | .Dd $Mdocdate: March 26 2017 $ |
52 | .Dt UI_NEW 3 | 53 | .Dt UI_NEW 3 |
53 | .Os | 54 | .Os |
54 | .Sh NAME | 55 | .Sh NAME |
@@ -228,12 +229,8 @@ | |||
228 | .Sh DESCRIPTION | 229 | .Sh DESCRIPTION |
229 | UI stands for User Interface, and is a general purpose set of routines | 230 | UI stands for User Interface, and is a general purpose set of routines |
230 | to prompt the user for text-based information. | 231 | to prompt the user for text-based information. |
231 | Through user-written methods (see the functions | 232 | Through user-written methods (see |
232 | .Fn UI_create_method | 233 | .Xr UI_create_method 3 ) , |
233 | and | ||
234 | .Fn UI_method_set_* | ||
235 | declared in | ||
236 | .In openssl/ui.h ) , | ||
237 | prompting can be done in any way imaginable, be it plain text prompting, | 234 | prompting can be done in any way imaginable, be it plain text prompting, |
238 | through dialog boxes or from a cell phone. | 235 | through dialog boxes or from a cell phone. |
239 | .Pp | 236 | .Pp |
@@ -402,7 +399,8 @@ indexed by | |||
402 | .Pp | 399 | .Pp |
403 | .Fn UI_process | 400 | .Fn UI_process |
404 | goes through the information given so far, does all the printing and | 401 | goes through the information given so far, does all the printing and |
405 | prompting and returns. | 402 | prompting and returns the final status, which is -2 on out-of-band |
403 | events (Interrupt, Cancel, ...), -1 on error, or 0 on success. | ||
406 | .Pp | 404 | .Pp |
407 | .Fn UI_ctrl | 405 | .Fn UI_ctrl |
408 | adds extra control for the application author. | 406 | adds extra control for the application author. |
@@ -432,7 +430,10 @@ returns the UI method associated with a given | |||
432 | changes the UI method associated with a given | 430 | changes the UI method associated with a given |
433 | .Fa ui . | 431 | .Fa ui . |
434 | .Sh SEE ALSO | 432 | .Sh SEE ALSO |
435 | .Xr des_read_pw 3 | 433 | .Xr des_read_pw 3 , |
434 | .Xr UI_create_method 3 , | ||
435 | .Xr UI_get_string_type 3 , | ||
436 | .Xr UI_UTIL_read_pw 3 | ||
436 | .Sh HISTORY | 437 | .Sh HISTORY |
437 | The UI section was first introduced in OpenSSL 0.9.7. | 438 | The UI section was first introduced in OpenSSL 0.9.7. |
438 | .Sh AUTHORS | 439 | .Sh AUTHORS |