UI_dup_input_boolean, UI_add_info_string, UI_dup_info_string,
UI_add_error_string, UI_dup_error_string, UI_construct_prompt,
UI_add_user_data, UI_dup_user_data, UI_get0_user_data, UI_get0_result,
+UI_get_result_length,
UI_process, UI_ctrl, UI_set_default_method, UI_get_default_method,
UI_get_method, UI_set_method, UI_OpenSSL, UI_null - user interface
void *UI_get0_user_data(UI *ui);
const char *UI_get0_result(UI *ui, int i);
+ int UI_get_result_length(UI *ui, int i);
int UI_process(UI *ui);
through calls to UI_add_user_data() or UI_dup_user_data(). The default
UI method doesn't care about these data, but other methods might. Finally,
use UI_process() to actually perform the prompting and UI_get0_result()
-to find the result to the prompt.
+and UI_get_result_length() to find the result to the prompt and its length.
A UI can contain more than one prompt, which are performed in the given
sequence. Each prompt gets an index number which is returned by the
UI_add and UI_dup functions, and has to be used to get the corresponding
-result with UI_get0_result().
+result with UI_get0_result() and UI_get_result_length().
UI_process() can be called more than once on the same UI, thereby allowing
a UI to have a long lifetime, but can just as well have a short lifetime.
UI_new_method() creates a new UI using the given UI method. When done with
this UI, it should be freed using UI_free().
-UI_OpenSSL() returns the built-in UI method (note: not necessarely the
+UI_OpenSSL() returns the built-in UI method (note: not necessarily the
default one, since the default can be changed. See further on). This
method is the most machine/OS dependent part of OpenSSL and normally
generates the most problems when porting.
UI_get0_result() returns a pointer to the result buffer associated with
the information indexed by I<i>.
+UI_get_result_length() returns the length of the result buffer associated with
+the information indexed by I<i>.
+
UI_process() goes through the information given so far, does all the printing
and prompting and returns the final status, which is -2 on out-of-band events
(Interrupt, Cancel, ...), -1 on error and 0 on success.
the built-in method UI_OpenSSL() will produce UTF-8 encoded strings
instead.
+=head1 RETURN VALUES
+
+UI_new() and UI_new_method() return a valid B<UI> structure or NULL if an error
+occurred.
+
+UI_add_input_string(), UI_dup_input_string(), UI_add_verify_string(),
+UI_dup_verify_string(), UI_add_input_boolean(), UI_dup_input_boolean(),
+UI_add_info_string(), UI_dup_info_string(), UI_add_error_string()
+and UI_dup_error_string() return a positive number on success or a value which
+is less than or equal to 0 otherwise.
+
+UI_construct_prompt() returns a string or NULL if an error occurred.
+
+UI_dup_user_data() returns 0 on success or -1 on error.
+
+UI_get0_result() returns a string or NULL on error.
+
+UI_get_result_length() returns a positive integer or 0 on success; otherwise it
+returns -1 on error.
+
+UI_process() returns 0 on success or a negative value on error.
+
+UI_ctrl() returns a mask on success or -1 on error.
+
+UI_get_default_method(), UI_get_method(), UI_Openssl(), UI_null() and
+UI_set_method() return either a valid B<UI_METHOD> structure or NULL
+respectively.
+
=head1 HISTORY
UI_dup_user_data()
=head1 COPYRIGHT
-Copyright 2001-2017 The OpenSSL Project Authors. All Rights Reserved.
+Copyright 2001-2018 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the OpenSSL license (the "License"). You may not use
this file except in compliance with the License. You can obtain a copy