summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2017-02-28 08:00:56 +0100
committerNikos Mavrogiannopoulos <nmav@redhat.com>2017-02-28 08:49:54 +0100
commitf7a80fc0c3d6ba06ee4a7c66f8a7c5c29adec9a1 (patch)
treeb7305a90bb5c303d1fd205490f20695ba2bfabc3
parentd662a4cf408cd1a3bb22d320f8a6fac374d1b003 (diff)
downloadgnutls-f7a80fc0c3d6ba06ee4a7c66f8a7c5c29adec9a1.tar.gz
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 <nmav@redhat.com>
-rw-r--r--src/certtool-cfg.c11
1 files changed, 6 insertions, 5 deletions
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);