All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Prestwood <prestwoj at gmail.com>
To: ell at lists.01.org
Subject: [PATCH v2 2/2] tls-suites: use exact length on l_ecc_point_from_data
Date: Fri, 21 Jan 2022 11:36:08 -0800	[thread overview]
Message-ID: <20220121193608.2634573-2-prestwoj@gmail.com> (raw)
In-Reply-To: 20220121193608.2634573-1-prestwoj@gmail.com

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

This was passing the remaining length in but prior this length was
only checked if less than point_bytes. If it was greater the
recent update to l_ecc_point_from_data will cause an error return.

Instead use point_bytes directly.
---
 ell/tls-suites.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ell/tls-suites.c b/ell/tls-suites.c
index 055ee80..1c1ca07 100644
--- a/ell/tls-suites.c
+++ b/ell/tls-suites.c
@@ -534,7 +534,7 @@ static void tls_handle_ecdhe_server_key_xchg(struct l_tls *tls,
 	params->curve = l_ecc_curve_from_tls_group(tls->negotiated_curve->id);
 	params->public = l_ecc_point_from_data(params->curve,
 						L_ECC_POINT_TYPE_FULL,
-						buf, len);
+						buf, point_bytes);
 	tls->pending.key_xchg_params = params;
 	buf += point_bytes;
 	len -= point_bytes;
-- 
2.31.1

                 reply	other threads:[~2022-01-21 19:36 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20220121193608.2634573-2-prestwoj@gmail.com \
    --to=unknown@example.com \
    /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.