[edk2-devel] [PATCH 2/6] NetworkPkg/IScsiDxe: add horizontal whitespace to IScsiCHAP files

Laszlo Ersek posted 6 patches 4 years, 8 months ago
There is a newer version of this series
[edk2-devel] [PATCH 2/6] NetworkPkg/IScsiDxe: add horizontal whitespace to IScsiCHAP files
Posted by Laszlo Ersek 4 years, 8 months ago
In the next patches, we'll need more room for various macro and parameter
names. For maintaining the current visual alignments, insert some
horizontal whitespace in preparation. "git show -b" produces no output for
this patch; the patch introduces no functional changes.

Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Cc: Maciej Rabeda <maciej.rabeda@linux.intel.com>
Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
Cc: Siyuan Fu <siyuan.fu@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3355
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
---
 NetworkPkg/IScsiDxe/IScsiCHAP.h | 24 ++++++++++----------
 NetworkPkg/IScsiDxe/IScsiCHAP.c | 12 +++++-----
 2 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/NetworkPkg/IScsiDxe/IScsiCHAP.h b/NetworkPkg/IScsiDxe/IScsiCHAP.h
index 35d5d6ec29e3..d6a90fc27fc3 100644
--- a/NetworkPkg/IScsiDxe/IScsiCHAP.h
+++ b/NetworkPkg/IScsiDxe/IScsiCHAP.h
@@ -1,49 +1,49 @@
 /** @file
   The header file of CHAP configuration.
 
 Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
 SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
 
 #ifndef _ISCSI_CHAP_H_
 #define _ISCSI_CHAP_H_
 
-#define ISCSI_AUTH_METHOD_CHAP    "CHAP"
+#define ISCSI_AUTH_METHOD_CHAP                    "CHAP"
 
-#define ISCSI_KEY_CHAP_ALGORITHM  "CHAP_A"
-#define ISCSI_KEY_CHAP_IDENTIFIER "CHAP_I"
-#define ISCSI_KEY_CHAP_CHALLENGE  "CHAP_C"
-#define ISCSI_KEY_CHAP_NAME       "CHAP_N"
-#define ISCSI_KEY_CHAP_RESPONSE   "CHAP_R"
+#define ISCSI_KEY_CHAP_ALGORITHM                  "CHAP_A"
+#define ISCSI_KEY_CHAP_IDENTIFIER                 "CHAP_I"
+#define ISCSI_KEY_CHAP_CHALLENGE                  "CHAP_C"
+#define ISCSI_KEY_CHAP_NAME                       "CHAP_N"
+#define ISCSI_KEY_CHAP_RESPONSE                   "CHAP_R"
 
-#define ISCSI_CHAP_ALGORITHM_MD5  5
+#define ISCSI_CHAP_ALGORITHM_MD5                  5
 
 ///
 /// MD5_HASHSIZE
 ///
-#define ISCSI_CHAP_RSP_LEN        16
+#define ISCSI_CHAP_RSP_LEN                        16
 
-#define ISCSI_CHAP_STEP_ONE       1
-#define ISCSI_CHAP_STEP_TWO       2
-#define ISCSI_CHAP_STEP_THREE     3
-#define ISCSI_CHAP_STEP_FOUR      4
+#define ISCSI_CHAP_STEP_ONE                       1
+#define ISCSI_CHAP_STEP_TWO                       2
+#define ISCSI_CHAP_STEP_THREE                     3
+#define ISCSI_CHAP_STEP_FOUR                      4
 
 
 #pragma pack(1)
 
 typedef struct _ISCSI_CHAP_AUTH_CONFIG_NVDATA {
   UINT8 CHAPType;
   CHAR8 CHAPName[ISCSI_CHAP_NAME_STORAGE];
   CHAR8 CHAPSecret[ISCSI_CHAP_SECRET_STORAGE];
   CHAR8 ReverseCHAPName[ISCSI_CHAP_NAME_STORAGE];
   CHAR8 ReverseCHAPSecret[ISCSI_CHAP_SECRET_STORAGE];
 } ISCSI_CHAP_AUTH_CONFIG_NVDATA;
 
 #pragma pack()
 
 ///
 /// ISCSI CHAP Authentication Data
 ///
 typedef struct _ISCSI_CHAP_AUTH_DATA {
   ISCSI_CHAP_AUTH_CONFIG_NVDATA *AuthConfig;
diff --git a/NetworkPkg/IScsiDxe/IScsiCHAP.c b/NetworkPkg/IScsiDxe/IScsiCHAP.c
index 7e930c0d1eab..bb84f4359d35 100644
--- a/NetworkPkg/IScsiDxe/IScsiCHAP.c
+++ b/NetworkPkg/IScsiDxe/IScsiCHAP.c
@@ -14,44 +14,44 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 
   @param[in]   ChapIdentifier     iSCSI CHAP identifier sent by authenticator.
   @param[in]   ChapSecret         iSCSI CHAP secret of the authenticator.
   @param[in]   SecretLength       The length of iSCSI CHAP secret.
   @param[in]   ChapChallenge      The challenge message sent by authenticator.
   @param[in]   ChallengeLength    The length of iSCSI CHAP challenge message.
   @param[out]  ChapResponse       The calculation of the expected hash value.
 
   @retval EFI_SUCCESS             The expected hash value was calculatedly
                                   successfully.
   @retval EFI_PROTOCOL_ERROR      The length of the secret should be at least
                                   the length of the hash value for the hashing
                                   algorithm chosen.
   @retval EFI_PROTOCOL_ERROR      MD5 hash operation fail.
   @retval EFI_OUT_OF_RESOURCES    Fail to allocate resource to complete MD5.
 
 **/
 EFI_STATUS
 IScsiCHAPCalculateResponse (
-  IN  UINT32  ChapIdentifier,
-  IN  CHAR8   *ChapSecret,
-  IN  UINT32  SecretLength,
-  IN  UINT8   *ChapChallenge,
-  IN  UINT32  ChallengeLength,
-  OUT UINT8   *ChapResponse
+  IN  UINT32          ChapIdentifier,
+  IN  CHAR8           *ChapSecret,
+  IN  UINT32          SecretLength,
+  IN  UINT8           *ChapChallenge,
+  IN  UINT32          ChallengeLength,
+  OUT UINT8           *ChapResponse
   )
 {
   UINTN       Md5ContextSize;
   VOID        *Md5Ctx;
   CHAR8       IdByte[1];
   EFI_STATUS  Status;
 
   if (SecretLength < ISCSI_CHAP_SECRET_MIN_LEN) {
     return EFI_PROTOCOL_ERROR;
   }
 
   Md5ContextSize = Md5GetContextSize ();
   Md5Ctx = AllocatePool (Md5ContextSize);
   if (Md5Ctx == NULL) {
     return EFI_OUT_OF_RESOURCES;
   }
 
   Status = EFI_PROTOCOL_ERROR;
 
-- 
2.19.1.3.g30247aa5d201




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#76215): https://edk2.groups.io/g/devel/message/76215
Mute This Topic: https://groups.io/mt/83395023/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [edk2-devel] [PATCH 2/6] NetworkPkg/IScsiDxe: add horizontal whitespace to IScsiCHAP files
Posted by Philippe Mathieu-Daudé 4 years, 8 months ago
On 6/8/21 3:06 PM, Laszlo Ersek wrote:
> In the next patches, we'll need more room for various macro and parameter
> names. For maintaining the current visual alignments, insert some
> horizontal whitespace in preparation. "git show -b" produces no output for
> this patch; the patch introduces no functional changes.
> 
> Cc: Jiaxin Wu <jiaxin.wu@intel.com>
> Cc: Maciej Rabeda <maciej.rabeda@linux.intel.com>
> Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
> Cc: Siyuan Fu <siyuan.fu@intel.com>
> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3355
> Signed-off-by: Laszlo Ersek <lersek@redhat.com>
> ---
>  NetworkPkg/IScsiDxe/IScsiCHAP.h | 24 ++++++++++----------
>  NetworkPkg/IScsiDxe/IScsiCHAP.c | 12 +++++-----
>  2 files changed, 18 insertions(+), 18 deletions(-)

Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#76259): https://edk2.groups.io/g/devel/message/76259
Mute This Topic: https://groups.io/mt/83395023/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [edk2-devel] [PATCH 2/6] NetworkPkg/IScsiDxe: add horizontal whitespace to IScsiCHAP files
Posted by Maciej Rabeda 4 years, 8 months ago
Nicely aligned spacing...

Feels Good Man by Daniel 168

Reviewed-by: Maciej Rabeda <maciej.rabeda@linux.intel.com>

On 08-Jun-21 15:06, Laszlo Ersek wrote:
> In the next patches, we'll need more room for various macro and parameter
> names. For maintaining the current visual alignments, insert some
> horizontal whitespace in preparation. "git show -b" produces no output for
> this patch; the patch introduces no functional changes.
>
> Cc: Jiaxin Wu <jiaxin.wu@intel.com>
> Cc: Maciej Rabeda <maciej.rabeda@linux.intel.com>
> Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
> Cc: Siyuan Fu <siyuan.fu@intel.com>
> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3355
> Signed-off-by: Laszlo Ersek <lersek@redhat.com>
> ---
>   NetworkPkg/IScsiDxe/IScsiCHAP.h | 24 ++++++++++----------
>   NetworkPkg/IScsiDxe/IScsiCHAP.c | 12 +++++-----
>   2 files changed, 18 insertions(+), 18 deletions(-)
>
> diff --git a/NetworkPkg/IScsiDxe/IScsiCHAP.h b/NetworkPkg/IScsiDxe/IScsiCHAP.h
> index 35d5d6ec29e3..d6a90fc27fc3 100644
> --- a/NetworkPkg/IScsiDxe/IScsiCHAP.h
> +++ b/NetworkPkg/IScsiDxe/IScsiCHAP.h
> @@ -1,49 +1,49 @@
>   /** @file
>     The header file of CHAP configuration.
>   
>   Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
>   SPDX-License-Identifier: BSD-2-Clause-Patent
>   
>   **/
>   
>   #ifndef _ISCSI_CHAP_H_
>   #define _ISCSI_CHAP_H_
>   
> -#define ISCSI_AUTH_METHOD_CHAP    "CHAP"
> +#define ISCSI_AUTH_METHOD_CHAP                    "CHAP"
>   
> -#define ISCSI_KEY_CHAP_ALGORITHM  "CHAP_A"
> -#define ISCSI_KEY_CHAP_IDENTIFIER "CHAP_I"
> -#define ISCSI_KEY_CHAP_CHALLENGE  "CHAP_C"
> -#define ISCSI_KEY_CHAP_NAME       "CHAP_N"
> -#define ISCSI_KEY_CHAP_RESPONSE   "CHAP_R"
> +#define ISCSI_KEY_CHAP_ALGORITHM                  "CHAP_A"
> +#define ISCSI_KEY_CHAP_IDENTIFIER                 "CHAP_I"
> +#define ISCSI_KEY_CHAP_CHALLENGE                  "CHAP_C"
> +#define ISCSI_KEY_CHAP_NAME                       "CHAP_N"
> +#define ISCSI_KEY_CHAP_RESPONSE                   "CHAP_R"
>   
> -#define ISCSI_CHAP_ALGORITHM_MD5  5
> +#define ISCSI_CHAP_ALGORITHM_MD5                  5
>   
>   ///
>   /// MD5_HASHSIZE
>   ///
> -#define ISCSI_CHAP_RSP_LEN        16
> +#define ISCSI_CHAP_RSP_LEN                        16
>   
> -#define ISCSI_CHAP_STEP_ONE       1
> -#define ISCSI_CHAP_STEP_TWO       2
> -#define ISCSI_CHAP_STEP_THREE     3
> -#define ISCSI_CHAP_STEP_FOUR      4
> +#define ISCSI_CHAP_STEP_ONE                       1
> +#define ISCSI_CHAP_STEP_TWO                       2
> +#define ISCSI_CHAP_STEP_THREE                     3
> +#define ISCSI_CHAP_STEP_FOUR                      4
>   
>   
>   #pragma pack(1)
>   
>   typedef struct _ISCSI_CHAP_AUTH_CONFIG_NVDATA {
>     UINT8 CHAPType;
>     CHAR8 CHAPName[ISCSI_CHAP_NAME_STORAGE];
>     CHAR8 CHAPSecret[ISCSI_CHAP_SECRET_STORAGE];
>     CHAR8 ReverseCHAPName[ISCSI_CHAP_NAME_STORAGE];
>     CHAR8 ReverseCHAPSecret[ISCSI_CHAP_SECRET_STORAGE];
>   } ISCSI_CHAP_AUTH_CONFIG_NVDATA;
>   
>   #pragma pack()
>   
>   ///
>   /// ISCSI CHAP Authentication Data
>   ///
>   typedef struct _ISCSI_CHAP_AUTH_DATA {
>     ISCSI_CHAP_AUTH_CONFIG_NVDATA *AuthConfig;
> diff --git a/NetworkPkg/IScsiDxe/IScsiCHAP.c b/NetworkPkg/IScsiDxe/IScsiCHAP.c
> index 7e930c0d1eab..bb84f4359d35 100644
> --- a/NetworkPkg/IScsiDxe/IScsiCHAP.c
> +++ b/NetworkPkg/IScsiDxe/IScsiCHAP.c
> @@ -14,44 +14,44 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
>   
>     @param[in]   ChapIdentifier     iSCSI CHAP identifier sent by authenticator.
>     @param[in]   ChapSecret         iSCSI CHAP secret of the authenticator.
>     @param[in]   SecretLength       The length of iSCSI CHAP secret.
>     @param[in]   ChapChallenge      The challenge message sent by authenticator.
>     @param[in]   ChallengeLength    The length of iSCSI CHAP challenge message.
>     @param[out]  ChapResponse       The calculation of the expected hash value.
>   
>     @retval EFI_SUCCESS             The expected hash value was calculatedly
>                                     successfully.
>     @retval EFI_PROTOCOL_ERROR      The length of the secret should be at least
>                                     the length of the hash value for the hashing
>                                     algorithm chosen.
>     @retval EFI_PROTOCOL_ERROR      MD5 hash operation fail.
>     @retval EFI_OUT_OF_RESOURCES    Fail to allocate resource to complete MD5.
>   
>   **/
>   EFI_STATUS
>   IScsiCHAPCalculateResponse (
> -  IN  UINT32  ChapIdentifier,
> -  IN  CHAR8   *ChapSecret,
> -  IN  UINT32  SecretLength,
> -  IN  UINT8   *ChapChallenge,
> -  IN  UINT32  ChallengeLength,
> -  OUT UINT8   *ChapResponse
> +  IN  UINT32          ChapIdentifier,
> +  IN  CHAR8           *ChapSecret,
> +  IN  UINT32          SecretLength,
> +  IN  UINT8           *ChapChallenge,
> +  IN  UINT32          ChallengeLength,
> +  OUT UINT8           *ChapResponse
>     )
>   {
>     UINTN       Md5ContextSize;
>     VOID        *Md5Ctx;
>     CHAR8       IdByte[1];
>     EFI_STATUS  Status;
>   
>     if (SecretLength < ISCSI_CHAP_SECRET_MIN_LEN) {
>       return EFI_PROTOCOL_ERROR;
>     }
>   
>     Md5ContextSize = Md5GetContextSize ();
>     Md5Ctx = AllocatePool (Md5ContextSize);
>     if (Md5Ctx == NULL) {
>       return EFI_OUT_OF_RESOURCES;
>     }
>   
>     Status = EFI_PROTOCOL_ERROR;
>   



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#76385): https://edk2.groups.io/g/devel/message/76385
Mute This Topic: https://groups.io/mt/83395023/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-