All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] tls: Use l_put_be64 for IV creation in case of AEAD ciphers
@ 2023-01-03 14:39 Marcel Holtmann
  0 siblings, 0 replies; only message in thread
From: Marcel Holtmann @ 2023-01-03 14:39 UTC (permalink / raw)
  To: ell; +Cc: andrew.zaborowski

The usage of l_put_le64 for encryption ciphers seems weird since
normally all its input is big endian. So change this here to also use
big endian version to store the sequence number.
---
 ell/tls-record.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ell/tls-record.c b/ell/tls-record.c
index cdbd0b8040bb..6ac095629abe 100644
--- a/ell/tls-record.c
+++ b/ell/tls-record.c
@@ -177,7 +177,7 @@ static void tls_tx_record_plaintext(struct l_tls *tls,
 		 * be used to build the IV.
 		 */
 		memcpy(iv, tls->fixed_iv[1], tls->fixed_iv_length[1]);
-		l_put_le64(tls->seq_num[1], iv + tls->fixed_iv_length[1]);
+		l_put_be64(tls->seq_num[1], iv + tls->fixed_iv_length[1]);
 
 		if (tls->record_iv_length[1] > 8)
 			memset(iv + tls->fixed_iv_length[1] + 8, 42,
-- 
2.39.0


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

only message in thread, other threads:[~2023-01-03 14:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-03 14:39 [PATCH 1/3] tls: Use l_put_be64 for IV creation in case of AEAD ciphers Marcel Holtmann

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.