All of lore.kernel.org
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: ell@lists.01.org
Subject: Re: [PATCH v5 1/5] tls: Check buffer bounds in tls_rsa_sign
Date: Mon, 20 Jun 2016 12:15:56 -0500	[thread overview]
Message-ID: <576824CC.5040602@gmail.com> (raw)
In-Reply-To: <alpine.OSX.2.20.1606200939460.4967@mjmartin-mac01.local>

[-- Attachment #1: Type: text/plain, Size: 593 bytes --]

Hi Mat,

 >>
>>> +        len -= 2;
>>
>> This doesn't seem right.  By my reading the total bytes being written
>> here are key_size (in cipher_sign) and 2 bytes just above.
>
> This is accounting for the two bytes written to 'out' above, which
> happens in that block of the 'if' statement but not the 'else' block.
>

Ah yes, you're right.  We write key_size + 4 bytes in case of TLS 1.2.

>>
>> Why are you checking for len >= key_size + 2 below?
>
> The key_size bytes written by cipher_sign and the 2 bytes written by
> le_put_be16.

Yep, my bad.

Regards,
-Denis

      reply	other threads:[~2016-06-20 17:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-17 20:47 [PATCH v5 1/5] tls: Check buffer bounds in tls_rsa_sign Mat Martineau
2016-06-17 20:47 ` [PATCH v5 2/5] cipher: Return number of read bytes from asymmetric ops Mat Martineau
2016-06-17 20:47 ` [PATCH v5 3/5] unit: Check asymmetric cipher result lengths Mat Martineau
2016-06-17 20:47 ` [PATCH v5 4/5] unit: Check decryption against known ciphertext Mat Martineau
2016-06-17 20:47 ` [PATCH v5 5/5] cipher: Use only one socket for asymmetric cipher Mat Martineau
2016-06-18  3:56 ` [PATCH v5 1/5] tls: Check buffer bounds in tls_rsa_sign Denis Kenzior
2016-06-20 16:51   ` Mat Martineau
2016-06-20 17:15     ` Denis Kenzior [this message]

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=576824CC.5040602@gmail.com \
    --to=denkenz@gmail.com \
    --cc=ell@lists.01.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.