From e65d72125fdfd468f3f6691b9bd77b67dc973ebe Mon Sep 17 00:00:00 2001 From: tb Date: Tue, 19 May 2026 09:17:44 +0000 Subject: [PATCH] libcrypto/ui: move ui_string_st to ui_lib.c. It's only used there. --- lib/libcrypto/ui/ui_lib.c | 35 ++++++++++++++++++++++++++++++++++- lib/libcrypto/ui/ui_local.h | 35 +---------------------------------- 2 files changed, 35 insertions(+), 35 deletions(-) diff --git a/lib/libcrypto/ui/ui_lib.c b/lib/libcrypto/ui/ui_lib.c index cc9de59c199..e7587beea1d 100644 --- a/lib/libcrypto/ui/ui_lib.c +++ b/lib/libcrypto/ui/ui_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ui_lib.c,v 1.52 2025/05/10 05:54:39 tb Exp $ */ +/* $OpenBSD: ui_lib.c,v 1.53 2026/05/19 09:17:44 tb Exp $ */ /* Written by Richard Levitte (richard@levitte.org) for the OpenSSL * project 2001. */ @@ -68,6 +68,39 @@ static const UI_METHOD *default_UI_meth = NULL; +struct ui_string_st { + enum UI_string_types type; /* Input */ + const char *out_string; /* Input */ + int input_flags; /* Flags from the user */ + + /* The following parameters are completely irrelevant for UIT_INFO, + and can therefore be set to 0 or NULL */ + char *result_buf; /* Input and Output: If not NULL, user-defined + with size in result_maxsize. Otherwise, it + may be allocated by the UI routine, meaning + result_minsize is going to be overwritten.*/ + union { + struct { + int result_minsize; /* Input: minimum required + size of the result. + */ + int result_maxsize; /* Input: maximum permitted + size of the result */ + + const char *test_buf; /* Input: test string to verify + against */ + } string_data; + struct { + const char *action_desc; /* Input */ + const char *ok_chars; /* Input */ + const char *cancel_chars; /* Input */ + } boolean_data; + } _; + +#define OUT_STRING_FREEABLE 0x01 + int flags; /* flags for internal use */ +}; + UI * UI_new(void) { diff --git a/lib/libcrypto/ui/ui_local.h b/lib/libcrypto/ui/ui_local.h index 460b5600bdd..065dc0b11f2 100644 --- a/lib/libcrypto/ui/ui_local.h +++ b/lib/libcrypto/ui/ui_local.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ui_local.h,v 1.2 2022/11/26 17:23:18 tb Exp $ */ +/* $OpenBSD: ui_local.h,v 1.3 2026/05/19 09:17:44 tb Exp $ */ /* Written by Richard Levitte (richard@levitte.org) for the OpenSSL * project 2001. @@ -101,39 +101,6 @@ struct ui_method_st { const char *object_name); }; -struct ui_string_st { - enum UI_string_types type; /* Input */ - const char *out_string; /* Input */ - int input_flags; /* Flags from the user */ - - /* The following parameters are completely irrelevant for UIT_INFO, - and can therefore be set to 0 or NULL */ - char *result_buf; /* Input and Output: If not NULL, user-defined - with size in result_maxsize. Otherwise, it - may be allocated by the UI routine, meaning - result_minsize is going to be overwritten.*/ - union { - struct { - int result_minsize; /* Input: minimum required - size of the result. - */ - int result_maxsize; /* Input: maximum permitted - size of the result */ - - const char *test_buf; /* Input: test string to verify - against */ - } string_data; - struct { - const char *action_desc; /* Input */ - const char *ok_chars; /* Input */ - const char *cancel_chars; /* Input */ - } boolean_data; - } _; - -#define OUT_STRING_FREEABLE 0x01 - int flags; /* flags for internal use */ -}; - struct ui_st { const UI_METHOD *meth; STACK_OF(UI_STRING) *strings; /* We might want to prompt for more