audk/NetworkPkg/IScsiDxe
Laszlo Ersek 7b6c2b2a26 NetworkPkg/IScsiDxe: distinguish "maximum" and "selected" CHAP digest sizes
IScsiDxe uses the ISCSI_CHAP_RSP_LEN macro for expressing the size of the
digest (16) that it solely supports at this point (MD5).
ISCSI_CHAP_RSP_LEN is used for both (a) *allocating* digest-related
buffers (binary buffers and hex encodings alike), and (b) *processing*
binary digest buffers (comparing them, filling them, reading them).

In preparation for adding other hash algorithms, split purpose (a) from
purpose (b). For purpose (a) -- buffer allocation --, introduce
ISCSI_CHAP_MAX_DIGEST_SIZE. For purpose (b) -- processing --, rely on
MD5_DIGEST_SIZE from <BaseCryptLib.h>.

Distinguishing these purposes is justified because purpose (b) --
processing -- must depend on the hashing algorithm negotiated between
initiator and target, while for purpose (a) -- allocation --, using the
maximum supported digest size is suitable. For now, because only MD5 is
supported, introduce ISCSI_CHAP_MAX_DIGEST_SIZE *as* MD5_DIGEST_SIZE.

Note that the argument for using the digest size as the size of the
outgoing challenge (in case mutual authentication is desired by the
initiator) remains in place. Because of this, the above two purposes are
distinguished for the "ISCSI_CHAP_AUTH_DATA.OutChallenge" field as well.

This patch is functionally a no-op, just yet.

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>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Maciej Rabeda <maciej.rabeda@linux.intel.com>
Message-Id: <20210629163337.14120-4-lersek@redhat.com>
2021-06-30 19:20:41 +00:00
..
ComponentName.c NetworkPkg/IScsiDxe: Fix various typos 2020-02-10 22:30:07 +00:00
IScsiAuthenticationInfo.c NetworkPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:15 -07:00
IScsiCHAP.c NetworkPkg/IScsiDxe: distinguish "maximum" and "selected" CHAP digest sizes 2021-06-30 19:20:41 +00:00
IScsiCHAP.h NetworkPkg/IScsiDxe: distinguish "maximum" and "selected" CHAP digest sizes 2021-06-30 19:20:41 +00:00
IScsiConfig.c NetworkPkg/IScsiDxe: Fix various typos 2020-02-10 22:30:07 +00:00
IScsiConfig.h NetworkPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:15 -07:00
IScsiConfigNVDataStruc.h NetworkPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:15 -07:00
IScsiConfigStrings.uni NetworkPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:15 -07:00
IScsiConfigVfr.vfr NetworkPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:15 -07:00
IScsiDhcp.c NetworkPkg/IScsiDxe: Enhance the check for array boundary 2020-04-26 06:20:32 +00:00
IScsiDhcp.h NetworkPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:15 -07:00
IScsiDhcp6.c NetworkPkg/IScsiDxe: Enhance the check for array boundary 2020-04-26 06:20:32 +00:00
IScsiDhcp6.h NetworkPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:15 -07:00
IScsiDns.c NetworkPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:15 -07:00
IScsiDns.h NetworkPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:15 -07:00
IScsiDriver.c NetworkPkg/IScsiDxe: Fix various typos 2020-02-10 22:30:07 +00:00
IScsiDriver.h NetworkPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:15 -07:00
IScsiDxe.inf NetworkPkg/IScsiDxe: fix potential integer overflow in IScsiBinToHex() 2021-06-09 17:25:03 +00:00
IScsiDxe.uni NetworkPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:15 -07:00
IScsiDxeExtra.uni NetworkPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:15 -07:00
IScsiExtScsiPassThru.c NetworkPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:15 -07:00
IScsiIbft.c NetworkPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:15 -07:00
IScsiIbft.h NetworkPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:15 -07:00
IScsiImpl.h NetworkPkg/IScsiDxe: fix potential integer overflow in IScsiBinToHex() 2021-06-09 17:25:03 +00:00
IScsiInitiatorName.c NetworkPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:15 -07:00
IScsiMisc.c NetworkPkg/IScsiDxe: fix IScsiHexToBin() buffer overflow 2021-06-09 17:25:03 +00:00
IScsiMisc.h NetworkPkg/IScsiDxe: fix IScsiHexToBin() buffer overflow 2021-06-09 17:25:03 +00:00
IScsiProto.c NetworkPkg/IScsiDxe: re-set session-level authentication state before login 2021-06-30 19:20:41 +00:00
IScsiProto.h NetworkPkg/IScsiDxe: Fix various typos 2020-02-10 22:30:07 +00:00