Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package aws-c-common for openSUSE:Factory checked in at 2025-01-29 16:18:07 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/aws-c-common (Old) and /work/SRC/openSUSE:Factory/.aws-c-common.new.2316 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "aws-c-common" Wed Jan 29 16:18:07 2025 rev:19 rq:1241125 version:0.10.8 Changes: -------- --- /work/SRC/openSUSE:Factory/aws-c-common/aws-c-common.changes 2025-01-13 17:53:10.602186304 +0100 +++ /work/SRC/openSUSE:Factory/.aws-c-common.new.2316/aws-c-common.changes 2025-01-29 16:18:51.620574988 +0100 @@ -1,0 +2,11 @@ +Mon Jan 27 15:38:06 UTC 2025 - John Paul Adrian Glaubitz <adrian.glaub...@suse.com> + +- Update to version 0.10.8 + * Fixup IPv6 validation logic by @DmitriyMusatkin in (#1180) + * (take 2) Detect when AVX is disabled via OSXSAVE by @graebm in (#1184) +- from version 0.10.7 + * Change PR template to ask for clearer wording by @jmklix in (#1177) + * proof_ci.yaml must use latest upload-artifact by @graebm in (#1183) + * Detect when AVX is disabled via OSXSAVE by @graebm in (#1182) + +------------------------------------------------------------------- Old: ---- v0.10.6.tar.gz New: ---- v0.10.8.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ aws-c-common.spec ++++++ --- /var/tmp/diff_new_pack.2e30zC/_old 2025-01-29 16:18:52.212599538 +0100 +++ /var/tmp/diff_new_pack.2e30zC/_new 2025-01-29 16:18:52.216599704 +0100 @@ -19,7 +19,7 @@ %define library_version 1.0.0 %define library_soversion 1 Name: aws-c-common -Version: 0.10.6 +Version: 0.10.8 Release: 0 Summary: Core C99 package for AWS SDK for C License: Apache-2.0 ++++++ v0.10.6.tar.gz -> v0.10.8.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aws-c-common-0.10.6/.github/PULL_REQUEST_TEMPLATE.md new/aws-c-common-0.10.8/.github/PULL_REQUEST_TEMPLATE.md --- old/aws-c-common-0.10.6/.github/PULL_REQUEST_TEMPLATE.md 2024-12-11 00:52:51.000000000 +0100 +++ new/aws-c-common-0.10.8/.github/PULL_REQUEST_TEMPLATE.md 2025-01-24 20:01:58.000000000 +0100 @@ -1,4 +1,4 @@ -*Issue #, if available:* +*Issue #, and/or reason for changes (REQUIRED):* *Description of changes:* diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aws-c-common-0.10.6/.github/workflows/codecov.yml new/aws-c-common-0.10.8/.github/workflows/codecov.yml --- old/aws-c-common-0.10.6/.github/workflows/codecov.yml 2024-12-11 00:52:51.000000000 +0100 +++ new/aws-c-common-0.10.8/.github/workflows/codecov.yml 2025-01-24 20:01:58.000000000 +0100 @@ -4,7 +4,7 @@ push: env: - BUILDER_VERSION: v0.9.72 + BUILDER_VERSION: v0.9.74 BUILDER_HOST: https://d19elf31gohf1l.cloudfront.net BUILDER_SOURCE: releases PACKAGE_NAME: aws-c-common @@ -28,4 +28,4 @@ run: | python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder')" chmod a+x builder - ./builder build -p ${{ env.PACKAGE_NAME }} --compiler=gcc-9 --coverage --coverage-exclude=source/external/ + ./builder build -p ${{ env.PACKAGE_NAME }} --compiler=gcc --coverage --coverage-exclude=source/external/ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aws-c-common-0.10.6/.github/workflows/proof_ci.yaml new/aws-c-common-0.10.8/.github/workflows/proof_ci.yaml --- old/aws-c-common-0.10.6/.github/workflows/proof_ci.yaml 2024-12-11 00:52:51.000000000 +0100 +++ new/aws-c-common-0.10.8/.github/workflows/proof_ci.yaml 2025-01-24 20:01:58.000000000 +0100 @@ -177,7 +177,7 @@ && mv $FINAL_REPORT_DIR/${{ steps.artifact.outputs.name }}.zip . - name: Upload zip artifact of CBMC proof results to GitHub Actions if: ${{ env.REPO_VISIBILITY == 'public' }} - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: ${{ steps.artifact.outputs.name }} path: ${{ steps.artifact.outputs.name }}.zip diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aws-c-common-0.10.6/source/arch/intel/asm/cpuid.c new/aws-c-common-0.10.8/source/arch/intel/asm/cpuid.c --- old/aws-c-common-0.10.6/source/arch/intel/asm/cpuid.c 2024-12-11 00:52:51.000000000 +0100 +++ new/aws-c-common-0.10.8/source/arch/intel/asm/cpuid.c 2025-01-24 20:01:58.000000000 +0100 @@ -27,3 +27,14 @@ abcd[2] = ecx; abcd[3] = edx; } + +uint64_t aws_run_xgetbv(uint32_t xcr) { + /* NOTE: we could have used the _xgetbv() intrinsic in <immintrin.h>, but it's missing from GCC < 9.0: + * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71659 */ + + /* xgetbv writes high and low of 64bit value to EDX:EAX */ + uint32_t xcrhigh; + uint32_t xcrlow; + __asm__ __volatile__("xgetbv" : "=a"(xcrlow), "=d"(xcrhigh) : "c"(xcr)); + return (((uint64_t)xcrhigh) << 32) | xcrlow; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aws-c-common-0.10.6/source/arch/intel/cpuid.c new/aws-c-common-0.10.8/source/arch/intel/cpuid.c --- old/aws-c-common-0.10.6/source/arch/intel/cpuid.c 2024-12-11 00:52:51.000000000 +0100 +++ new/aws-c-common-0.10.8/source/arch/intel/cpuid.c 2025-01-24 20:01:58.000000000 +0100 @@ -13,57 +13,69 @@ #include <stdlib.h> extern void aws_run_cpuid(uint32_t eax, uint32_t ecx, uint32_t *abcd); +extern uint64_t aws_run_xgetbv(uint32_t xcr); -typedef bool(has_feature_fn)(void); +static bool s_cpu_features[AWS_CPU_FEATURE_COUNT]; +static bool s_cpu_features_cached; -static bool s_has_clmul(void) { - uint32_t abcd[4]; - uint32_t clmul_mask = 0x00000002; - aws_run_cpuid(1, 0, abcd); - - if ((abcd[2] & clmul_mask) != clmul_mask) - return false; - - return true; -} - -static bool s_has_sse41(void) { - uint32_t abcd[4]; - uint32_t sse41_mask = 0x00080000; - aws_run_cpuid(1, 0, abcd); - - if ((abcd[2] & sse41_mask) != sse41_mask) - return false; - - return true; -} - -static bool s_has_sse42(void) { - uint32_t abcd[4]; - uint32_t sse42_mask = 0x00100000; - aws_run_cpuid(1, 0, abcd); - - if ((abcd[2] & sse42_mask) != sse42_mask) - return false; - - return true; -} +static void s_cache_cpu_features(void) { + /*************************************************************************** + * First, find the max EAX value we can pass to CPUID without undefined behavior + * https://en.wikipedia.org/w/index.php?title=CPUID&oldid=1270569388#EAX=0:_Highest_Function_Parameter_and_Manufacturer_ID + **************************************************************************/ + uint32_t abcd[4]; + aws_run_cpuid(0x0, 0x0, abcd); + const uint32_t max_cpuid_eax_value = abcd[0]; /* max-value = EAX */ + + /************************************************************************** + * CPUID(EAX=1H, ECX=0H): Processor Info and Feature Bits + * https://en.wikipedia.org/w/index.php?title=CPUID&oldid=1270569388#EAX=1:_Processor_Info_and_Feature_Bits + **************************************************************************/ + if (0x1 > max_cpuid_eax_value) { + return; + } + aws_run_cpuid(0x1, 0x0, abcd); + s_cpu_features[AWS_CPU_FEATURE_CLMUL] = abcd[2] & (1 << 1); /* pclmulqdq = ECX[bit 1] */ + s_cpu_features[AWS_CPU_FEATURE_SSE_4_1] = abcd[2] & (1 << 19); /* sse4.1 = ECX[bit 19] */ + s_cpu_features[AWS_CPU_FEATURE_SSE_4_2] = abcd[2] & (1 << 20); /* sse4.2 = ECX[bit 20] */ + + /* NOTE: Even if the AVX flag is set, it's not necessarily usable. + * We need to check that OSXSAVE is enabled, and check further capabilities via XGETBV. + * GCC had the same bug until 7.4: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85100 */ + bool avx_usable = false; + bool avx512_usable = false; + bool feature_osxsave = abcd[2] & (1 << 27); /* osxsave = ECX[bit 27] */ + if (feature_osxsave) { + /* Check XCR0 (Extended Control Register 0) via XGETBV + * https://en.wikipedia.org/w/index.php?title=Control_register&oldid=1268423710#XCR0_and_XSS */ + uint64_t xcr0 = aws_run_xgetbv(0); + const uint64_t avx_mask = (1 << 1) /* SSE = XCR0[bit 1] */ + | (1 << 2) /* AVX = XCR0[bit 2] */; + avx_usable = (xcr0 & avx_mask) == avx_mask; + + const uint64_t avx512_mask = (1 << 5) /* OPMASK = XCR0[bit 5] */ + | (1 << 6) /* ZMM_Hi256 = XCR0[bit 6] */ + | (1 << 7) /* Hi16_ZMM = XCR0[bit 7] */ + | avx_mask; + avx512_usable = (xcr0 & avx512_mask) == avx512_mask; + } -static bool s_has_avx2(void) { - uint32_t abcd[4]; + bool feature_avx = false; + if (avx_usable) { + feature_avx = abcd[2] & (1 << 28); /* avx = ECX[bit 28] */ + } - /* Check AVX2: - * CPUID.(EAX=07H, ECX=0H):EBX.AVX2[bit 5]==1 */ - uint32_t avx2_mask = (1 << 5); - aws_run_cpuid(7, 0, abcd); - if ((abcd[1] & avx2_mask) != avx2_mask) { - return false; + /*************************************************************************** + * CPUID(EAX=7H, ECX=0H): Extended Features + * https://en.wikipedia.org/w/index.php?title=CPUID&oldid=1270569388#EAX=7,_ECX=0:_Extended_Features + **************************************************************************/ + if (0x7 > max_cpuid_eax_value) { + return; } + aws_run_cpuid(0x7, 0x0, abcd); + s_cpu_features[AWS_CPU_FEATURE_BMI2] = abcd[1] & (1 << 8); /* bmi2 = EBX[bit 8] */ - /* Also check AVX: - * CPUID.(EAX=01H, ECX=0H):ECX.AVX[bit 28]==1 - * - * NOTE: It SHOULD be impossible for a CPU to support AVX2 without supporting AVX. + /* NOTE: It SHOULD be impossible for a CPU to support AVX2 without supporting AVX. * But we've received crash reports where the AVX2 feature check passed * and then an AVX instruction caused an "invalid instruction" crash. * @@ -76,69 +88,26 @@ * * We don't know for sure what was up with those machines, but this extra * check should stop them from running our AVX/AVX2 code paths. */ - uint32_t avx1_mask = (1 << 28); - aws_run_cpuid(1, 0, abcd); - if ((abcd[2] & avx1_mask) != avx1_mask) { - return false; + if (feature_avx) { + if (avx_usable) { + s_cpu_features[AWS_CPU_FEATURE_AVX2] = abcd[1] & (1 << 5); /* AVX2 = EBX[bit 5] */ + s_cpu_features[AWS_CPU_FEATURE_VPCLMULQDQ] = abcd[2] & (1 << 10); /* vpclmulqdq = ECX[bit 10] */ + } + if (avx512_usable) { + s_cpu_features[AWS_CPU_FEATURE_AVX512] = abcd[1] & (1 << 16); /* AVX-512 Foundation = EBX[bit 16] */ + } } - - return true; -} - -static bool s_has_avx512(void) { - uint32_t abcd[4]; - - /* Check AVX512F: - * CPUID.(EAX=07H, ECX=0H):EBX.AVX512[bit 16]==1 */ - uint32_t avx512_mask = (1 << 16); - aws_run_cpuid(7, 0, abcd); - if ((abcd[1] & avx512_mask) != avx512_mask) { - return false; - } - - return true; -} - -static bool s_has_bmi2(void) { - uint32_t abcd[4]; - - /* Check BMI2: - * CPUID.(EAX=07H, ECX=0H):EBX.BMI2[bit 8]==1 */ - uint32_t bmi2_mask = (1 << 8); - aws_run_cpuid(7, 0, abcd); - if ((abcd[1] & bmi2_mask) != bmi2_mask) { - return false; - } - - return true; } -static bool s_has_vpclmulqdq(void) { - uint32_t abcd[4]; - /* Check VPCLMULQDQ: - * CPUID.(EAX=07H, ECX=0H):ECX.VPCLMULQDQ[bit 10]==1 */ - uint32_t vpclmulqdq_mask = (1 << 10); - aws_run_cpuid(7, 0, abcd); - if ((abcd[2] & vpclmulqdq_mask) != vpclmulqdq_mask) { - return false; +bool aws_cpu_has_feature(enum aws_cpu_feature_name feature_name) { + /* Look up and cache all hardware features the first time this is called */ + if (AWS_UNLIKELY(!s_cpu_features_cached)) { + s_cache_cpu_features(); + s_cpu_features_cached = true; } - return true; -} -has_feature_fn *s_check_cpu_feature[AWS_CPU_FEATURE_COUNT] = { - [AWS_CPU_FEATURE_CLMUL] = s_has_clmul, - [AWS_CPU_FEATURE_SSE_4_1] = s_has_sse41, - [AWS_CPU_FEATURE_SSE_4_2] = s_has_sse42, - [AWS_CPU_FEATURE_AVX2] = s_has_avx2, - [AWS_CPU_FEATURE_AVX512] = s_has_avx512, - [AWS_CPU_FEATURE_BMI2] = s_has_bmi2, - [AWS_CPU_FEATURE_VPCLMULQDQ] = s_has_vpclmulqdq, -}; - -bool aws_cpu_has_feature(enum aws_cpu_feature_name feature_name) { - if (s_check_cpu_feature[feature_name]) - return s_check_cpu_feature[feature_name](); - return false; + AWS_ASSERT(feature_name >= 0 && feature_name < AWS_CPU_FEATURE_COUNT); + return s_cpu_features[feature_name]; } #define CPUID_AVAILABLE 0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aws-c-common-0.10.6/source/arch/intel/msvc/cpuid.c new/aws-c-common-0.10.8/source/arch/intel/msvc/cpuid.c --- old/aws-c-common-0.10.6/source/arch/intel/msvc/cpuid.c 2024-12-11 00:52:51.000000000 +0100 +++ new/aws-c-common-0.10.8/source/arch/intel/msvc/cpuid.c 2025-01-24 20:01:58.000000000 +0100 @@ -5,8 +5,13 @@ #include <aws/common/cpuid.h> +#include <immintrin.h> #include <intrin.h> void aws_run_cpuid(uint32_t eax, uint32_t ecx, uint32_t *abcd) { __cpuidex((int32_t *)abcd, eax, ecx); } + +uint64_t aws_run_xgetbv(uint32_t xcr) { + return _xgetbv(xcr); +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aws-c-common-0.10.6/source/host_utils.c new/aws-c-common-0.10.8/source/host_utils.c --- old/aws-c-common-0.10.6/source/host_utils.c 2024-12-11 00:52:51.000000000 +0100 +++ new/aws-c-common-0.10.8/source/host_utils.c 2025-01-24 20:01:58.000000000 +0100 @@ -20,10 +20,6 @@ return aws_isxdigit(value) || value == ':'; } -static bool s_ends_with(struct aws_byte_cursor cur, uint8_t ch) { - return cur.len > 0 && cur.ptr[cur.len - 1] == ch; -} - bool aws_host_utils_is_ipv4(struct aws_byte_cursor host) { if (host.len > AWS_IPV4_STR_LEN - 1) { return false; @@ -68,6 +64,8 @@ * ipv6 can be embedded in url, in which case % must be uri encoded as %25. * Implementation is fairly trivial and just iterates through the string * keeping track of the spec above. + * Note: there is no single rfc for IPv6 address - base format defined in RFC 5952, + * zoneId and uri extensions defined in RFC 6874 and RFC 3986 */ bool aws_host_utils_is_ipv6(struct aws_byte_cursor host, bool is_uri_encoded) { if (host.len == 0) { @@ -79,24 +77,39 @@ bool is_split = aws_byte_cursor_next_split(&host, '%', &substr); AWS_ASSERT(is_split); /* function is guaranteed to return at least one split */ - if (!is_split || substr.len == 0 || s_ends_with(substr, ':') || - !aws_byte_cursor_satisfies_pred(&substr, s_is_ipv6_char)) { + if (!is_split || substr.len < 2 || substr.len > 39 || !aws_byte_cursor_satisfies_pred(&substr, s_is_ipv6_char)) { + return false; + } + + if ((substr.ptr[0] == ':' && substr.ptr[1] != ':') || /* no single colon at start */ + (substr.ptr[substr.len - 1] == ':' && substr.ptr[substr.len - 2] != ':')) { /* no single colon at end */ return false; } - uint8_t group_count = 0; + uint8_t group_count = 1; /* string itself is the first group and then every new : we encounter is new group */ + uint8_t digit_count = 0; bool has_double_colon = false; - struct aws_byte_cursor group = {0}; - while (aws_byte_cursor_next_split(&substr, ':', &group)) { - ++group_count; - - if (group_count > 8 || /* too many groups */ - group.len > 4 || /* too many chars in group */ - (has_double_colon && group.len == 0 && group_count > 2)) { /* only one double colon allowed */ - return false; + + for (size_t i = 0; i < substr.len; ++i) { + if (substr.ptr[i] == ':') { + ++group_count; + digit_count = 0; + + if (i > 0 && substr.ptr[i - 1] == ':') { + if (has_double_colon) { /* one double colon max */ + return false; + } + has_double_colon = true; + --group_count; /* avoid double counting groups */ + } + } else { + ++digit_count; } - has_double_colon = has_double_colon || group.len == 0; + if (digit_count > 4 || /* too many digits in group */ + group_count > 8) { /* too many groups */ + return false; + } } /* second split is optional zone part */ @@ -110,5 +123,5 @@ } } - return has_double_colon ? group_count < 7 : group_count == 8; + return has_double_colon ? group_count <= 8 : group_count == 8; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aws-c-common-0.10.6/tests/host_util_test.c new/aws-c-common-0.10.8/tests/host_util_test.c --- old/aws-c-common-0.10.6/tests/host_util_test.c 2024-12-11 00:52:51.000000000 +0100 +++ new/aws-c-common-0.10.8/tests/host_util_test.c 2025-01-24 20:01:58.000000000 +0100 @@ -50,10 +50,22 @@ ASSERT_TRUE(aws_host_utils_is_ipv6(aws_byte_cursor_from_c_str("fe80::1"), true)); ASSERT_TRUE(aws_host_utils_is_ipv6(aws_byte_cursor_from_c_str("fe80::1%25en0"), true)); ASSERT_TRUE(aws_host_utils_is_ipv6(aws_byte_cursor_from_c_str("2001:db8:85a3:8d3:1319:8a2e:370:7348"), true)); + ASSERT_TRUE(aws_host_utils_is_ipv6(aws_byte_cursor_from_c_str("2001::"), false)); + ASSERT_TRUE(aws_host_utils_is_ipv6(aws_byte_cursor_from_c_str("1:2:3:4:5:6:7::"), false)); + ASSERT_TRUE(aws_host_utils_is_ipv6(aws_byte_cursor_from_c_str("::1:2:3:4:5:6:7"), false)); + + ASSERT_TRUE(aws_host_utils_is_ipv6(aws_byte_cursor_from_c_str("2001:DB8:85A3::8A2E:370:7334"), false)); + ASSERT_TRUE(aws_host_utils_is_ipv6(aws_byte_cursor_from_c_str("2001:0db8:85a3:0000:0000:8a2e:0370:7334"), false)); + ASSERT_TRUE(aws_host_utils_is_ipv6(aws_byte_cursor_from_c_str("2001:DB8:85A3::8A2E:370:7334"), false)); + ASSERT_TRUE(aws_host_utils_is_ipv6(aws_byte_cursor_from_c_str("::ffff"), false)); + ASSERT_TRUE(aws_host_utils_is_ipv6(aws_byte_cursor_from_c_str("::"), false)); + ASSERT_TRUE(aws_host_utils_is_ipv6(aws_byte_cursor_from_c_str("ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff"), false)); + ASSERT_TRUE(aws_host_utils_is_ipv6(aws_byte_cursor_from_c_str("2001:db8:85a3:0:0:8a2e:370:7334"), false)); + ASSERT_TRUE(aws_host_utils_is_ipv6(aws_byte_cursor_from_c_str("0:0:0:0:0:0:0:0"), false)); + ASSERT_TRUE(aws_host_utils_is_ipv6(aws_byte_cursor_from_c_str("2001:db8::"), false)); ASSERT_FALSE(aws_host_utils_is_ipv6(aws_byte_cursor_from_c_str("2001:0db8:0000:0000:0000:8a2e:0370"), false)); ASSERT_FALSE(aws_host_utils_is_ipv6(aws_byte_cursor_from_c_str("2001:0db8:0000:0000:0000:8a2e:0370:"), false)); - ASSERT_FALSE(aws_host_utils_is_ipv6(aws_byte_cursor_from_c_str("2001::"), false)); ASSERT_FALSE( aws_host_utils_is_ipv6(aws_byte_cursor_from_c_str("2001:0db8:0000:0000:0000:8a2e:0370:7334:8745"), false)); ASSERT_FALSE( @@ -61,7 +73,8 @@ ASSERT_FALSE( aws_host_utils_is_ipv6(aws_byte_cursor_from_c_str("z001:0db8:0000:0000:0000:8a2e:0370:7334:8745"), false)); ASSERT_FALSE(aws_host_utils_is_ipv6(aws_byte_cursor_from_c_str("z001::8a2e::8745"), false)); - ASSERT_FALSE(aws_host_utils_is_ipv6(aws_byte_cursor_from_c_str("::2001:0db8:0000:0000:8a2e:0370:7334"), false)); + ASSERT_FALSE(aws_host_utils_is_ipv6(aws_byte_cursor_from_c_str("1:2:3:4:5:6:7:8::"), false)); + ASSERT_FALSE(aws_host_utils_is_ipv6(aws_byte_cursor_from_c_str("::1:2:3:4:5:6:7:8"), false)); ASSERT_FALSE(aws_host_utils_is_ipv6(aws_byte_cursor_from_c_str("fe80::1%en0"), true)); ASSERT_FALSE(aws_host_utils_is_ipv6(aws_byte_cursor_from_c_str("fe80::1%24en0"), true)); @@ -69,5 +82,13 @@ ASSERT_FALSE(aws_host_utils_is_ipv6(aws_byte_cursor_from_c_str("fe80::1%25en0]"), true)); ASSERT_FALSE(aws_host_utils_is_ipv6(aws_byte_cursor_from_c_str("fe80::1%25"), true)); + ASSERT_FALSE(aws_host_utils_is_ipv6(aws_byte_cursor_from_c_str("2001:db8:85a3:0000:0000:8a2e:0370:7334:1"), false)); + ASSERT_FALSE(aws_host_utils_is_ipv6(aws_byte_cursor_from_c_str("2001:db8:85a3:0000"), false)); + ASSERT_FALSE(aws_host_utils_is_ipv6(aws_byte_cursor_from_c_str("2001:0db8:85a3:0000:0000:8a2e:0370:7334:"), false)); + ASSERT_FALSE(aws_host_utils_is_ipv6(aws_byte_cursor_from_c_str("g001:0db8:85a3:0000:0000:8a2e:0370:7334"), false)); + ASSERT_FALSE(aws_host_utils_is_ipv6(aws_byte_cursor_from_c_str("2001:db8::85a3::1"), false)); + ASSERT_FALSE(aws_host_utils_is_ipv6(aws_byte_cursor_from_c_str(":2001:db8:85a3:0000:0000:8a2e:0370:7334"), false)); + ASSERT_TRUE(aws_host_utils_is_ipv6(aws_byte_cursor_from_c_str("0:0:0:0:0:0:0:0"), false)); + return AWS_OP_SUCCESS; }