From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.100; helo=mga07.intel.com; envelope-from=siyuan.fu@intel.com; receiver=edk2-devel@lists.01.org Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (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 035722118846A for ; Tue, 30 Oct 2018 22:53:31 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Oct 2018 22:53:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,447,1534834800"; d="scan'208";a="275904212" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga005.fm.intel.com with ESMTP; 30 Oct 2018 22:53:31 -0700 Received: from fmsmsx158.amr.corp.intel.com (10.18.116.75) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.408.0; Tue, 30 Oct 2018 22:53:30 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx158.amr.corp.intel.com (10.18.116.75) with Microsoft SMTP Server (TLS) id 14.3.408.0; Tue, 30 Oct 2018 22:53:30 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.161]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.199]) with mapi id 14.03.0415.000; Wed, 31 Oct 2018 13:53:28 +0800 From: "Fu, Siyuan" To: "Wu, Jiaxin" , "edk2-devel@lists.01.org" CC: "Ye, Ting" , "Wu, Jiaxin" Thread-Topic: [edk2] [PATCH v1] NetworkPkg/TlsDxe: Fix failure to process multiple TLS records. Thread-Index: AQHUcNyOqEqw32eELEyed4W8TgnSR6U42lLg Date: Wed, 31 Oct 2018 05:53:28 +0000 Message-ID: References: <20181031054212.3276-1-Jiaxin.wu@intel.com> In-Reply-To: <20181031054212.3276-1-Jiaxin.wu@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMTI4MWVhZjItZTlhMi00YjM1LWI2ZTMtNjgyNTYzZDExODZkIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiRjVIdG5Wc0paVm45cmxpUDVUMVpVMFZpOXkyWlE4U2VGRlpIdHI3TTFYa3htXC9ReFE3WWk5VUh2dlRJWTVueHAifQ== dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 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: Wed, 31 Oct 2018 05:53:32 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Fu Siyuan > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of > Jiaxin Wu > Sent: Wednesday, October 31, 2018 1:42 PM > To: edk2-devel@lists.01.org > Cc: Ye, Ting ; Fu, Siyuan ; Wu, > Jiaxin > Subject: [edk2] [PATCH v1] NetworkPkg/TlsDxe: Fix failure to process > multiple TLS records. >=20 > Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1290. >=20 > 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. >=20 > 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(-) >=20 > 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 ( > } >=20 > BufferOutSize +=3D ThisMessageSize; >=20 > BufferInPtr +=3D TLS_RECORD_HEADER_LENGTH + ThisPlainMessageSize; > - TempRecordHeader +=3D ThisMessageSize; > + TempRecordHeader =3D (TLS_RECORD_HEADER *)((UINT8 *)TempRecordHeader= + > ThisMessageSize); > } >=20 > FreePool (BufferIn); > BufferIn =3D NULL; >=20 > @@ -315,11 +315,11 @@ TlsDecryptPacket ( > CopyMem (TempRecordHeader, RecordHeaderIn, TLS_RECORD_HEADER_LENGTH)= ; > TempRecordHeader->Length =3D ThisPlainMessageSize; > BufferOutSize +=3D TLS_RECORD_HEADER_LENGTH + ThisPlainMessageSize; >=20 > BufferInPtr +=3D TLS_RECORD_HEADER_LENGTH + ThisCipherMessageSize; > - TempRecordHeader +=3D TLS_RECORD_HEADER_LENGTH + ThisPlainMessageSiz= e; > + TempRecordHeader =3D (TLS_RECORD_HEADER *)((UINT8 *)TempRecordHeader= + > TLS_RECORD_HEADER_LENGTH + ThisPlainMessageSize); > } >=20 > FreePool (BufferIn); > BufferIn =3D NULL; >=20 > -- > 2.17.1.windows.2 >=20 > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel