summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/ui/ui.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/ui/ui.h')
-rw-r--r--src/lib/libcrypto/ui/ui.h41
1 files changed, 20 insertions, 21 deletions
diff --git a/src/lib/libcrypto/ui/ui.h b/src/lib/libcrypto/ui/ui.h
index ed35e50eb4..7970f893d6 100644
--- a/src/lib/libcrypto/ui/ui.h
+++ b/src/lib/libcrypto/ui/ui.h
@@ -10,7 +10,7 @@
10 * are met: 10 * are met:
11 * 11 *
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 14 *
15 * 2. Redistributions in binary form must reproduce the above copyright 15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in 16 * notice, this list of conditions and the following disclaimer in
@@ -128,19 +128,19 @@ void UI_free(UI *ui);
128 On success, the all return an index of the added information. That index 128 On success, the all return an index of the added information. That index
129 is usefull when retrieving results with UI_get0_result(). */ 129 is usefull when retrieving results with UI_get0_result(). */
130int UI_add_input_string(UI *ui, const char *prompt, int flags, 130int UI_add_input_string(UI *ui, const char *prompt, int flags,
131 char *result_buf, int minsize, int maxsize); 131 char *result_buf, int minsize, int maxsize);
132int UI_dup_input_string(UI *ui, const char *prompt, int flags, 132int UI_dup_input_string(UI *ui, const char *prompt, int flags,
133 char *result_buf, int minsize, int maxsize); 133 char *result_buf, int minsize, int maxsize);
134int UI_add_verify_string(UI *ui, const char *prompt, int flags, 134int UI_add_verify_string(UI *ui, const char *prompt, int flags,
135 char *result_buf, int minsize, int maxsize, const char *test_buf); 135 char *result_buf, int minsize, int maxsize, const char *test_buf);
136int UI_dup_verify_string(UI *ui, const char *prompt, int flags, 136int UI_dup_verify_string(UI *ui, const char *prompt, int flags,
137 char *result_buf, int minsize, int maxsize, const char *test_buf); 137 char *result_buf, int minsize, int maxsize, const char *test_buf);
138int UI_add_input_boolean(UI *ui, const char *prompt, const char *action_desc, 138int UI_add_input_boolean(UI *ui, const char *prompt, const char *action_desc,
139 const char *ok_chars, const char *cancel_chars, 139 const char *ok_chars, const char *cancel_chars,
140 int flags, char *result_buf); 140 int flags, char *result_buf);
141int UI_dup_input_boolean(UI *ui, const char *prompt, const char *action_desc, 141int UI_dup_input_boolean(UI *ui, const char *prompt, const char *action_desc,
142 const char *ok_chars, const char *cancel_chars, 142 const char *ok_chars, const char *cancel_chars,
143 int flags, char *result_buf); 143 int flags, char *result_buf);
144int UI_add_info_string(UI *ui, const char *text); 144int UI_add_info_string(UI *ui, const char *text);
145int UI_dup_info_string(UI *ui, const char *text); 145int UI_dup_info_string(UI *ui, const char *text);
146int UI_add_error_string(UI *ui, const char *text); 146int UI_add_error_string(UI *ui, const char *text);
@@ -185,8 +185,8 @@ int UI_dup_error_string(UI *ui, const char *text);
185 185
186 "Enter pass phrase for foo.key:" 186 "Enter pass phrase for foo.key:"
187*/ 187*/
188char *UI_construct_prompt(UI *ui_method, 188char *UI_construct_prompt(UI *ui_method, const char *object_desc,
189 const char *object_desc, const char *object_name); 189 const char *object_name);
190 190
191 191
192/* The following function is used to store a pointer to user-specific data. 192/* The following function is used to store a pointer to user-specific data.
@@ -228,8 +228,8 @@ int UI_ctrl(UI *ui, int cmd, long i, void *p, void (*f)(void));
228#define UI_set_app_data(s,arg) UI_set_ex_data(s,0,arg) 228#define UI_set_app_data(s,arg) UI_set_ex_data(s,0,arg)
229#define UI_get_app_data(s) UI_get_ex_data(s,0) 229#define UI_get_app_data(s) UI_get_ex_data(s,0)
230int UI_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, 230int UI_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
231 CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); 231 CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);
232int UI_set_ex_data(UI *r,int idx,void *arg); 232int UI_set_ex_data(UI *r, int idx, void *arg);
233void *UI_get_ex_data(UI *r, int idx); 233void *UI_get_ex_data(UI *r, int idx);
234 234
235/* Use specific methods instead of the built-in one */ 235/* Use specific methods instead of the built-in one */
@@ -292,15 +292,14 @@ DECLARE_STACK_OF(UI_STRING)
292 292
293/* The different types of strings that are currently supported. 293/* The different types of strings that are currently supported.
294 This is only needed by method authors. */ 294 This is only needed by method authors. */
295enum UI_string_types 295enum UI_string_types {
296 { 296 UIT_NONE = 0,
297 UIT_NONE=0,
298 UIT_PROMPT, /* Prompt for a string */ 297 UIT_PROMPT, /* Prompt for a string */
299 UIT_VERIFY, /* Prompt for a string and verify */ 298 UIT_VERIFY, /* Prompt for a string and verify */
300 UIT_BOOLEAN, /* Prompt for a yes/no response */ 299 UIT_BOOLEAN, /* Prompt for a yes/no response */
301 UIT_INFO, /* Send info to the user */ 300 UIT_INFO, /* Send info to the user */
302 UIT_ERROR /* Send an error message to the user */ 301 UIT_ERROR /* Send an error message to the user */
303 }; 302};
304 303
305/* Create and manipulate methods */ 304/* Create and manipulate methods */
306UI_METHOD *UI_create_method(char *name); 305UI_METHOD *UI_create_method(char *name);
@@ -312,9 +311,9 @@ int UI_method_set_reader(UI_METHOD *method, int (*reader)(UI *ui, UI_STRING *uis
312int UI_method_set_closer(UI_METHOD *method, int (*closer)(UI *ui)); 311int UI_method_set_closer(UI_METHOD *method, int (*closer)(UI *ui));
313int UI_method_set_prompt_constructor(UI_METHOD *method, char *(*prompt_constructor)(UI* ui, const char* object_desc, const char* object_name)); 312int UI_method_set_prompt_constructor(UI_METHOD *method, char *(*prompt_constructor)(UI* ui, const char* object_desc, const char* object_name));
314int (*UI_method_get_opener(UI_METHOD *method))(UI*); 313int (*UI_method_get_opener(UI_METHOD *method))(UI*);
315int (*UI_method_get_writer(UI_METHOD *method))(UI*,UI_STRING*); 314int (*UI_method_get_writer(UI_METHOD *method))(UI*, UI_STRING*);
316int (*UI_method_get_flusher(UI_METHOD *method))(UI*); 315int (*UI_method_get_flusher(UI_METHOD *method))(UI*);
317int (*UI_method_get_reader(UI_METHOD *method))(UI*,UI_STRING*); 316int (*UI_method_get_reader(UI_METHOD *method))(UI*, UI_STRING*);
318int (*UI_method_get_closer(UI_METHOD *method))(UI*); 317int (*UI_method_get_closer(UI_METHOD *method))(UI*);
319char * (*UI_method_get_prompt_constructor(UI_METHOD *method))(UI*, const char*, const char*); 318char * (*UI_method_get_prompt_constructor(UI_METHOD *method))(UI*, const char*, const char*);
320 319
@@ -342,8 +341,8 @@ int UI_set_result(UI *ui, UI_STRING *uis, const char *result);
342 341
343 342
344/* A couple of popular utility functions */ 343/* A couple of popular utility functions */
345int UI_UTIL_read_pw_string(char *buf,int length,const char *prompt,int verify); 344int UI_UTIL_read_pw_string(char *buf, int length, const char *prompt, int verify);
346int UI_UTIL_read_pw(char *buf,char *buff,int size,const char *prompt,int verify); 345int UI_UTIL_read_pw(char *buf, char *buff, int size, const char *prompt, int verify);
347 346
348 347
349/* BEGIN ERROR CODES */ 348/* BEGIN ERROR CODES */