From: jca Date: Mon, 8 Jul 2024 06:57:37 +0000 (+0000) Subject: Pretend to clarify the way ipv6_asc() works X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=d1aeef777b5586b262327e516793e7f76096c621;p=openbsd Pretend to clarify the way ipv6_asc() works Give example IPv6 addresses to clarify what is meant with 1, 2 or 3 zero length elements. tb made me look. perverted, twisted, crippled --- diff --git a/lib/libcrypto/x509/x509_utl.c b/lib/libcrypto/x509/x509_utl.c index e5e95bfac5e..422e89989a6 100644 --- a/lib/libcrypto/x509/x509_utl.c +++ b/lib/libcrypto/x509/x509_utl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x509_utl.c,v 1.18 2024/06/18 08:29:40 tb Exp $ */ +/* $OpenBSD: x509_utl.c,v 1.19 2024/07/08 06:57:37 jca Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project. */ @@ -1325,9 +1325,10 @@ ipv6_from_asc(unsigned char *v6, const char *in) v6stat.zero_pos = -1; v6stat.zero_cnt = 0; - /* Treat the IPv6 representation as a list of values - * separated by ':'. The presence of a '::' will parse - * as one, two or three zero length elements. + /* + * Treat the IPv6 representation as a list of values separated by ':'. + * The presence of a '::' will parse as one (e.g., "2001:db8::1"), + * two (e.g., "2001:db8::") or three (e.g., "::") zero length elements. */ if (!CONF_parse_list(in, ':', 0, ipv6_cb, &v6stat)) return 0;