mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-26 23:24:03 +02:00
NetworkPkg/IpSecDxe: Fix issue to parse SA Payload.
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1251 *v2: Correct the type of parameters in Ikev2ParseProposalData(), and refined the corresponding description. 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> Reviewed-by: Ye Ting <ting.ye@intel.com>
This commit is contained in:
parent
ddc6d41d12
commit
95aea2fac9
@ -1996,16 +1996,33 @@ Ikev2IsSupportAlg (
|
|||||||
Get the preferred algorithm types from ProposalData.
|
Get the preferred algorithm types from ProposalData.
|
||||||
|
|
||||||
@param[in] ProposalData Pointer to related IKEV2_PROPOSAL_DATA.
|
@param[in] ProposalData Pointer to related IKEV2_PROPOSAL_DATA.
|
||||||
@param[out] PreferEncryptAlgorithm Output of preferred encrypt algorithm.
|
@param[in, out] PreferEncryptAlgorithm Pointer to buffer which is used to store the
|
||||||
@param[out] PreferIntegrityAlgorithm Output of preferred integrity algorithm.
|
preferred encrypt algorithm.
|
||||||
@param[out] PreferPrfAlgorithm Output of preferred PRF algorithm. Only
|
Input value shall be initialized to zero that
|
||||||
|
indicates to be parsed from ProposalData.
|
||||||
|
Output of preferred encrypt algorithm.
|
||||||
|
@param[in, out] PreferIntegrityAlgorithm Pointer to buffer which is used to store the
|
||||||
|
preferred integrity algorithm.
|
||||||
|
Input value shall be initialized to zero that
|
||||||
|
indicates to be parsed from ProposalData.
|
||||||
|
Output of preferred integrity algorithm.
|
||||||
|
@param[in, out] PreferPrfAlgorithm Pointer to buffer which is used to store the
|
||||||
|
preferred PRF algorithm.
|
||||||
|
Input value shall be initialized to zero that
|
||||||
|
indicates to be parsed from ProposalData.
|
||||||
|
Output of preferred PRF algorithm. Only
|
||||||
for IKE SA.
|
for IKE SA.
|
||||||
@param[out] PreferDhGroup Output of preferred DH group. Only for
|
@param[in, out] PreferDhGroup Pointer to buffer which is used to store the
|
||||||
|
preferred DH group.
|
||||||
|
Input value shall be initialized to zero that
|
||||||
|
indicates to be parsed from ProposalData.
|
||||||
|
Output of preferred DH group. Only for
|
||||||
IKE SA.
|
IKE SA.
|
||||||
@param[out] PreferEncryptKeylength Output of preferred encrypt key length
|
@param[out] PreferEncryptKeylength Pointer to buffer which is used to store the
|
||||||
in bytes.
|
preferred encrypt key length in bytes.
|
||||||
@param[out] IsSupportEsn Output of value about the Extented Sequence
|
@param[out] IsSupportEsn Pointer to buffer which is used to store the
|
||||||
Number is support or not. Only for Child SA.
|
value about the Extented Sequence Number is
|
||||||
|
support or not. Only for Child SA.
|
||||||
@param[in] IsChildSa If it is ture, the ProposalData is for IKE
|
@param[in] IsChildSa If it is ture, the ProposalData is for IKE
|
||||||
SA. Otherwise the proposalData is for Child SA.
|
SA. Otherwise the proposalData is for Child SA.
|
||||||
|
|
||||||
@ -2013,10 +2030,10 @@ Ikev2IsSupportAlg (
|
|||||||
VOID
|
VOID
|
||||||
Ikev2ParseProposalData (
|
Ikev2ParseProposalData (
|
||||||
IN IKEV2_PROPOSAL_DATA *ProposalData,
|
IN IKEV2_PROPOSAL_DATA *ProposalData,
|
||||||
OUT UINT16 *PreferEncryptAlgorithm,
|
IN OUT UINT16 *PreferEncryptAlgorithm,
|
||||||
OUT UINT16 *PreferIntegrityAlgorithm,
|
IN OUT UINT16 *PreferIntegrityAlgorithm,
|
||||||
OUT UINT16 *PreferPrfAlgorithm,
|
IN OUT UINT16 *PreferPrfAlgorithm,
|
||||||
OUT UINT16 *PreferDhGroup,
|
IN OUT UINT16 *PreferDhGroup,
|
||||||
OUT UINTN *PreferEncryptKeylength,
|
OUT UINTN *PreferEncryptKeylength,
|
||||||
OUT BOOLEAN *IsSupportEsn,
|
OUT BOOLEAN *IsSupportEsn,
|
||||||
IN BOOLEAN IsChildSa
|
IN BOOLEAN IsChildSa
|
||||||
@ -2504,9 +2521,10 @@ Ikev2ChildSaParseSaPayload (
|
|||||||
) {
|
) {
|
||||||
IsMatch = TRUE;
|
IsMatch = TRUE;
|
||||||
} else {
|
} else {
|
||||||
PreferEncryptAlgorithm = 0;
|
IntegrityAlgorithm = 0;
|
||||||
PreferIntegrityAlgorithm = 0;
|
EncryptAlgorithm = 0;
|
||||||
IsSupportEsn = TRUE;
|
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->NumTransforms * sizeof (IKEV2_TRANSFORM_DATA));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user