From: cinap_lenrek@felloff.net
To: 9front@9front.org
Subject: Re: [9front] libsec: fix bugs in tls extension handling
Date: Mon, 18 Oct 2021 01:15:32 +0200 [thread overview]
Message-ID: <1377E3A11595780C9A5DE8671CDBA417@felloff.net> (raw)
In-Reply-To: <CABO6shdVnm92-_iRVY3JCib3pCPp1YxCNCsyXVFLahMa8zpPCg@mail.gmail.com>
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
next prev parent reply other threads:[~2021-10-17 23:39 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-17 17:38 kemal
2021-10-17 23:15 ` cinap_lenrek [this message]
2021-10-18 12:36 ` kemal
2021-10-18 16:22 ` cinap_lenrek
2021-10-17 23:36 ` cinap_lenrek
2021-10-17 23:46 ` cinap_lenrek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1377E3A11595780C9A5DE8671CDBA417@felloff.net \
--to=cinap_lenrek@felloff.net \
--cc=9front@9front.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).