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:01:40 +0100
commit44dbb61e9d5fabed7dfae5a8b8defec07ffe8ac4 (patch)
tree33735a1558f1315de124ca3f23085da1b9fe4ad5
parentc08e8772b43bc96565f388292a699d2f4261bd80 (diff)
downloadgnutls-44dbb61e9d5fabed7dfae5a8b8defec07ffe8ac4.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);