TianoCore EDK2 master
|
#include "IScsiImpl.h"
Go to the source code of this file.
Functions | |
EFI_STATUS | IScsiCHAPCalculateResponse (IN UINT32 ChapIdentifier, IN CHAR8 *ChapSecret, IN UINT32 SecretLength, IN UINT8 *ChapChallenge, IN UINT32 ChallengeLength, IN CONST CHAP_HASH *Hash, OUT UINT8 *ChapResponse) |
EFI_STATUS | IScsiCHAPAuthTarget (IN ISCSI_CHAP_AUTH_DATA *AuthData, IN UINT8 *TargetResponse) |
EFI_STATUS | IScsiCHAPOnRspReceived (IN ISCSI_CONNECTION *Conn) |
EFI_STATUS | IScsiCHAPToSendReq (IN ISCSI_CONNECTION *Conn, IN OUT NET_BUF *Pdu) |
VOID | IScsiCHAPInitHashList (VOID) |
Variables | |
STATIC CONST CHAP_HASH | mChapHash [] |
STATIC CHAR8 | mChapHashListString [3+(1+3) *(ARRAY_SIZE(mChapHash) - 1)+1+1] |
This file is for Challenge-Handshake Authentication Protocol (CHAP) Configuration.
Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.
Copyright (c) Microsoft Corporation SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file IScsiCHAP.c.
EFI_STATUS IScsiCHAPAuthTarget | ( | IN ISCSI_CHAP_AUTH_DATA * | AuthData, |
IN UINT8 * | TargetResponse | ||
) |
The initiator checks the CHAP response replied by target against its own calculation of the expected hash value.
[in] | AuthData | iSCSI CHAP authentication data. |
[in] | TargetResponse | The response from target. |
EFI_SUCCESS | The response from target passed authentication. |
EFI_SECURITY_VIOLATION | The response from target was not expected value. |
Others | Other errors as indicated. |
Definition at line 164 of file IScsiCHAP.c.
EFI_STATUS IScsiCHAPCalculateResponse | ( | IN UINT32 | ChapIdentifier, |
IN CHAR8 * | ChapSecret, | ||
IN UINT32 | SecretLength, | ||
IN UINT8 * | ChapChallenge, | ||
IN UINT32 | ChallengeLength, | ||
IN CONST CHAP_HASH * | Hash, | ||
OUT UINT8 * | ChapResponse | ||
) |
Initiator calculates its own expected hash value.
[in] | ChapIdentifier | iSCSI CHAP identifier sent by authenticator. |
[in] | ChapSecret | iSCSI CHAP secret of the authenticator. |
[in] | SecretLength | The length of iSCSI CHAP secret. |
[in] | ChapChallenge | The challenge message sent by authenticator. |
[in] | ChallengeLength | The length of iSCSI CHAP challenge message. |
[in] | Hash | Pointer to the CHAP_HASH structure that determines the hashing algorithm to use. The caller is responsible for making Hash point to an "mChapHash" element. |
[out] | ChapResponse | The calculation of the expected hash value. |
EFI_SUCCESS | The expected hash value was calculatedly successfully. |
EFI_PROTOCOL_ERROR | The length of the secret should be at least the length of the hash value for the hashing algorithm chosen. |
EFI_PROTOCOL_ERROR | Hash operation fails. |
EFI_OUT_OF_RESOURCES | Failure to allocate resource to complete hashing. |
Definition at line 85 of file IScsiCHAP.c.
VOID IScsiCHAPInitHashList | ( | VOID | ) |
Initialize the CHAP_A=<A1,A2...> value string for the entire driver, to be sent by the initiator in ISCSI_CHAP_STEP_ONE.
This function sanity-checks the internal table of supported CHAP hashing algorithms, as well.
Definition at line 635 of file IScsiCHAP.c.
EFI_STATUS IScsiCHAPOnRspReceived | ( | IN ISCSI_CONNECTION * | Conn | ) |
This function checks the received iSCSI Login Response during the security negotiation stage.
[in] | Conn | The iSCSI connection. |
EFI_SUCCESS | The Login Response passed the CHAP validation. |
EFI_OUT_OF_RESOURCES | Failed to allocate memory. |
EFI_PROTOCOL_ERROR | Some kind of protocol error occurred. |
Others | Other errors as indicated. |
Definition at line 215 of file IScsiCHAP.c.
EFI_STATUS IScsiCHAPToSendReq | ( | IN ISCSI_CONNECTION * | Conn, |
IN OUT NET_BUF * | Pdu | ||
) |
This function fills the CHAP authentication information into the login PDU during the security negotiation stage in the iSCSI connection login.
[in] | Conn | The iSCSI connection. |
[in,out] | Pdu | The PDU to send out. |
EFI_SUCCESS | All check passed and the phase-related CHAP authentication info is filled into the iSCSI PDU. |
EFI_OUT_OF_RESOURCES | Failed to allocate memory. |
EFI_PROTOCOL_ERROR | Some kind of protocol error occurred. |
Definition at line 470 of file IScsiCHAP.c.
Definition at line 18 of file IScsiCHAP.c.
STATIC CHAR8 mChapHashListString[ 3+(1+3) *(ARRAY_SIZE(mChapHash) - 1)+ 1+ 1] |
Definition at line 48 of file IScsiCHAP.c.