($INBOX_DIR/description missing)
 help / color / mirror / Atom feed
From: Marcel Holtmann <marcel@holtmann.org>
To: ell@lists.linux.dev
Cc: andrew.zaborowski@intel.com
Subject: [PATCH 1/3] tls: Use l_put_be64 for IV creation in case of AEAD ciphers
Date: Tue,  3 Jan 2023 15:39:58 +0100	[thread overview]
Message-ID: <20230103144000.641471-1-marcel@holtmann.org> (raw)

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


                 reply	other threads:[~2023-01-03 14:47 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=20230103144000.641471-1-marcel@holtmann.org \
    --to=marcel@holtmann.org \
    --cc=andrew.zaborowski@intel.com \
    --cc=ell@lists.linux.dev \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).