All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 2/2] tls-suites: use exact length on l_ecc_point_from_data
@ 2022-01-21 19:36 James Prestwood
  0 siblings, 0 replies; only message in thread
From: James Prestwood @ 2022-01-21 19:36 UTC (permalink / raw)
  To: ell

[-- 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

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-01-21 19:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-21 19:36 [PATCH v2 2/2] tls-suites: use exact length on l_ecc_point_from_data James Prestwood

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.