public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch] NetworkPkg/IpSecDxe: correct one comment and remove the unused buf
@ 2016-11-30  2:26 Jiaxin Wu
  2016-11-30  2:37 ` Fu, Siyuan
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Jiaxin Wu @ 2016-11-30  2:26 UTC (permalink / raw)
  To: edk2-devel; +Cc: Fu Siyuan, Ye Ting, Zhang Lubo

Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Zhang Lubo <lubo.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
---
 NetworkPkg/IpSecDxe/Ikev2/Payload.c | 18 +-----------------
 1 file changed, 1 insertion(+), 17 deletions(-)

diff --git a/NetworkPkg/IpSecDxe/Ikev2/Payload.c b/NetworkPkg/IpSecDxe/Ikev2/Payload.c
index 675ecf6..f32b3a8 100644
--- a/NetworkPkg/IpSecDxe/Ikev2/Payload.c
+++ b/NetworkPkg/IpSecDxe/Ikev2/Payload.c
@@ -655,11 +655,10 @@ Ikev2CertGenerateAuthPayload (
   )
 {
   UINT8              *Digest;
   UINTN              DigestSize;
   PRF_DATA_FRAGMENT  Fragments[3];
-  UINT8              *KeyBuf;
   IKE_PAYLOAD        *AuthPayload;
   IKEV2_AUTH         *PayloadBuf;
   EFI_STATUS         Status;
   UINT8              *Signature;
   UINTN              SigSize;
@@ -680,11 +679,10 @@ Ikev2CertGenerateAuthPayload (
   //    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   //
   //
   // Initial point
   //
-  KeyBuf      = NULL;
   AuthPayload = NULL;
   Digest      = NULL;
   Signature   = NULL;
   SigSize     = 0;
 
@@ -696,21 +694,10 @@ Ikev2CertGenerateAuthPayload (
   if (Digest == NULL) {
     return NULL;
   }
 
   //
-  // Store the AuthKey into KeyBuf
-  //
-  KeyBuf  = AllocateZeroPool (DigestSize);
-  if (KeyBuf == NULL) {
-    Status = EFI_OUT_OF_RESOURCES;
-    goto EXIT;
-  }
-  
-  CopyMem (KeyBuf, Digest, DigestSize);
-
-  //
   // Calculate Prf(SK_Pi/r, IDi/r)
   //
   Fragments[0].Data     = IdPayload->PayloadBuf + sizeof (IKEV2_COMMON_PAYLOAD_HEADER);
   Fragments[0].DataSize = IdPayload->PayloadSize - sizeof (IKEV2_COMMON_PAYLOAD_HEADER);
 
@@ -861,13 +848,10 @@ Ikev2CertGenerateAuthPayload (
   //
   AuthPayload->PayloadBuf   = (UINT8 *) PayloadBuf;
   AuthPayload->PayloadType  = IKEV2_PAYLOAD_TYPE_AUTH;
 
 EXIT:
-  if (KeyBuf != NULL) {
-    FreePool (KeyBuf);
-  }
   if (Digest != NULL) {
     FreePool (Digest);
   }
   if (Signature != NULL) {
     FreePool (Signature);
@@ -1490,11 +1474,11 @@ Ikev2ParserNotifyCookiePayload (
   @param[in]  CertificateLen    The length of Certificate in byte.
   @param[in]  EncodeType        Specified the Certificate Encodeing which is defined
                                 in RFC 4306.
   @param[in]  IsRequest         To indicate create Certificate Payload or Certificate
                                 Request Payload. If it is TURE, create Certificate
-                                Payload. Otherwise, create Certificate Request Payload.
+                                Request Payload. Otherwise, create Certificate Payload.
 
   @retval  a Pointer to IKE Payload whose payload buffer containing the Certificate
            payload or Certificated Request payload.
 
 **/
-- 
1.9.5.msysgit.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Patch] NetworkPkg/IpSecDxe: correct one comment and remove the unused buf
  2016-11-30  2:26 [Patch] NetworkPkg/IpSecDxe: correct one comment and remove the unused buf Jiaxin Wu
@ 2016-11-30  2:37 ` Fu, Siyuan
  2016-11-30  2:59 ` Zhang, Lubo
  2016-11-30  5:49 ` Ye, Ting
  2 siblings, 0 replies; 4+ messages in thread
From: Fu, Siyuan @ 2016-11-30  2:37 UTC (permalink / raw)
  To: Wu, Jiaxin, edk2-devel@lists.01.org; +Cc: Ye, Ting, Zhang, Lubo

Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>

> -----Original Message-----
> From: Wu, Jiaxin
> Sent: Wednesday, November 30, 2016 10:26 AM
> To: edk2-devel@lists.01.org
> Cc: Fu, Siyuan <siyuan.fu@intel.com>; Ye, Ting <ting.ye@intel.com>; Zhang,
> Lubo <lubo.zhang@intel.com>
> Subject: [Patch] NetworkPkg/IpSecDxe: correct one comment and remove the
> unused buf
> 
> Cc: Fu Siyuan <siyuan.fu@intel.com>
> Cc: Ye Ting <ting.ye@intel.com>
> Cc: Zhang Lubo <lubo.zhang@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
> ---
>  NetworkPkg/IpSecDxe/Ikev2/Payload.c | 18 +-----------------
>  1 file changed, 1 insertion(+), 17 deletions(-)
> 
> diff --git a/NetworkPkg/IpSecDxe/Ikev2/Payload.c
> b/NetworkPkg/IpSecDxe/Ikev2/Payload.c
> index 675ecf6..f32b3a8 100644
> --- a/NetworkPkg/IpSecDxe/Ikev2/Payload.c
> +++ b/NetworkPkg/IpSecDxe/Ikev2/Payload.c
> @@ -655,11 +655,10 @@ Ikev2CertGenerateAuthPayload (
>    )
>  {
>    UINT8              *Digest;
>    UINTN              DigestSize;
>    PRF_DATA_FRAGMENT  Fragments[3];
> -  UINT8              *KeyBuf;
>    IKE_PAYLOAD        *AuthPayload;
>    IKEV2_AUTH         *PayloadBuf;
>    EFI_STATUS         Status;
>    UINT8              *Signature;
>    UINTN              SigSize;
> @@ -680,11 +679,10 @@ Ikev2CertGenerateAuthPayload (
>    //    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
>    //
>    //
>    // Initial point
>    //
> -  KeyBuf      = NULL;
>    AuthPayload = NULL;
>    Digest      = NULL;
>    Signature   = NULL;
>    SigSize     = 0;
> 
> @@ -696,21 +694,10 @@ Ikev2CertGenerateAuthPayload (
>    if (Digest == NULL) {
>      return NULL;
>    }
> 
>    //
> -  // Store the AuthKey into KeyBuf
> -  //
> -  KeyBuf  = AllocateZeroPool (DigestSize);
> -  if (KeyBuf == NULL) {
> -    Status = EFI_OUT_OF_RESOURCES;
> -    goto EXIT;
> -  }
> -
> -  CopyMem (KeyBuf, Digest, DigestSize);
> -
> -  //
>    // Calculate Prf(SK_Pi/r, IDi/r)
>    //
>    Fragments[0].Data     = IdPayload->PayloadBuf + sizeof
> (IKEV2_COMMON_PAYLOAD_HEADER);
>    Fragments[0].DataSize = IdPayload->PayloadSize - sizeof
> (IKEV2_COMMON_PAYLOAD_HEADER);
> 
> @@ -861,13 +848,10 @@ Ikev2CertGenerateAuthPayload (
>    //
>    AuthPayload->PayloadBuf   = (UINT8 *) PayloadBuf;
>    AuthPayload->PayloadType  = IKEV2_PAYLOAD_TYPE_AUTH;
> 
>  EXIT:
> -  if (KeyBuf != NULL) {
> -    FreePool (KeyBuf);
> -  }
>    if (Digest != NULL) {
>      FreePool (Digest);
>    }
>    if (Signature != NULL) {
>      FreePool (Signature);
> @@ -1490,11 +1474,11 @@ Ikev2ParserNotifyCookiePayload (
>    @param[in]  CertificateLen    The length of Certificate in byte.
>    @param[in]  EncodeType        Specified the Certificate Encodeing which
> is defined
>                                  in RFC 4306.
>    @param[in]  IsRequest         To indicate create Certificate Payload or
> Certificate
>                                  Request Payload. If it is TURE, create
> Certificate
> -                                Payload. Otherwise, create Certificate
> Request Payload.
> +                                Request Payload. Otherwise, create
> Certificate Payload.
> 
>    @retval  a Pointer to IKE Payload whose payload buffer containing the
> Certificate
>             payload or Certificated Request payload.
> 
>  **/
> --
> 1.9.5.msysgit.1



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Patch] NetworkPkg/IpSecDxe: correct one comment and remove the unused buf
  2016-11-30  2:26 [Patch] NetworkPkg/IpSecDxe: correct one comment and remove the unused buf Jiaxin Wu
  2016-11-30  2:37 ` Fu, Siyuan
@ 2016-11-30  2:59 ` Zhang, Lubo
  2016-11-30  5:49 ` Ye, Ting
  2 siblings, 0 replies; 4+ messages in thread
From: Zhang, Lubo @ 2016-11-30  2:59 UTC (permalink / raw)
  To: Wu, Jiaxin, edk2-devel@lists.01.org; +Cc: Fu, Siyuan, Ye, Ting

Reviewed-by: Zhang Lubo <lubo.zhang@intel.com>

-----Original Message-----
From: Wu, Jiaxin 
Sent: Wednesday, November 30, 2016 10:26 AM
To: edk2-devel@lists.01.org
Cc: Fu, Siyuan <siyuan.fu@intel.com>; Ye, Ting <ting.ye@intel.com>; Zhang, Lubo <lubo.zhang@intel.com>
Subject: [Patch] NetworkPkg/IpSecDxe: correct one comment and remove the unused buf

Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Zhang Lubo <lubo.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
---
 NetworkPkg/IpSecDxe/Ikev2/Payload.c | 18 +-----------------
 1 file changed, 1 insertion(+), 17 deletions(-)

diff --git a/NetworkPkg/IpSecDxe/Ikev2/Payload.c b/NetworkPkg/IpSecDxe/Ikev2/Payload.c
index 675ecf6..f32b3a8 100644
--- a/NetworkPkg/IpSecDxe/Ikev2/Payload.c
+++ b/NetworkPkg/IpSecDxe/Ikev2/Payload.c
@@ -655,11 +655,10 @@ Ikev2CertGenerateAuthPayload (
   )
 {
   UINT8              *Digest;
   UINTN              DigestSize;
   PRF_DATA_FRAGMENT  Fragments[3];
-  UINT8              *KeyBuf;
   IKE_PAYLOAD        *AuthPayload;
   IKEV2_AUTH         *PayloadBuf;
   EFI_STATUS         Status;
   UINT8              *Signature;
   UINTN              SigSize;
@@ -680,11 +679,10 @@ Ikev2CertGenerateAuthPayload (
   //    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   //
   //
   // Initial point
   //
-  KeyBuf      = NULL;
   AuthPayload = NULL;
   Digest      = NULL;
   Signature   = NULL;
   SigSize     = 0;
 
@@ -696,21 +694,10 @@ Ikev2CertGenerateAuthPayload (
   if (Digest == NULL) {
     return NULL;
   }
 
   //
-  // Store the AuthKey into KeyBuf
-  //
-  KeyBuf  = AllocateZeroPool (DigestSize);
-  if (KeyBuf == NULL) {
-    Status = EFI_OUT_OF_RESOURCES;
-    goto EXIT;
-  }
-  
-  CopyMem (KeyBuf, Digest, DigestSize);
-
-  //
   // Calculate Prf(SK_Pi/r, IDi/r)
   //
   Fragments[0].Data     = IdPayload->PayloadBuf + sizeof (IKEV2_COMMON_PAYLOAD_HEADER);
   Fragments[0].DataSize = IdPayload->PayloadSize - sizeof (IKEV2_COMMON_PAYLOAD_HEADER);
 
@@ -861,13 +848,10 @@ Ikev2CertGenerateAuthPayload (
   //
   AuthPayload->PayloadBuf   = (UINT8 *) PayloadBuf;
   AuthPayload->PayloadType  = IKEV2_PAYLOAD_TYPE_AUTH;
 
 EXIT:
-  if (KeyBuf != NULL) {
-    FreePool (KeyBuf);
-  }
   if (Digest != NULL) {
     FreePool (Digest);
   }
   if (Signature != NULL) {
     FreePool (Signature);
@@ -1490,11 +1474,11 @@ Ikev2ParserNotifyCookiePayload (
   @param[in]  CertificateLen    The length of Certificate in byte.
   @param[in]  EncodeType        Specified the Certificate Encodeing which is defined
                                 in RFC 4306.
   @param[in]  IsRequest         To indicate create Certificate Payload or Certificate
                                 Request Payload. If it is TURE, create Certificate
-                                Payload. Otherwise, create Certificate Request Payload.
+                                Request Payload. Otherwise, create Certificate Payload.
 
   @retval  a Pointer to IKE Payload whose payload buffer containing the Certificate
            payload or Certificated Request payload.
 
 **/
-- 
1.9.5.msysgit.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Patch] NetworkPkg/IpSecDxe: correct one comment and remove the unused buf
  2016-11-30  2:26 [Patch] NetworkPkg/IpSecDxe: correct one comment and remove the unused buf Jiaxin Wu
  2016-11-30  2:37 ` Fu, Siyuan
  2016-11-30  2:59 ` Zhang, Lubo
@ 2016-11-30  5:49 ` Ye, Ting
  2 siblings, 0 replies; 4+ messages in thread
From: Ye, Ting @ 2016-11-30  5:49 UTC (permalink / raw)
  To: Wu, Jiaxin, edk2-devel@lists.01.org; +Cc: Fu, Siyuan, Zhang, Lubo

Reviewed-by: Ye Ting <ting.ye@intel.com> 

-----Original Message-----
From: Wu, Jiaxin 
Sent: Wednesday, November 30, 2016 10:26 AM
To: edk2-devel@lists.01.org
Cc: Fu, Siyuan <siyuan.fu@intel.com>; Ye, Ting <ting.ye@intel.com>; Zhang, Lubo <lubo.zhang@intel.com>
Subject: [Patch] NetworkPkg/IpSecDxe: correct one comment and remove the unused buf

Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Zhang Lubo <lubo.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
---
 NetworkPkg/IpSecDxe/Ikev2/Payload.c | 18 +-----------------
 1 file changed, 1 insertion(+), 17 deletions(-)

diff --git a/NetworkPkg/IpSecDxe/Ikev2/Payload.c b/NetworkPkg/IpSecDxe/Ikev2/Payload.c
index 675ecf6..f32b3a8 100644
--- a/NetworkPkg/IpSecDxe/Ikev2/Payload.c
+++ b/NetworkPkg/IpSecDxe/Ikev2/Payload.c
@@ -655,11 +655,10 @@ Ikev2CertGenerateAuthPayload (
   )
 {
   UINT8              *Digest;
   UINTN              DigestSize;
   PRF_DATA_FRAGMENT  Fragments[3];
-  UINT8              *KeyBuf;
   IKE_PAYLOAD        *AuthPayload;
   IKEV2_AUTH         *PayloadBuf;
   EFI_STATUS         Status;
   UINT8              *Signature;
   UINTN              SigSize;
@@ -680,11 +679,10 @@ Ikev2CertGenerateAuthPayload (
   //    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   //
   //
   // Initial point
   //
-  KeyBuf      = NULL;
   AuthPayload = NULL;
   Digest      = NULL;
   Signature   = NULL;
   SigSize     = 0;
 
@@ -696,21 +694,10 @@ Ikev2CertGenerateAuthPayload (
   if (Digest == NULL) {
     return NULL;
   }
 
   //
-  // Store the AuthKey into KeyBuf
-  //
-  KeyBuf  = AllocateZeroPool (DigestSize);
-  if (KeyBuf == NULL) {
-    Status = EFI_OUT_OF_RESOURCES;
-    goto EXIT;
-  }
-  
-  CopyMem (KeyBuf, Digest, DigestSize);
-
-  //
   // Calculate Prf(SK_Pi/r, IDi/r)
   //
   Fragments[0].Data     = IdPayload->PayloadBuf + sizeof (IKEV2_COMMON_PAYLOAD_HEADER);
   Fragments[0].DataSize = IdPayload->PayloadSize - sizeof (IKEV2_COMMON_PAYLOAD_HEADER);
 
@@ -861,13 +848,10 @@ Ikev2CertGenerateAuthPayload (
   //
   AuthPayload->PayloadBuf   = (UINT8 *) PayloadBuf;
   AuthPayload->PayloadType  = IKEV2_PAYLOAD_TYPE_AUTH;
 
 EXIT:
-  if (KeyBuf != NULL) {
-    FreePool (KeyBuf);
-  }
   if (Digest != NULL) {
     FreePool (Digest);
   }
   if (Signature != NULL) {
     FreePool (Signature);
@@ -1490,11 +1474,11 @@ Ikev2ParserNotifyCookiePayload (
   @param[in]  CertificateLen    The length of Certificate in byte.
   @param[in]  EncodeType        Specified the Certificate Encodeing which is defined
                                 in RFC 4306.
   @param[in]  IsRequest         To indicate create Certificate Payload or Certificate
                                 Request Payload. If it is TURE, create Certificate
-                                Payload. Otherwise, create Certificate Request Payload.
+                                Request Payload. Otherwise, create Certificate Payload.
 
   @retval  a Pointer to IKE Payload whose payload buffer containing the Certificate
            payload or Certificated Request payload.
 
 **/
-- 
1.9.5.msysgit.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-11-30  5:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-30  2:26 [Patch] NetworkPkg/IpSecDxe: correct one comment and remove the unused buf Jiaxin Wu
2016-11-30  2:37 ` Fu, Siyuan
2016-11-30  2:59 ` Zhang, Lubo
2016-11-30  5:49 ` Ye, Ting

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox