From: Jiaxin Wu <Jiaxin.wu@intel.com>
To: edk2-devel@lists.01.org
Cc: Fu Siyuan <siyuan.fu@intel.com>, Ye Ting <ting.ye@intel.com>,
Wu Jiaxin <jiaxin.wu@intel.com>
Subject: [Patch] NetworkPkg/IpSecDxe: Fix issue to parse SA Payload.
Date: Tue, 16 Oct 2018 09:34:10 +0800 [thread overview]
Message-ID: <20181016013410.3044-1-Jiaxin.wu@intel.com> (raw)
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1251
IpSecDxe failed to create the Child SA during parsing SA Payload, the issue
was caused by the below commit:
SHA-1: 1e0db7b11987d0ec93be7dfe26102a327860fdbd
* MdeModulePkg/NetworkPkg: Checking for NULL pointer before use.
In above commit, it changed the value of IsMatch in Ikev2ChildSaParseSaPayload()
to FALSE. That's correct but it exposed the potential bug in to match the correct
proposal Data, which will cause the issue happen.
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
---
NetworkPkg/IpSecDxe/Ikev2/Utility.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/NetworkPkg/IpSecDxe/Ikev2/Utility.c b/NetworkPkg/IpSecDxe/Ikev2/Utility.c
index 0c9c929705..d61bae8c9d 100644
--- a/NetworkPkg/IpSecDxe/Ikev2/Utility.c
+++ b/NetworkPkg/IpSecDxe/Ikev2/Utility.c
@@ -2502,15 +2502,16 @@ Ikev2ChildSaParseSaPayload (
IntegrityAlgorithm == PreferIntegrityAlgorithm &&
IsSupportEsn == PreferIsSupportEsn
) {
IsMatch = TRUE;
} else {
- PreferEncryptAlgorithm = 0;
- PreferIntegrityAlgorithm = 0;
- IsSupportEsn = TRUE;
+ IntegrityAlgorithm = 0;
+ EncryptAlgorithm = 0;
+ EncryptKeylength = 0;
+ IsSupportEsn = FALSE;
}
- ProposalData = (IKEV2_PROPOSAL_DATA*)((UINT8*)(ProposalData + 1) +
+ ProposalData = (IKEV2_PROPOSAL_DATA*)((UINT8*)(ProposalData + 1) +
ProposalData->NumTransforms * sizeof (IKEV2_TRANSFORM_DATA));
}
ProposalData = (IKEV2_PROPOSAL_DATA *)((IKEV2_SA_DATA *)SaPayload->PayloadBuf + 1);
if (IsMatch) {
--
2.17.1.windows.2
next reply other threads:[~2018-10-16 1:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-16 1:34 Jiaxin Wu [this message]
2018-10-18 3:26 ` [Patch] NetworkPkg/IpSecDxe: Fix issue to parse SA Payload Ye, Ting
2018-10-18 3:39 ` Wu, Jiaxin
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-list 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=20181016013410.3044-1-Jiaxin.wu@intel.com \
--to=devel@edk2.groups.io \
/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