From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 3259 invoked from network); 17 Oct 2021 23:39:51 -0000 Received: from 4ess.inri.net (216.126.196.42) by inbox.vuxu.org with ESMTPUTF8; 17 Oct 2021 23:39:51 -0000 Received: from duke.felloff.net ([216.126.196.34]) by 4ess; Sun Oct 17 19:15:44 -0400 2021 Message-ID: <1377E3A11595780C9A5DE8671CDBA417@felloff.net> Date: Mon, 18 Oct 2021 01:15:32 +0200 From: cinap_lenrek@felloff.net To: 9front@9front.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: asynchronous grid method-oriented general-purpose-aware control Subject: Re: [9front] libsec: fix bugs in tls extension handling Reply-To: 9front@9front.org Precedence: bulk seems good, except the following, which seems wrong as the size calculation puts n twice, but they are different things. i do not see why it needs to be modified. also it is not explained in the commit. // Elliptic Curves (also called Supported Groups) if(ProtocolVersion >= TLS10Version){ + n = nelem(namedcurves); + m = p - b; - b = erealloc(b, m + 2+2+2+nelem(namedcurves)*2 + 2+2+1+nelem(pointformats)); + b = erealloc(b, m + 2+2+2+n*2 + 2+2+1+n); p = b + m; - n = nelem(namedcurves); put16(p, Extec), p += 2; /* Type: elliptic_curves / supported_groups */ put16(p, (n+1)*2), p += 2; /* Length */ put16(p, n*2), p += 2; /* Elliptic Curves Length */ @@ -527,12 +522,10 @@ p += 2; } - n = nelem(pointformats); put16(p, Extecp), p += 2; /* Type: ec_point_formats */ - put16(p, n+1), p += 2; /* Length */ - *p++ = n; /* EC point formats Length */ - for(i=0; i < n; i++) /* EC point formats */ - *p++ = pointformats[i]; + put16(p, 2), p += 2; /* Length */ + *p++ = 1; /* EC Point Formats Length */ + *p++ = 0; /* Point Format: uncompressed */ } i'll commit the other changes, except the bikeshedding on n & 1 vs n % 2. -- cinap