summaryrefslogtreecommitdiff
path: root/src
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:51:04 +0100
commit1cb97271714e50c562e857a943cc156382cb1a78 (patch)
tree15723c3ff1055141894483e75a873188424b37c7 /src
parent5422a033b20af8b1bf984fb50c414bc05c9ad9ad (diff)
downloadgnutls-1cb97271714e50c562e857a943cc156382cb1a78.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>
Diffstat (limited to 'src')
-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 2f4a4ee966..9b37665e0e 100644
--- a/src/certtool-cfg.c
+++ b/src/certtool-cfg.c
@@ -477,11 +477,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);
@@ -503,7 +504,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);
@@ -528,7 +529,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)
@@ -584,7 +585,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);
@@ -609,7 +610,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);