From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=209.132.183.28; helo=mx1.redhat.com; envelope-from=lersek@redhat.com; receiver=edk2-devel@lists.01.org Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 43EC821184AC9 for ; Mon, 5 Nov 2018 10:32:44 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CEB48300376B; Mon, 5 Nov 2018 18:32:43 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-125-224.rdu2.redhat.com [10.10.125.224]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8A4C75ED5C; Mon, 5 Nov 2018 18:32:42 +0000 (UTC) To: Jiaxin Wu , edk2-devel@lists.01.org Cc: Ye Ting , Fu Siyuan References: <20181031054212.3276-1-Jiaxin.wu@intel.com> From: Laszlo Ersek Message-ID: <6571c3cf-7db2-4e88-f5a0-56aef5bf63c3@redhat.com> Date: Mon, 5 Nov 2018 19:32:41 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20181031054212.3276-1-Jiaxin.wu@intel.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Mon, 05 Nov 2018 18:32:43 +0000 (UTC) Subject: Re: [PATCH v1] NetworkPkg/TlsDxe: Fix failure to process multiple TLS records. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2018 18:32:44 -0000 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 10/31/18 06:42, Jiaxin Wu wrote: > Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1290. > > Current implementation failed to parse the multiple TLS record > messages due to the incorrect pointer of TLS record header. This > patch is to resolve that problem. > > Cc: Ye Ting > Cc: Fu Siyuan > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Wu Jiaxin > --- > NetworkPkg/TlsDxe/TlsImpl.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/NetworkPkg/TlsDxe/TlsImpl.c b/NetworkPkg/TlsDxe/TlsImpl.c > index ea83dbd04f..2d4169b0a5 100644 > --- a/NetworkPkg/TlsDxe/TlsImpl.c > +++ b/NetworkPkg/TlsDxe/TlsImpl.c > @@ -142,11 +142,11 @@ TlsEncryptPacket ( > } > > BufferOutSize += ThisMessageSize; > > BufferInPtr += TLS_RECORD_HEADER_LENGTH + ThisPlainMessageSize; > - TempRecordHeader += ThisMessageSize; > + TempRecordHeader = (TLS_RECORD_HEADER *)((UINT8 *)TempRecordHeader + ThisMessageSize); > } > > FreePool (BufferIn); > BufferIn = NULL; > > @@ -315,11 +315,11 @@ TlsDecryptPacket ( > CopyMem (TempRecordHeader, RecordHeaderIn, TLS_RECORD_HEADER_LENGTH); > TempRecordHeader->Length = ThisPlainMessageSize; > BufferOutSize += TLS_RECORD_HEADER_LENGTH + ThisPlainMessageSize; > > BufferInPtr += TLS_RECORD_HEADER_LENGTH + ThisCipherMessageSize; > - TempRecordHeader += TLS_RECORD_HEADER_LENGTH + ThisPlainMessageSize; > + TempRecordHeader = (TLS_RECORD_HEADER *)((UINT8 *)TempRecordHeader + TLS_RECORD_HEADER_LENGTH + ThisPlainMessageSize); > } > > FreePool (BufferIn); > BufferIn = NULL; > > What is the practical impact of this issue? In what scenario was it encountered? What were the symptoms? I realize the patch may have been pushed by now -- please consider adding the information to the BZ. (Or, please answer here, and then add the message URL to the BZ.) Thanks Laszlo