Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ide/Renesas/cs+/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ This demo is tested with the following condition.
- Add project properties of linking library in ap_rx71m_0a_usbfunc_sample_cs.mtpj
wolfssh\ide\Renesas\cs+\Projects\wolfssl_lib\DefaultBuild\wolfssl_lib.lib
wolfssh\ide\Renesas\cs+\Projects\wolfssh_lib\DefaultBuild\wolfssh_lib.lib
  wolfssh\ide\Renesas\cs+\Projects\demo_server\DefaultBuild\demo_sever.lib
wolfssh\ide\Renesas\cs+\Projects\demo_server\DefaultBuild\demo_sever.lib

- Set CC-RX(Build Tool)->Library Geberation->Library Configuration to"C99" and enable ctype.h.

Expand Down
6 changes: 3 additions & 3 deletions ide/winvs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ If you build the wolfSSL FIPS code in the **Release x64** configuration,
then you should build wolfSSH with the **ReleaseFIPS x64** configuration.

Similarly:
- wolfSSL **Debug x64** wolfSSH **DebugFIPS x64**
- wolfSSL **Release Win32** wolfSSH **ReleaseFIPS Win32**
- wolfSSL **DLL Release x64** wolfSSH **DLL ReleaseFIPS x64**
- wolfSSL **Debug x64** -> wolfSSH **DebugFIPS x64**
- wolfSSL **Release Win32** -> wolfSSH **ReleaseFIPS Win32**
- wolfSSL **DLL Release x64** -> wolfSSH **DLL ReleaseFIPS x64**

**Notes:**
* wolfSSH examples and applications might initially fail because the FIPS Integrity
Expand Down
6 changes: 3 additions & 3 deletions src/internal.c
Original file line number Diff line number Diff line change
Expand Up @@ -9723,7 +9723,7 @@ static int DoChannelRequest(WOLFSSH* ssh,
else if (WSTRNCMP(type, "window-change", typeSz) == 0) {
word32 widthChar, heightRows, widthPixels, heightPixels;

wantReply = 0; /* RFC 4254 §6.7: no reply for window-change */
wantReply = 0; /* RFC 4254 sec 6.7: no reply for window-change */
ret = GetUint32(&widthChar, buf, len, &begin);
if (ret == WS_SUCCESS)
ret = GetUint32(&heightRows, buf, len, &begin);
Expand Down Expand Up @@ -9753,7 +9753,7 @@ static int DoChannelRequest(WOLFSSH* ssh,
#endif /* WOLFSSH_SHELL && WOLFSSH_TERM */
#if defined(WOLFSSH_TERM) || defined(WOLFSSH_SHELL)
else if (WSTRNCMP(type, "exit-status", typeSz) == 0) {
wantReply = 0; /* RFC 4254 §6.10: no reply for exit-status */
wantReply = 0; /* RFC 4254 sec 6.10: no reply for exit-status */
ret = GetUint32(&ssh->exitStatus, buf, len, &begin);
WLOG(WS_LOG_AGENT, "Got exit status %u.", ssh->exitStatus);
}
Expand All @@ -9762,7 +9762,7 @@ static int DoChannelRequest(WOLFSSH* ssh,
word32 sigSz;
byte coreDumped;

wantReply = 0; /* RFC 4254 §6.10: no reply for exit-signal */
wantReply = 0; /* RFC 4254 sec 6.10: no reply for exit-signal */
WLOG(WS_LOG_AGENT, "Got exit signal, remote command terminated");

sigSz = WOLFSSH_MAX_NAMESZ;
Expand Down
2 changes: 1 addition & 1 deletion tests/auth.c
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,7 @@ static void test_pubkey_auth_wrong_key(void)

/* -----------------------------------------------------------------------
* Password auth: unknown callback return value must not grant auth (issue 2486)
* This block intentionally has no NO_SHA256 guard password auth does not
* This block intentionally has no NO_SHA256 guard -- password auth does not
* use SHA256. The surrounding utility functions (tcp_listen, load_key, etc.)
* are available because they share the base server/client/threading guard.
* ----------------------------------------------------------------------- */
Expand Down
60 changes: 30 additions & 30 deletions tests/regress.c
Original file line number Diff line number Diff line change
Expand Up @@ -1491,8 +1491,8 @@ static void TestGlobalRequestFwdCancelWithCbSendsSuccess(void)
}

/* Verify DoRequestSuccess correctly consumes a uint32 port payload (RFC 4254
* §4) without treating it as a length prefix, which would overrun the buffer
* and produce WS_BUFFER_E. */
* sec 4) without treating it as a length prefix, which would overrun the
* buffer and produce WS_BUFFER_E. */
static void TestRequestSuccessWithPortParsesCorrectly(void)
{
ChannelOpenHarness harness;
Expand Down Expand Up @@ -2207,23 +2207,23 @@ static void TestIndependentAlgoNegotiation(void)
AssertIntEQ(ssh->handshake->macId, ID_HMAC_SHA2_256);
AssertIntEQ(ssh->handshake->peerAeadMode, 0);
AssertIntEQ(ssh->handshake->aeadMode, 0);
/* Key sizes server: C2SpeerKeys, S2Ckeys. Validates the
/* Key sizes -- server: C2S->peerKeys, S2C->keys. Validates the
* side-aware DoKexInit fix: wrong mapping would swap these sizes. */
AssertIntEQ(ssh->handshake->peerKeys.encKeySz, AES_128_KEY_SIZE);
AssertIntEQ(ssh->handshake->keys.encKeySz, AES_256_KEY_SIZE);
AssertIntEQ(ssh->handshake->peerKeys.ivSz, AES_BLOCK_SIZE);
AssertIntEQ(ssh->handshake->keys.ivSz, AES_BLOCK_SIZE);
AssertIntEQ(ssh->handshake->peerKeys.macKeySz, WC_SHA_DIGEST_SIZE);
AssertIntEQ(ssh->handshake->keys.macKeySz, WC_SHA256_DIGEST_SIZE);
/* Block/mac sizes server: C2Speer*, S2Clocal. */
/* Block/mac sizes -- server: C2S->peer*, S2C->local. */
AssertIntEQ(ssh->handshake->peerBlockSz, AES_BLOCK_SIZE);
AssertIntEQ(ssh->handshake->blockSz, AES_BLOCK_SIZE);
AssertIntEQ(ssh->handshake->peerMacSz, WC_SHA_DIGEST_SIZE);
AssertIntEQ(ssh->handshake->macSz, WC_SHA256_DIGEST_SIZE);
wolfSSH_free(ssh);

#ifndef WOLFSSH_NO_AES_GCM
/* Sub-test B: AEAD S2C, non-AEAD C2S MAC only negotiated for C2S */
/* Sub-test B: AEAD S2C, non-AEAD C2S -- MAC only negotiated for C2S */
ssh = wolfSSH_new(ctx);
AssertNotNull(ssh);
AssertIntEQ(wolfSSH_SetAlgoListKex(ssh, FPF_KEX_GOOD), WS_SUCCESS);
Expand Down Expand Up @@ -2280,8 +2280,8 @@ static void TestIndependentAlgoNegotiationClient(void)
AssertNotNull(ctx);

/* Sub-test A: different non-AEAD cipher and MAC per direction.
* Client mapping is the mirror of server: C2Skeys/encryptId,
* S2CpeerKeys/peerEncryptId. A swap bug would make these asserts fail. */
* Client mapping is the mirror of server: C2S->keys/encryptId,
* S2C->peerKeys/peerEncryptId. A swap bug would make these asserts fail. */
ssh = wolfSSH_new(ctx);
AssertNotNull(ssh);
AssertIntEQ(wolfSSH_SetAlgoListKex(ssh, FPF_KEX_GOOD), WS_SUCCESS);
Expand All @@ -2302,7 +2302,7 @@ static void TestIndependentAlgoNegotiationClient(void)
* callback is set up. We only care about the negotiated algorithm IDs. */
(void)wolfSSH_TestDoKexInit(ssh, payload, payloadSz, &idx);
AssertNotNull(ssh->handshake);
/* Client: C2S is local outgoing encryptId/keys */
/* Client: C2S is local outgoing -> encryptId/keys */
AssertIntEQ(ssh->handshake->encryptId, ID_AES128_CBC);
AssertIntEQ(ssh->handshake->peerEncryptId, ID_AES256_CTR);
AssertIntEQ(ssh->handshake->macId, ID_HMAC_SHA1);
Expand All @@ -2315,15 +2315,15 @@ static void TestIndependentAlgoNegotiationClient(void)
AssertIntEQ(ssh->handshake->peerKeys.ivSz, AES_BLOCK_SIZE);
AssertIntEQ(ssh->handshake->keys.macKeySz, WC_SHA_DIGEST_SIZE);
AssertIntEQ(ssh->handshake->peerKeys.macKeySz, WC_SHA256_DIGEST_SIZE);
/* Block/mac sizes client: C2Slocal (block/macSz), S2Cpeer (peerBlock/MacSz). */
/* Block/mac sizes -- client: C2S->local (block/macSz), S2C->peer (peerBlock/MacSz). */
AssertIntEQ(ssh->handshake->blockSz, AES_BLOCK_SIZE);
AssertIntEQ(ssh->handshake->peerBlockSz, AES_BLOCK_SIZE);
AssertIntEQ(ssh->handshake->macSz, WC_SHA_DIGEST_SIZE);
AssertIntEQ(ssh->handshake->peerMacSz, WC_SHA256_DIGEST_SIZE);
wolfSSH_free(ssh);

#ifndef WOLFSSH_NO_AES_GCM
/* Sub-test B: AEAD S2C, non-AEAD C2S client perspective. */
/* Sub-test B: AEAD S2C, non-AEAD C2S -- client perspective. */
ssh = wolfSSH_new(ctx);
AssertNotNull(ssh);
AssertIntEQ(wolfSSH_SetAlgoListKex(ssh, FPF_KEX_GOOD), WS_SUCCESS);
Expand All @@ -2344,7 +2344,7 @@ static void TestIndependentAlgoNegotiationClient(void)
* callback is set up. We only care about the negotiated algorithm IDs. */
(void)wolfSSH_TestDoKexInit(ssh, payload, payloadSz, &idx);
AssertNotNull(ssh->handshake);
/* Client: C2SencryptId/keys, S2CpeerEncryptId/peerKeys */
/* Client: C2S->encryptId/keys, S2C->peerEncryptId/peerKeys */
AssertIntEQ(ssh->handshake->encryptId, ID_AES128_CBC);
AssertIntEQ(ssh->handshake->peerEncryptId, ID_AES256_GCM);
AssertIntEQ(ssh->handshake->aeadMode, 0);
Expand All @@ -2369,7 +2369,7 @@ static void TestIndependentAlgoNegotiationClient(void)
}

/* Verify WS_MATCH_ENC_ALGO_E when exactly one direction's cipher list has no
* match in the local algoListCipher the new per-direction S2C matching path
* match in the local algoListCipher -- the new per-direction S2C matching path
* introduced by the independent-algo-negotiation change. */
static void TestEncMismatch(void)
{
Expand Down Expand Up @@ -2433,7 +2433,7 @@ static void TestEncMismatch(void)
}

/* Verify WS_MATCH_MAC_ALGO_E when exactly one direction's MAC list has no
* match in the local algoListMac the new per-direction S2C MAC matching path.
* match in the local algoListMac -- the new per-direction S2C MAC matching path.
* Both cipher directions must succeed so that MAC negotiation is reached. */
static void TestMacMismatch(void)
{
Expand Down Expand Up @@ -2541,7 +2541,7 @@ static void TestGenerateKeysSplit(void)
(void)wolfSSH_TestDoKexInit(ssh, payload, payloadSz, &idx);
AssertNotNull(ssh->handshake);

/* Synthetic K/H/sessionId any non-zero values produce valid key material. */
/* Synthetic K/H/sessionId -- any non-zero values produce valid key material. */
WMEMSET(ssh->k, 0xAA, WC_SHA256_DIGEST_SIZE);
ssh->kSz = WC_SHA256_DIGEST_SIZE;
WMEMSET(ssh->h, 0xBB, WC_SHA256_DIGEST_SIZE);
Expand All @@ -2551,15 +2551,15 @@ static void TestGenerateKeysSplit(void)

AssertIntEQ(wolfSSH_TestGenerateKeys(ssh, ssh->handshake->kexHashId), WS_SUCCESS);

/* C2S direction (server: peerKeys) aes128-cbc + hmac-sha1. */
/* C2S direction (server: peerKeys) -- aes128-cbc + hmac-sha1. */
AssertIntEQ(ssh->handshake->peerKeys.encKeySz, AES_128_KEY_SIZE);
AssertTrue(WMEMCMP(ssh->handshake->peerKeys.encKey, zeros,
AES_128_KEY_SIZE) != 0);
AssertIntEQ(ssh->handshake->peerKeys.macKeySz, WC_SHA_DIGEST_SIZE);
AssertTrue(WMEMCMP(ssh->handshake->peerKeys.macKey, zeros,
WC_SHA_DIGEST_SIZE) != 0);

/* S2C direction (server: keys) aes256-ctr + hmac-sha2-256. */
/* S2C direction (server: keys) -- aes256-ctr + hmac-sha2-256. */
AssertIntEQ(ssh->handshake->keys.encKeySz, AES_256_KEY_SIZE);
AssertTrue(WMEMCMP(ssh->handshake->keys.encKey, zeros,
AES_256_KEY_SIZE) != 0);
Expand Down Expand Up @@ -2620,7 +2620,7 @@ static void TestGenerateKeysSplit(void)
#endif /* !WOLFSSH_NO_AES_GCM */

#ifndef WOLFSSH_NO_AES_GCM
/* Sub-test C: aes256-gcm C2S (AEAD) / aes128-cbc S2C (non-AEAD) mirror.
/* Sub-test C: aes256-gcm C2S (AEAD) / aes128-cbc S2C (non-AEAD) -- mirror.
* Verifies that key 'E' is skipped (peerKeys.macKeySz==0) while key 'F'
* is generated for the non-AEAD S2C direction. */
ssh = wolfSSH_new(ctx);
Expand Down Expand Up @@ -2663,7 +2663,7 @@ static void TestGenerateKeysSplit(void)

wolfSSH_free(ssh);

/* Sub-test D: aes256-gcm C2S (AEAD) / aes256-gcm S2C (AEAD) symmetric.
/* Sub-test D: aes256-gcm C2S (AEAD) / aes256-gcm S2C (AEAD) -- symmetric.
* Both macKeySz==0; both key 'E' and key 'F' generation skipped.
* Directly validates the per-direction macKeySz>0 guards in GenerateKeys. */
ssh = wolfSSH_new(ctx);
Expand Down Expand Up @@ -2723,8 +2723,8 @@ static void TestGenerateKeysSplitClient(void)
ctx = wolfSSH_CTX_new(WOLFSSH_ENDPOINT_CLIENT, NULL);
AssertNotNull(ctx);

/* Sub-test A: aes128-cbc C2S / aes256-ctr S2C client mapping.
* Client: C2Skeys (local outgoing), S2CpeerKeys (peer outgoing). */
/* Sub-test A: aes128-cbc C2S / aes256-ctr S2C -- client mapping.
* Client: C2S->keys (local outgoing), S2C->peerKeys (peer outgoing). */
ssh = wolfSSH_new(ctx);
AssertNotNull(ssh);
AssertIntEQ(wolfSSH_SetAlgoListKex(ssh, FPF_KEX_GOOD), WS_SUCCESS);
Expand Down Expand Up @@ -2755,15 +2755,15 @@ static void TestGenerateKeysSplitClient(void)

AssertIntEQ(wolfSSH_TestGenerateKeys(ssh, ssh->handshake->kexHashId), WS_SUCCESS);

/* C2S direction (client: keys) aes128-cbc + hmac-sha1. */
/* C2S direction (client: keys) -- aes128-cbc + hmac-sha1. */
AssertIntEQ(ssh->handshake->keys.encKeySz, AES_128_KEY_SIZE);
AssertTrue(WMEMCMP(ssh->handshake->keys.encKey, zeros,
AES_128_KEY_SIZE) != 0);
AssertIntEQ(ssh->handshake->keys.macKeySz, WC_SHA_DIGEST_SIZE);
AssertTrue(WMEMCMP(ssh->handshake->keys.macKey, zeros,
WC_SHA_DIGEST_SIZE) != 0);

/* S2C direction (client: peerKeys) aes256-ctr + hmac-sha2-256. */
/* S2C direction (client: peerKeys) -- aes256-ctr + hmac-sha2-256. */
AssertIntEQ(ssh->handshake->peerKeys.encKeySz, AES_256_KEY_SIZE);
AssertTrue(WMEMCMP(ssh->handshake->peerKeys.encKey, zeros,
AES_256_KEY_SIZE) != 0);
Expand All @@ -2778,7 +2778,7 @@ static void TestGenerateKeysSplitClient(void)
wolfSSH_free(ssh);

#ifndef WOLFSSH_NO_AES_GCM
/* Sub-test B: aes128-cbc C2S (non-AEAD) / aes256-gcm S2C (AEAD) client.
/* Sub-test B: aes128-cbc C2S (non-AEAD) / aes256-gcm S2C (AEAD) -- client.
* keys.macKeySz must be set; peerKeys.macKeySz must be 0 (AEAD, no MAC). */
ssh = wolfSSH_new(ctx);
AssertNotNull(ssh);
Expand Down Expand Up @@ -2822,8 +2822,8 @@ static void TestGenerateKeysSplitClient(void)

wolfSSH_free(ssh);

/* Sub-test C: aes256-gcm C2S (AEAD) / aes128-cbc S2C (non-AEAD) mirror.
* Client: C2Skeys (local outgoing), S2CpeerKeys (peer outgoing).
/* Sub-test C: aes256-gcm C2S (AEAD) / aes128-cbc S2C (non-AEAD) -- mirror.
* Client: C2S->keys (local outgoing), S2C->peerKeys (peer outgoing).
* Verifies key 'E' skipped (keys.macKeySz==0) and key 'F' generated. */
ssh = wolfSSH_new(ctx);
AssertNotNull(ssh);
Expand Down Expand Up @@ -2865,7 +2865,7 @@ static void TestGenerateKeysSplitClient(void)

wolfSSH_free(ssh);

/* Sub-test D: aes256-gcm C2S (AEAD) / aes256-gcm S2C (AEAD) symmetric.
/* Sub-test D: aes256-gcm C2S (AEAD) / aes256-gcm S2C (AEAD) -- symmetric.
* Both macKeySz==0; both key 'E' and key 'F' generation skipped. */
ssh = wolfSSH_new(ctx);
AssertNotNull(ssh);
Expand Down Expand Up @@ -2921,7 +2921,7 @@ static void TestDoNewKeys(void)
byte expectedPeerAeadMode;
Keys savedPeerKeys;

/* Sub-test A: aes128-cbc C2S / aes256-ctr S2C non-AEAD both dirs.
/* Sub-test A: aes128-cbc C2S / aes256-ctr S2C -- non-AEAD both dirs.
* After DoNewKeys on the server, ssh->peer* must reflect the C2S (peer
* outgoing) direction, not the S2C (local outgoing) direction. */
ctx = wolfSSH_CTX_new(WOLFSSH_ENDPOINT_SERVER, NULL);
Expand Down Expand Up @@ -3031,8 +3031,8 @@ static void TestDoNewKeys(void)
wolfSSH_CTX_free(ctx);
#endif /* !WOLFSSH_NO_AES_GCM */

/* Sub-test C: client mirror of A aes128-cbc C2S / aes256-ctr S2C.
* Client: C2Skeys (local), S2CpeerKeys (peer). After DoNewKeys,
/* Sub-test C: client mirror of A -- aes128-cbc C2S / aes256-ctr S2C.
* Client: C2S->keys (local), S2C->peerKeys (peer). After DoNewKeys,
* ssh->peer* must reflect the S2C (server outgoing) direction. */
ctx = wolfSSH_CTX_new(WOLFSSH_ENDPOINT_CLIENT, NULL);
AssertNotNull(ctx);
Expand Down Expand Up @@ -3086,7 +3086,7 @@ static void TestDoNewKeys(void)
wolfSSH_CTX_free(ctx);

#ifndef WOLFSSH_NO_AES_GCM
/* Sub-test D: client mirror of B aes128-cbc C2S (non-AEAD) /
/* Sub-test D: client mirror of B -- aes128-cbc C2S (non-AEAD) /
* aes256-gcm S2C (AEAD). Verifies peerAeadMode==1 (S2C AEAD) rather
* than 0 (C2S non-AEAD), catching regression to handshake->aeadMode. */
ctx = wolfSSH_CTX_new(WOLFSSH_ENDPOINT_CLIENT, NULL);
Expand Down
Loading
Loading