aboutsummaryrefslogtreecommitdiff
path: root/include/openssl/ui.h
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2017-07-01 12:39:51 +0200
committerRichard Levitte <levitte@openssl.org>2017-09-08 20:06:06 +0200
commit4e049e2c3658ee2bc6e63e696a3779d2f9eed377 (patch)
tree3991cd2f4d5fb0d64b515dcc5bcc8a12443454e7 /include/openssl/ui.h
parenta8c5ed812d1537728807059b4182d358bb2ca7c1 (diff)
downloadopenssl-4e049e2c3658ee2bc6e63e696a3779d2f9eed377.zip
openssl-4e049e2c3658ee2bc6e63e696a3779d2f9eed377.tar.gz
openssl-4e049e2c3658ee2bc6e63e696a3779d2f9eed377.tar.bz2
Add UI functions to set result with explicit length and to retrieve the length
This allows completely arbitrary passphrases to be entered, including NUL bytes. Reviewed-by: Ben Kaduk <kaduk@mit.edu> (Merged from https://github.com/openssl/openssl/pull/3821)
Diffstat (limited to 'include/openssl/ui.h')
-rw-r--r--include/openssl/ui.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/openssl/ui.h b/include/openssl/ui.h
index 0f8c03f..a024674 100644
--- a/include/openssl/ui.h
+++ b/include/openssl/ui.h
@@ -175,6 +175,7 @@ void *UI_get0_user_data(UI *ui);
/* Return the result associated with a prompt given with the index i. */
const char *UI_get0_result(UI *ui, int i);
+int UI_get_result_length(UI *ui, int i);
/* When all strings have been added, process the whole thing. */
int UI_process(UI *ui);
@@ -340,6 +341,7 @@ const char *UI_get0_output_string(UI_STRING *uis);
const char *UI_get0_action_string(UI_STRING *uis);
/* Return the result of a prompt */
const char *UI_get0_result_string(UI_STRING *uis);
+int UI_get_result_string_length(UI_STRING *uis);
/*
* Return the string to test the result against. Only useful with verifies.
*/
@@ -350,6 +352,7 @@ int UI_get_result_minsize(UI_STRING *uis);
int UI_get_result_maxsize(UI_STRING *uis);
/* Set the result of a UI_STRING. */
int UI_set_result(UI *ui, UI_STRING *uis, const char *result);
+int UI_set_result_ex(UI *ui, UI_STRING *uis, const char *result, int len);
/* A couple of popular utility functions */
int UI_UTIL_read_pw_string(char *buf, int length, const char *prompt,