From: Nikos Mavrogiannopoulos Date: Tue, 28 Feb 2017 07:00:56 +0000 (+0100) Subject: certtool: increased buffer for reading from user X-Git-Tag: gnutls_3_6_0~936 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=44dbb61e9d5fabed7dfae5a8b8defec07ffe8ac4;p=thirdparty%2Fgnutls.git certtool: increased buffer for reading from user This allows reading longer than 128-byte fields interactively. The new limit is 512-bytes. Relates #179 Signed-off-by: Nikos Mavrogiannopoulos --- diff --git a/src/certtool-cfg.c b/src/certtool-cfg.c index 7bbab9c423..73f273d43f 100644 --- a/src/certtool-cfg.c +++ b/src/certtool-cfg.c @@ -554,11 +554,12 @@ int template_parse(const char *template) } #define IS_NEWLINE(x) ((x[0] == '\n') || (x[0] == '\r')) +#define MAX_INPUT_SIZE 512 void read_crt_set(gnutls_x509_crt_t crt, const char *input_str, const char *oid) { - char input[128]; + char input[MAX_INPUT_SIZE]; int ret; fputs(input_str, stderr); @@ -580,7 +581,7 @@ read_crt_set(gnutls_x509_crt_t crt, const char *input_str, const char *oid) void read_crq_set(gnutls_x509_crq_t crq, const char *input_str, const char *oid) { - char input[128]; + char input[MAX_INPUT_SIZE]; int ret; fputs(input_str, stderr); @@ -605,7 +606,7 @@ static int64_t read_int_with_default(const char *input_str, long def) { char *endptr; int64_t l; - static char input[128]; + static char input[MAX_INPUT_SIZE]; fprintf(stderr, input_str, def); if (fgets(input, sizeof(input), stdin) == NULL) @@ -661,7 +662,7 @@ int64_t read_int(const char *input_str) const char *read_str(const char *input_str) { - static char input[128]; + static char input[MAX_INPUT_SIZE]; int len; fputs(input_str, stderr); @@ -686,7 +687,7 @@ const char *read_str(const char *input_str) */ int read_yesno(const char *input_str, int def) { - char input[128]; + char input[MAX_INPUT_SIZE]; restart: fputs(input_str, stderr);