summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/lib/apps.c3
-rw-r--r--apps/pkeyutl.c2
2 files changed, 3 insertions, 2 deletions
diff --git a/apps/lib/apps.c b/apps/lib/apps.c
index 891af71730..bbaecb8c72 100644
--- a/apps/lib/apps.c
+++ b/apps/lib/apps.c
@@ -2003,7 +2003,8 @@ int bio_to_mem(unsigned char **out, int maxlen, BIO *in)
BIO_free(mem);
return -1;
}
- maxlen -= len;
+ if (maxlen != -1)
+ maxlen -= len;
if (maxlen == 0)
break;
diff --git a/apps/pkeyutl.c b/apps/pkeyutl.c
index 518a741661..d6d1d49d5d 100644
--- a/apps/pkeyutl.c
+++ b/apps/pkeyutl.c
@@ -421,7 +421,7 @@ int pkeyutl_main(int argc, char **argv)
/* Raw input data is handled elsewhere */
if (in != NULL && !rawin) {
/* Read the input data */
- buf_inlen = bio_to_mem(&buf_in, keysize * 10, in);
+ buf_inlen = bio_to_mem(&buf_in, -1, in);
if (buf_inlen < 0) {
BIO_printf(bio_err, "Error reading input Data\n");
goto end;