|
| 1 | +From 874dd834f5444394deda1f7fcc19cc09afebf6bd Mon Sep 17 00:00:00 2001 |
| 2 | +From: Kevin Wang <wy721@qq.com> |
| 3 | +Date: Fri, 22 Nov 2024 20:48:01 +0800 |
| 4 | +Subject: [PATCH] Record and restore the processed cursor in |
| 5 | + first_handshake_message |
| 6 | + |
| 7 | +Signed-off-by: Azure Linux Security Servicing Account <azurelinux-security@microsoft.com> |
| 8 | +Upstream-reference: https://github.com/rustls/rustls/pull/2231.patch |
| 9 | +--- |
| 10 | + vendor/rustls-0.23.13/src/conn.rs | 2 ++ |
| 11 | + 1 file changed, 2 insertions(+) |
| 12 | + |
| 13 | +diff --git a/vendor/rustls-0.23.13/src/conn.rs b/vendor/rustls-0.23.13/src/conn.rs |
| 14 | +index 60b597ba5..d45d71fd0 100644 |
| 15 | +--- a/vendor/rustls-0.23.13/src/conn.rs |
| 16 | ++++ b/vendor/rustls-0.23.13/src/conn.rs |
| 17 | +@@ -655,6 +655,7 @@ impl<Data> ConnectionCommon<Data> { |
| 18 | + /// `process_handshake_messages()` path, specialized for the first handshake message. |
| 19 | + pub(crate) fn first_handshake_message(&mut self) -> Result<Option<Message<'static>>, Error> { |
| 20 | + let mut buffer_progress = BufferProgress::default(); |
| 21 | ++ buffer_progress.add_processed(self.deframer_buffer.processed); |
| 22 | + |
| 23 | + let res = self |
| 24 | + .core |
| 25 | +@@ -665,6 +666,7 @@ impl<Data> ConnectionCommon<Data> { |
| 26 | + ) |
| 27 | + .map(|opt| opt.map(|pm| Message::try_from(pm).map(|m| m.into_owned()))); |
| 28 | + |
| 29 | ++ self.deframer_buffer.processed = buffer_progress.processed(); |
| 30 | + match res? { |
| 31 | + Some(Ok(msg)) => { |
| 32 | + self.deframer_buffer |
| 33 | +-- |
| 34 | +2.45.4 |
| 35 | + |
0 commit comments