commit | b255e21e4848e70c0c87d485ddbe46fca5b94f9b | [log] [tgz] |
---|---|---|
author | Glenn Strauss <gstrauss@gluelogic.com> | Thu Mar 09 16:00:54 2023 -0500 |
committer | Andrzej Kurek <andrzej.kurek@arm.com> | Tue Apr 11 08:29:43 2023 -0400 |
tree | 5247729b4940f4489e06b954970bbdca2355c735 | |
parent | 7bd00e07084989c491ad85cf74bf9b31094fa144 [diff] |
Handle endianness in x509_inet_pton_ipv6() Signed-off-by: Glenn Strauss <gstrauss@gluelogic.com>
diff --git a/library/x509_crt.c b/library/x509_crt.c index 7def3e9..64016a5 100644 --- a/library/x509_crt.c +++ b/library/x509_crt.c
@@ -2579,7 +2579,7 @@ ; } if (j != 0) { - addr[i++] = (x << 8) | (x >> 8); /* htons(x) */ + addr[i++] = MBEDTLS_IS_BIG_ENDIAN ? x : (x << 8) | (x >> 8); if (*v == '\0') { break; } else if (*v == '.' && (i != 0 || dc != -1) && (i < 7) &&