NetworkPkg: Apply uncrustify changes

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737

Apply uncrustify changes to .c/.h files in the NetworkPkg package

Cc: Andrew Fish <afish@apple.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Reviewed-by: Maciej Rabeda <maciej.rabeda@linux.intel.com>
This commit is contained in:
Michael Kubacki
2021-12-05 14:54:07 -08:00
committed by mergify[bot]
parent 2f88bd3a12
commit d1050b9dff
294 changed files with 29888 additions and 30440 deletions

View File

@@ -9,41 +9,40 @@ 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"
//
// Identifiers of supported CHAP hash algorithms:
// https://www.iana.org/assignments/ppp-numbers/ppp-numbers.xhtml#ppp-numbers-9
//
#define ISCSI_CHAP_ALGORITHM_MD5 5
#define ISCSI_CHAP_ALGORITHM_SHA256 7
#define ISCSI_CHAP_ALGORITHM_MD5 5
#define ISCSI_CHAP_ALGORITHM_SHA256 7
//
// Byte count of the largest digest over the above-listed
// ISCSI_CHAP_ALGORITHM_* hash algorithms.
//
#define ISCSI_CHAP_MAX_DIGEST_SIZE SHA256_DIGEST_SIZE
#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_MAX_DIGEST_SIZE SHA256_DIGEST_SIZE
#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];
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()
@@ -53,19 +52,19 @@ typedef struct _ISCSI_CHAP_AUTH_CONFIG_NVDATA {
//
typedef
UINTN
(EFIAPI *CHAP_HASH_GET_CONTEXT_SIZE) (
(EFIAPI *CHAP_HASH_GET_CONTEXT_SIZE)(
VOID
);
typedef
BOOLEAN
(EFIAPI *CHAP_HASH_INIT) (
(EFIAPI *CHAP_HASH_INIT)(
OUT VOID *Context
);
typedef
BOOLEAN
(EFIAPI *CHAP_HASH_UPDATE) (
(EFIAPI *CHAP_HASH_UPDATE)(
IN OUT VOID *Context,
IN CONST VOID *Data,
IN UINTN DataSize
@@ -73,37 +72,37 @@ BOOLEAN
typedef
BOOLEAN
(EFIAPI *CHAP_HASH_FINAL) (
(EFIAPI *CHAP_HASH_FINAL)(
IN OUT VOID *Context,
OUT UINT8 *HashValue
);
typedef struct {
UINT8 Algorithm; // ISCSI_CHAP_ALGORITHM_*, CHAP_A
UINT32 DigestSize;
CHAP_HASH_GET_CONTEXT_SIZE GetContextSize;
CHAP_HASH_INIT Init;
CHAP_HASH_UPDATE Update;
CHAP_HASH_FINAL Final;
UINT8 Algorithm; // ISCSI_CHAP_ALGORITHM_*, CHAP_A
UINT32 DigestSize;
CHAP_HASH_GET_CONTEXT_SIZE GetContextSize;
CHAP_HASH_INIT Init;
CHAP_HASH_UPDATE Update;
CHAP_HASH_FINAL Final;
} CHAP_HASH;
///
/// ISCSI CHAP Authentication Data
///
typedef struct _ISCSI_CHAP_AUTH_DATA {
ISCSI_CHAP_AUTH_CONFIG_NVDATA *AuthConfig;
UINT32 InIdentifier;
UINT8 InChallenge[1024];
UINT32 InChallengeLength;
ISCSI_CHAP_AUTH_CONFIG_NVDATA *AuthConfig;
UINT32 InIdentifier;
UINT8 InChallenge[1024];
UINT32 InChallengeLength;
//
// The hash algorithm (CHAP_A) that the target selects in
// ISCSI_CHAP_STEP_TWO.
//
CONST CHAP_HASH *Hash;
CONST CHAP_HASH *Hash;
//
// Calculated CHAP Response (CHAP_R) value.
//
UINT8 CHAPResponse[ISCSI_CHAP_MAX_DIGEST_SIZE];
UINT8 CHAPResponse[ISCSI_CHAP_MAX_DIGEST_SIZE];
//
// Auth-data to be sent out for mutual authentication.
@@ -113,8 +112,8 @@ typedef struct _ISCSI_CHAP_AUTH_DATA {
// digest size. In other words, it's good practice to feed *at least as many
// bytes* to the hashing algorithm as the hashing algorithm will output.
//
UINT32 OutIdentifier;
UINT8 OutChallenge[ISCSI_CHAP_MAX_DIGEST_SIZE];
UINT32 OutIdentifier;
UINT8 OutChallenge[ISCSI_CHAP_MAX_DIGEST_SIZE];
} ISCSI_CHAP_AUTH_DATA;
/**
@@ -133,6 +132,7 @@ EFI_STATUS
IScsiCHAPOnRspReceived (
IN ISCSI_CONNECTION *Conn
);
/**
This function fills the CHAP authentication information into the login PDU
during the security negotiation stage in the iSCSI connection login.
@@ -164,4 +164,5 @@ VOID
IScsiCHAPInitHashList (
VOID
);
#endif