Skip to content

Commit 99bab74

Browse files
committed
Release Cleanup
1. Update the release date in the ChangeLog. 2. Move some compiler guards around to hush warnings depending on the build options. 3. Fix a string name for ECDSA P521 algo. 4. Fix a stray static function definition. 5. For FIPSv5 builds, add CAST tests to the API test and testsuite. 6. Add the wolfSSH_Init() and wolfSSH_Cleanup() to the unit test.
1 parent 9fc4108 commit 99bab74

8 files changed

Lines changed: 36 additions & 9 deletions

File tree

ChangeLog.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# wolfSSH v1.4.12 (Dec 21, 2022)
1+
# wolfSSH v1.4.12 (Dec 28, 2022)
22

33
## New Feature Additions and Improvements
44
- Support for Green Hills Software's INTEGRITY

examples/client/client.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,9 @@ static int wsUserAuth(byte authType,
481481
}
482482

483483

484-
#if defined(WOLFSSH_AGENT) || defined(WOLFSSH_CERTS)
484+
#if defined(WOLFSSH_AGENT) || \
485+
(defined(WOLFSSH_CERTS) && \
486+
(defined(OPENSSL_ALL) || defined(WOLFSSL_IP_ALT_NAME)))
485487
static inline void ato32(const byte* c, word32* u32)
486488
{
487489
*u32 = (c[0] << 24) | (c[1] << 16) | (c[2] << 8) | c[3];

examples/sftpclient/sftpclient.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -711,16 +711,14 @@ static int wsUserAuth(byte authType,
711711
}
712712

713713

714-
#if defined(WOLFSSH_AGENT) || defined(WOLFSSH_CERTS)
714+
#if defined(WOLFSSH_CERTS) && \
715+
(defined(OPENSSL_ALL) || defined(WOLFSSL_IP_ALT_NAME))
715716
static inline void ato32(const byte* c, word32* u32)
716717
{
717718
*u32 = (c[0] << 24) | (c[1] << 16) | (c[2] << 8) | c[3];
718719
}
719-
#endif
720720

721721

722-
#if defined(WOLFSSH_CERTS) && \
723-
(defined(OPENSSL_ALL) || defined(WOLFSSL_IP_ALT_NAME))
724722
static int ParseRFC6187(const byte* in, word32 inSz, byte** leafOut,
725723
word32* leafOutSz)
726724
{

src/internal.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10736,8 +10736,8 @@ static int BuildUserAuthRequestEccCert(WOLFSSH* ssh,
1073610736
#endif
1073710737
#ifndef WOLFSSH_NO_ECDSA_SHA2_NISTP521
1073810738
case ID_X509V3_ECDSA_SHA2_NISTP521:
10739-
names = cannedKeyAlgoX509Ecc512Names;
10740-
namesSz = cannedKeyAlgoX509Ecc512NamesSz;
10739+
names = cannedKeyAlgoX509Ecc521Names;
10740+
namesSz = cannedKeyAlgoX509Ecc521NamesSz;
1074110741
break;
1074210742
#endif
1074310743
default:

src/wolfsftp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ static int SFTP_CreateLongName(WS_SFTPNAME* name);
400400

401401
/* A few errors are OK to get. They are a notice rather that a fault.
402402
* return TRUE if ssh->error is one of the following: */
403-
INLINE int NoticeError(WOLFSSH* ssh)
403+
static INLINE int NoticeError(WOLFSSH* ssh)
404404
{
405405
return (ssh->error == WS_WANT_READ ||
406406
ssh->error == WS_WANT_WRITE ||

tests/api.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1085,6 +1085,15 @@ int wolfSSH_ApiTest(int argc, char** argv)
10851085

10861086
AssertIntEQ(wolfSSH_Init(), WS_SUCCESS);
10871087

1088+
#if defined(FIPS_VERSION_GE) && FIPS_VERSION_GE(5,2)
1089+
{
1090+
int i;
1091+
for (i = 0; i < FIPS_CAST_COUNT; i++) {
1092+
AssertIntEQ(wc_RunCast_fips(i), WS_SUCCESS);
1093+
}
1094+
}
1095+
#endif /* HAVE_FIPS */
1096+
10881097
test_wstrcat();
10891098
test_wolfSSH_CTX_new();
10901099
test_server_wolfSSH_new();

tests/testsuite.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@
4747
#include "tests/sftp.h"
4848
#endif
4949

50+
#ifdef HAVE_FIPS
51+
#include <wolfssl/wolfcrypt/fips_test.h>
52+
#endif
53+
5054
#ifndef NO_TESTSUITE_MAIN_DRIVER
5155

5256
int main(int argc, char** argv)
@@ -111,6 +115,16 @@ int wolfSSH_TestsuiteTest(int argc, char** argv)
111115
#endif
112116

113117
wolfSSH_Init();
118+
119+
#if defined(FIPS_VERSION_GE) && FIPS_VERSION_GE(5,2)
120+
{
121+
int i;
122+
for (i = 0; i < FIPS_CAST_COUNT; i++) {
123+
wc_RunCast_fips(i);
124+
}
125+
}
126+
#endif /* HAVE_FIPS */
127+
114128
#if !defined(WOLFSSL_TIRTOS)
115129
ChangeToWolfSshRoot();
116130
#endif

tests/unit.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,8 @@ int wolfSSH_UnitTest(int argc, char** argv)
329329
(void)argc;
330330
(void)argv;
331331

332+
wolfSSH_Init();
333+
332334
unitResult = test_Errors();
333335
printf("Errors: %s\n", (unitResult == 0 ? "SUCCESS" : "FAILED"));
334336
testResult = testResult || unitResult;
@@ -350,6 +352,8 @@ int wolfSSH_UnitTest(int argc, char** argv)
350352
#endif
351353
#endif
352354

355+
wolfSSH_Cleanup();
356+
353357
return (testResult ? 1 : 0);
354358
}
355359

0 commit comments

Comments
 (0)