Merge pull request #115 from kaleb-himes/BUG_FIX

Fix bug where old i counter used instead of ret val for arg location
pull/121/head
David Garske 2019-01-12 15:14:30 -08:00 committed by GitHub
commit c3d151c71a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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: 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 && make && make check
If that succeeds, run: If that succeeds, run:

View File

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

View File

@ -88,10 +88,14 @@ int wolfCLU_hashSetup(int argc, char** argv)
return FATAL_ERROR; return FATAL_ERROR;
} }
/* returns location of the arg in question if present */
ret = wolfCLU_checkForArg("-in", 3, argc, argv); ret = wolfCLU_checkForArg("-in", 3, argc, argv);
if (ret > 0) { if (ret > 0) {
/* input file/text */ /* 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) if (in == NULL)
return MEMORY_E; return MEMORY_E;