The ISCSI_CHAP_AUTH_MAX_LEN macro is defined with value 1024.
The usage of this macro currently involves a semantic (not functional)
bug, which we're going to fix in a subsequent patch, eliminating
ISCSI_CHAP_AUTH_MAX_LEN altogether.
For now, remove the macro's usage from all
"ISCSI_CHAP_AUTH_DATA.InChallenge" contexts. This is doable without
duplicating open-coded constants.
No changes in functionality.
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=3356
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Maciej Rabeda <maciej.rabeda@linux.intel.com>
Message-Id: <
20210608121259.32451-3-lersek@redhat.com>
}\r
\r
AuthData->InIdentifier = (UINT32) Result;\r
- AuthData->InChallengeLength = ISCSI_CHAP_AUTH_MAX_LEN;\r
+ AuthData->InChallengeLength = (UINT32) sizeof (AuthData->InChallenge);\r
IScsiHexToBin (\r
(UINT8 *) AuthData->InChallenge,\r
&AuthData->InChallengeLength,\r
typedef struct _ISCSI_CHAP_AUTH_DATA {\r
ISCSI_CHAP_AUTH_CONFIG_NVDATA *AuthConfig;\r
UINT32 InIdentifier;\r
- UINT8 InChallenge[ISCSI_CHAP_AUTH_MAX_LEN];\r
+ UINT8 InChallenge[1024];\r
UINT32 InChallengeLength;\r
//\r
// Calculated CHAP Response (CHAP_R) value.\r