On Fri, Mar 2, 2018 at 10:23 AM, Daniel Kahn Gillmor
<d...@fifthhorseman.net> wrote:
> You could of course check from the front of the plaintext, keeping every
> non-zero value:
>
>   char ptype = 0;
>   for (i = 0; i < plaintext_len; i++)
>     if plaintext[i]
>       ptype = plaintext[i];

What about ?

size_t l[2];
size_t t[2];
for (i = 0; i < plaintext_len; ++i) {
  l[plaintext[i] != 0] = i;
  t[plaintext[i] != 0] = plaintext[i];
}
unpadded_len = l[0] - 1;
content_type = t[1];

_______________________________________________
TLS mailing list
TLS@ietf.org
https://www.ietf.org/mailman/listinfo/tls

Reply via email to