Fix bug where old i counter used instead of ret val for arg location

pull/115/head
kaleb-himes 2019-01-12 14:37:34 -08:00
parent 891effdc58
commit 6d8f7b62b3
3 changed files with 8 additions and 3 deletions

View File

@ -6,7 +6,8 @@ This is the wolfSSL: Command Line Utility (wolfCLU).
To use this feature, please configure and install wolfssl with the following commands:
./configure --enable-pwdbased --enable-opensslextra --enable-keygen --enable-ed25519
./configure --enable-pwdbased --enable-opensslextra --enable-keygen \
--enable-ed25519 --enable-certgen \
&& make && make check
If that succeeds, run:

View File

@ -33,7 +33,7 @@ enum {
RSA,
ECC,
ED25519,
CERT_SHA,
CERT_SHA224,
CERT_SHA256,

View File

@ -88,10 +88,14 @@ int wolfCLU_hashSetup(int argc, char** argv)
return FATAL_ERROR;
}
/* returns location of the arg in question if present */
ret = wolfCLU_checkForArg("-in", 3, argc, argv);
if (ret > 0) {
/* input file/text */
in = XMALLOC(strlen(argv[i+1])+1, HEAP_HINT, DYNAMIC_TYPE_TMP_BUFFER);
int argLen = (int) XSTRLEN(argv[ret+1]);
int fullLen = (int) ((argLen + 1) * sizeof(char));
in = XMALLOC(fullLen, HEAP_HINT, DYNAMIC_TYPE_TMP_BUFFER);
if (in == NULL)
return MEMORY_E;