From: Eugene Syromiatnikov Date: Thu, 4 Sep 2025 14:37:02 +0000 (+0200) Subject: apps: remove chopup_args() X-Git-Tag: openssl-3.0.18~40 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=416c27e09991bf53a6522e885732eb53300a0a1a;p=thirdparty%2Fopenssl.git apps: remove chopup_args() The last (and only?) user has been removed in commit eca471391378 "APPS: Drop interactive mode in the 'openssl' program". Complements: eca471391378 "APPS: Drop interactive mode in the 'openssl' program" Signed-off-by: Eugene Syromiatnikov Reviewed-by: Dmitry Belyavskiy Reviewed-by: Paul Dale Reviewed-by: Neil Horman (Merged from https://github.com/openssl/openssl/pull/28441) (cherry picked from commit 3f77491cb336df843984139fbb6fb16f47daf876) --- diff --git a/apps/include/apps.h b/apps/include/apps.h index baacd0025d6..d63b33f1b93 100644 --- a/apps/include/apps.h +++ b/apps/include/apps.h @@ -94,7 +94,6 @@ typedef struct args_st { /* We need both wrap and the "real" function because libcrypto uses both. */ int wrap_password_callback(char *buf, int bufsiz, int verify, void *cb_data); -int chopup_args(ARGS *arg, char *buf); void dump_cert_text(BIO *out, X509 *x); void print_name(BIO *out, const char *title, const X509_NAME *nm); void print_bignum_var(BIO *, const BIGNUM *, const char*, diff --git a/apps/lib/apps.c b/apps/lib/apps.c index b4c4148c2ec..ea827464dda 100644 --- a/apps/lib/apps.c +++ b/apps/lib/apps.c @@ -90,54 +90,6 @@ int load_key_certs_crls_suppress(const char *uri, int format, int maybe_stdin, int app_init(long mesgwin); -int chopup_args(ARGS *arg, char *buf) -{ - int quoted; - char c = '\0', *p = NULL; - - arg->argc = 0; - if (arg->size == 0) { - arg->size = 20; - arg->argv = app_malloc(sizeof(*arg->argv) * arg->size, "argv space"); - } - - for (p = buf;;) { - /* Skip whitespace. */ - while (*p && isspace(_UC(*p))) - p++; - if (*p == '\0') - break; - - /* The start of something good :-) */ - if (arg->argc >= arg->size) { - char **tmp; - arg->size += 20; - tmp = OPENSSL_realloc(arg->argv, sizeof(*arg->argv) * arg->size); - if (tmp == NULL) - return 0; - arg->argv = tmp; - } - quoted = *p == '\'' || *p == '"'; - if (quoted) - c = *p++; - arg->argv[arg->argc++] = p; - - /* now look for the end of this */ - if (quoted) { - while (*p && *p != c) - p++; - *p++ = '\0'; - } else { - while (*p && !isspace(_UC(*p))) - p++; - if (*p) - *p++ = '\0'; - } - } - arg->argv[arg->argc] = NULL; - return 1; -} - #ifndef APP_INIT int app_init(long mesgwin) {