Skip to content

Commit d830c2e

Browse files
Merge pull request #113 from lealem47/release
Release v0.1.0
2 parents c5bde28 + a0b7a56 commit d830c2e

24 files changed

+138
-96
lines changed

ChangeLog.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,31 @@
1+
# wolfCLU v0.1.0 (Sep 12, 2022)
2+
### Fixes and Enhancements
3+
- Fix for buffer issue with s_client
4+
- Add fsanitize testing with github actions
5+
- Update dhparam to read mod size from different location in arguments
6+
- Fix for x509 encoding modifying the cert
7+
- Fix for supporting more alt names and skipping count
8+
- Add -CAfile and verify_return_error flags for s_client command
9+
- Expand testing with additional unit tests and Jenkins nightly test
10+
- Fix for enc edge cases
11+
- Fix x509 command to use piped input
12+
- Support for building on Windows
13+
- Add -pass flag to enc command
14+
- Add -partial_chain arg for verify command
15+
- Add -modulus flag for x509 command
16+
- Handle additional CSR attribute print outs
17+
- Add -passout flag to req command
18+
- Fix for enc with nosalt
19+
- Update m4 files
20+
- Fix for parsing basic constraint from conf file
21+
- Improve error logging
22+
- IPV6 parsing support for s_client command
23+
- Support for building with FIPS wolfSSL
24+
- Add -text flag for crl command
25+
- Support for building on FreeRTOS
26+
- Add disable filesystem configure
27+
- Support for creating req with attributes
28+
129
# wolfCLU v0.0.8 (Mar 04, 2022)
230
### Commands Added
331
- Add rand command

configure.ac

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# configure.ac
22
#
3-
# Copyright (C) 2006-2020 wolfSSL Inc.
3+
# Copyright (C) 2006-2022 wolfSSL Inc.
44
# All rights reserved.
55
#
66
# This file is part of wolfssl command line utility.
@@ -10,7 +10,7 @@
1010
#requires user to have AutoConf version 2.63 or greater.
1111
AC_PREREQ([2.63])
1212

13-
AC_INIT([wolfclu], [0.0.8], [http://www.wolfssl.com])
13+
AC_INIT([wolfclu], [0.1.0], [http://www.wolfssl.com])
1414

1515
#a helpful directory to keep clutter out of root
1616
AC_CONFIG_AUX_DIR([build-aux])

src/benchmark/clu_benchmark.c

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#endif /* HAVE_BLAKE2 */
3030

3131
/*
32-
* benchmarking funciton
32+
* benchmarking funciton
3333
*/
3434
int wolfCLU_benchmark(int timer, int* option)
3535
{
@@ -47,7 +47,6 @@ int wolfCLU_benchmark(int timer, int* option)
4747

4848
WC_RNG rng; /* random number generator */
4949

50-
int ret = 0; /* return variable */
5150
double stop = 0.0; /* stop breaks loop */
5251
double start; /* start time */
5352
double currTime; /* current time*/
@@ -120,7 +119,6 @@ int wolfCLU_benchmark(int timer, int* option)
120119
loop = 1;
121120
}
122121
i++;
123-
ret = WOLFCLU_SUCCESS;
124122
#endif
125123
#ifdef WOLFSSL_AES_COUNTER
126124
/* aes-ctr test */
@@ -171,7 +169,6 @@ int wolfCLU_benchmark(int timer, int* option)
171169
loop = 1;
172170
}
173171
i++;
174-
ret = WOLFCLU_SUCCESS;
175172
#endif
176173
#ifndef NO_DES3
177174
/* 3des test */
@@ -223,7 +220,6 @@ int wolfCLU_benchmark(int timer, int* option)
223220
loop = 1;
224221
}
225222
i++;
226-
ret = WOLFCLU_SUCCESS;
227223
#endif
228224
#ifdef HAVE_CAMELLIA
229225
#define CAM_SZ CAMELLIA_BLOCK_SIZE
@@ -278,7 +274,6 @@ int wolfCLU_benchmark(int timer, int* option)
278274
loop = 1;
279275
}
280276
i++;
281-
ret = WOLFCLU_SUCCESS;
282277
#endif
283278
#ifndef NO_MD5
284279
/* md5 test */
@@ -317,7 +312,6 @@ int wolfCLU_benchmark(int timer, int* option)
317312
loop = 1;
318313
}
319314
i++;
320-
ret = WOLFCLU_SUCCESS;
321315
#endif
322316
#ifndef NO_SHA
323317
/* sha test */
@@ -356,7 +350,6 @@ int wolfCLU_benchmark(int timer, int* option)
356350
loop = 1;
357351
}
358352
i++;
359-
ret = WOLFCLU_SUCCESS;
360353
#endif
361354
#ifndef NO_SHA256
362355
#define SHA256_SZ WC_SHA256_DIGEST_SIZE
@@ -397,7 +390,6 @@ int wolfCLU_benchmark(int timer, int* option)
397390
loop = 1;
398391
}
399392
i++;
400-
ret = WOLFCLU_SUCCESS;
401393
#endif
402394
#ifdef WOLFSSL_SHA384
403395
#define SHA384_SZ WC_SHA384_DIGEST_SIZE
@@ -437,7 +429,6 @@ int wolfCLU_benchmark(int timer, int* option)
437429
loop = 1;
438430
}
439431
i++;
440-
ret = WOLFCLU_SUCCESS;
441432
#endif
442433
#ifdef WOLFSSL_SHA512
443434
#define SHA512_SZ WC_SHA512_DIGEST_SIZE
@@ -477,7 +468,6 @@ int wolfCLU_benchmark(int timer, int* option)
477468
loop = 1;
478469
}
479470
i++;
480-
ret = WOLFCLU_SUCCESS;
481471
#endif
482472
#ifdef HAVE_BLAKE2
483473
/* blake2b test */
@@ -513,10 +503,9 @@ int wolfCLU_benchmark(int timer, int* option)
513503
XMEMSET(digest, 0, BLAKE2B_OUTBYTES);
514504
wolfCLU_freeBins(digest, plain, NULL, NULL, NULL);
515505
}
516-
ret = WOLFCLU_SUCCESS;
517506
#endif
518507
wc_FreeRng(&rng);
519508
(void)blocks;
520509
(void)loop;
521-
return ret;
510+
return WOLFCLU_SUCCESS;
522511
}

src/client/clu_client_setup.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ static void wolfCLU_ClientHelp(void)
5151
WOLFCLU_LOG(WOLFCLU_L0, "\t\t-connect '[fe80::63:57c0:9b88:77ca%%en0]:11111'");
5252
WOLFCLU_LOG(WOLFCLU_L0, "\t\t-connect '[2001:4860:4860::8888]:443'");
5353
WOLFCLU_LOG(WOLFCLU_L0, "\t-starttls <proto, i.e. smtp>");
54+
WOLFCLU_LOG(WOLFCLU_L0, "\t-CAfile <ca file name>");
55+
WOLFCLU_LOG(WOLFCLU_L0, "\t-verify_return_error close connection on verification error");
5456
}
5557

5658
static const char hostFlag[] = "-h";
@@ -173,9 +175,11 @@ int wolfCLU_Client(int argc, char** argv)
173175
XMEMCPY(host, optarg, idx);
174176
host[idx] = '\0';
175177
}
176-
ret = _addClientArg(clientArgv, hostFlag, &clientArgc);
177178
if (ret == WOLFCLU_SUCCESS) {
178-
ret = _addClientArg(clientArgv, host, &clientArgc);
179+
ret = _addClientArg(clientArgv, hostFlag, &clientArgc);
180+
if (ret == WOLFCLU_SUCCESS) {
181+
ret = _addClientArg(clientArgv, host, &clientArgc);
182+
}
179183
}
180184
}
181185
}

src/clu_main.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@
3030
#include <wolfclu/sign-verify/clu_sign_verify_setup.h>
3131
#include <wolfclu/sign-verify/clu_verify.h>
3232

33-
#ifdef _WIN32
33+
#ifdef _WIN32
3434
char* optarg;
35-
int optind ;
36-
int opterr ;
35+
int optind;
36+
int opterr;
3737
#endif
3838

3939

@@ -168,7 +168,7 @@ int main(int argc, char** argv)
168168

169169
/* retain old version of modes where '-' is used. i.e -x509, -req */
170170
if (argc > 1 && argv[1] != NULL && argv[1][0] == '-') {
171-
argv[1] = argv[1] + 1;
171+
argv[1] = argv[1] + 1;
172172
flag = getMode(argv[1]);
173173

174174
/* if -rsa was used then it is the older sign/verify version of rsa */
@@ -368,7 +368,7 @@ int clu_entry(const void* argument)
368368

369369
command = (char*)buffer;
370370

371-
/* Determine the number of supplied arguments */
371+
/* Determine the number of supplied arguments */
372372
for (i = 0; command[i] != '\0' && i < XSTRLEN(command); i++) {
373373
if (command[i]==' ') {
374374
argc++;

src/crypto/clu_crypto_setup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ static const struct option crypt_options[] = {
5454
/* returns WOLFCLU_SUCCESS on success */
5555
int wolfCLU_setup(int argc, char** argv, char action)
5656
{
57-
#ifndef WOLFCLU_NO_FILESYSTEM
57+
#ifndef WOLFCLU_NO_FILESYSTEM
5858
int ret = 0; /* return variable */
5959
char outNameEnc[256]; /* default outFile for encrypt */
6060
char outNameDec[256]; /* default outfile for decrypt */

src/crypto/clu_decrypt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ int wolfCLU_decrypt(int alg, char* mode, byte* pwdKey, byte* key, int size,
116116
}
117117
/* replicates old pwdKey if pwdKeys match */
118118
if (ret == 0 && keyType == 1) {
119-
if (wc_PBKDF2(key, pwdKey, (int) strlen((const char*)pwdKey),
119+
if (wc_PBKDF2(key, pwdKey, (int) XSTRLEN((const char*)pwdKey),
120120
salt, SALT_SIZE, CLU_4K_TYPE, size,
121121
CLU_SHA256) != 0) {
122122
wolfCLU_LogError("pwdKey set error.");

src/crypto/clu_encrypt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ int wolfCLU_encrypt(int alg, char* mode, byte* pwdKey, byte* key, int size,
6565
"instead.");
6666

6767
/* use user entered data to encrypt */
68-
inputLength = (int) strlen(in);
68+
inputLength = (int) XSTRLEN(in);
6969
userInputBuffer = (char*) XMALLOC(inputLength, HEAP_HINT,
7070
DYNAMIC_TYPE_TMP_BUFFER);
7171
if (userInputBuffer == NULL)

src/crypto/clu_evp_crypto.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ int wolfCLU_evp_crypto(const WOLFSSL_EVP_CIPHER* cphr, char* mode, byte* pwdKey,
164164
if (ret == WOLFCLU_SUCCESS) {
165165
if (pbkVersion == WOLFCLU_PBKDF2) {
166166
#ifdef HAVE_FIPS
167-
if (strlen((const char*)pwdKey) < HMAC_FIPS_MIN_KEY) {
167+
if (XSTRLEN((const char*)pwdKey) < HMAC_FIPS_MIN_KEY) {
168168
wolfCLU_LogError("For use with FIPS mode key needs to be"
169169
" at least %d characters long", HMAC_FIPS_MIN_KEY);
170170
ret = WOLFCLU_FATAL_ERROR;
@@ -173,12 +173,12 @@ int wolfCLU_evp_crypto(const WOLFSSL_EVP_CIPHER* cphr, char* mode, byte* pwdKey,
173173
if (ret == WOLFCLU_SUCCESS) {
174174
if (noSalt) {
175175
ret = wolfSSL_PKCS5_PBKDF2_HMAC((const char*)pwdKey,
176-
(int) strlen((const char*)pwdKey), NULL, 0, iter,
176+
(int) XSTRLEN((const char*)pwdKey), NULL, 0, iter,
177177
hashType, keySz + ivSz, pwdKey);
178178
}
179179
else {
180180
ret = wolfSSL_PKCS5_PBKDF2_HMAC((const char*)pwdKey,
181-
(int) strlen((const char*)pwdKey), salt, SALT_SIZE, iter,
181+
(int) XSTRLEN((const char*)pwdKey), salt, SALT_SIZE, iter,
182182
hashType, keySz + ivSz, pwdKey);
183183
}
184184
if (ret != WOLFSSL_SUCCESS) {
@@ -201,11 +201,11 @@ int wolfCLU_evp_crypto(const WOLFSSL_EVP_CIPHER* cphr, char* mode, byte* pwdKey,
201201
iter = 1; /* default value for interop */
202202
if (noSalt) {
203203
ret = wolfSSL_EVP_BytesToKey(cphr, hashType, NULL,
204-
pwdKey, (int)strlen((const char*)pwdKey), iter, key, iv);
204+
pwdKey, (int)XSTRLEN((const char*)pwdKey), iter, key, iv);
205205
}
206206
else {
207207
ret = wolfSSL_EVP_BytesToKey(cphr, hashType, salt,
208-
pwdKey, (int)strlen((const char*)pwdKey), iter, key, iv);
208+
pwdKey, (int)XSTRLEN((const char*)pwdKey), iter, key, iv);
209209
}
210210
if (ret == 0) {
211211
wolfCLU_LogError("failed to create key, ret = %d", ret);

src/dh/clu_dh.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ int wolfCLU_DhParamSetup(int argc, char** argv)
130130

131131
if (ret == WOLFCLU_SUCCESS) {
132132
int i = 2; // start at 2 because wolfssl & dhparam will be in first and second
133-
int found = 0;
133+
int found = 0;
134134
while (i + 1 <= argc && !found) {
135135
/* confirm arg is a non '-' option that does not correspond
136136
* to an '-in' or '-out' file */

0 commit comments

Comments
 (0)