Skip to content

Commit 81a9fbf

Browse files
committed
Enable AES-CTR, Camellia, and IPv6 SAN tests on Windows
- Fix AES-CTR version check from > to >= 0x05009000 - Add HAVE_CAMELLIA to Windows user_settings.h - Override XINET_PTON to use InetPtonA (narrow-string) instead of wolfSSL's default which incorrectly casts char* to PCWSTR - Remove IPv6 SAN test skips now that InetPtonA works correctly
1 parent f04fedf commit 81a9fbf

3 files changed

Lines changed: 14 additions & 9 deletions

File tree

ide/winvs/user_settings.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
#define NO_MULTIBYTE_PRINT
1111
#define WC_NO_HARDEN
1212

13+
/* wolfSSL's default Windows XINET_PTON casts to PCWSTR which breaks
14+
* with narrow char* strings. Use the narrow-string InetPtonA instead. */
15+
#define XINET_PTON(a,b,c) InetPtonA((a),(b),(c))
16+
1317
#define WOLFSSL_KEY_GEN
1418
#define WOLFSSL_CERT_GEN
1519
#define WOLFSSL_CERT_REQ
@@ -20,6 +24,7 @@
2024
#define WOLFSSL_AES_COUNTER
2125
#define WOLFSSL_AES_DIRECT
2226
#define HAVE_AESGCM
27+
#define HAVE_CAMELLIA
2328
#define WOLFSSL_SHA224
2429
#define WOLFSSL_SHA384
2530
#define WOLFSSL_SHA512

src/tools/clu_funcs.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ void wolfCLU_verboseHelp(void)
220220
WOLFCLU_LOG(WOLFCLU_L0, "aes-cbc-128\t\taes-cbc-192\t\taes-cbc-256");
221221
#endif
222222
#if defined(WOLFSSL_AES_COUNTER) && \
223-
LIBWOLFSSL_VERSION_HEX > 0x05009000
223+
LIBWOLFSSL_VERSION_HEX >= 0x05009000
224224
WOLFCLU_LOG(WOLFCLU_L0, "aes-ctr-128\t\taes-ctr-192\t\taes-ctr-256");
225225
#endif
226226
#ifndef NO_DES3
@@ -255,7 +255,7 @@ void wolfCLU_encryptHelp(void)
255255
WOLFCLU_LOG(WOLFCLU_L0, "aes-cbc-128\t\taes-cbc-192\t\taes-cbc-256");
256256
#endif
257257
#if defined(WOLFSSL_AES_COUNTER) && \
258-
LIBWOLFSSL_VERSION_HEX > 0x05009000
258+
LIBWOLFSSL_VERSION_HEX >= 0x05009000
259259
WOLFCLU_LOG(WOLFCLU_L0, "aes-ctr-128\t\taes-ctr-192\t\taes-ctr-256");
260260
#endif
261261
#ifndef NO_DES3
@@ -302,7 +302,7 @@ void wolfCLU_decryptHelp(void)
302302
WOLFCLU_LOG(WOLFCLU_L0, "aes-cbc-128\t\taes-cbc-192\t\taes-cbc-256");
303303
#endif
304304
#if defined(WOLFSSL_AES_COUNTER) && \
305-
LIBWOLFSSL_VERSION_HEX > 0x05009000
305+
LIBWOLFSSL_VERSION_HEX >= 0x05009000
306306
WOLFCLU_LOG(WOLFCLU_L0, "aes-ctr-128\t\taes-ctr-192\t\taes-ctr-256");
307307
#endif
308308
#ifndef NO_DES3

tests/x509/x509-req-test.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,8 @@ def test_req_extensions_not_found_fails(self):
197197
self.assertNotEqual(r.returncode, 0)
198198

199199

200-
@unittest.skipIf(sys.platform == "win32",
201-
"wolfSSL IPv6 SAN parsing fails on Windows")
200+
201+
202202
def test_req_extensions_v3_alt_ca(self):
203203
"""req with v3_alt_ca extensions sets CA:TRUE."""
204204
alt_crt = _tmp("test_req_alt.crt")
@@ -389,8 +389,8 @@ def _clean(self, *files):
389389
for f in files:
390390
self.addCleanup(lambda p=f: _cleanup(p))
391391

392-
@unittest.skipIf(sys.platform == "win32",
393-
"wolfSSL IPv6 SAN parsing fails on Windows")
392+
393+
394394
def test_extfile_v3_alt_ca(self):
395395
"""x509 -req with -extfile and -extensions v3_alt_ca sets CA:TRUE."""
396396
out = _tmp("tmp_ext.cert")
@@ -592,8 +592,8 @@ def setUpClass(cls):
592592
def tearDownClass(cls):
593593
_cleanup(cls.conf_file)
594594

595-
@unittest.skipIf(sys.platform == "win32",
596-
"wolfSSL IPv6 SAN parsing fails on Windows")
595+
596+
597597
def test_v3_alt_req_full_tenthname(self):
598598
"""req with v3_alt_req_full includes tenthName."""
599599
tmp = _tmp("test_req_altfull.cert")

0 commit comments

Comments
 (0)