Functions | |
EFI_STATUS | IScsiCHAPCalculateResponse (IN UINT32 ChapIdentifier, IN CHAR8 *ChapSecret, IN UINT32 SecretLength, IN UINT8 *ChapChallenge, IN UINT32 ChallengeLength, 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) |
Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
EFI_STATUS IScsiCHAPAuthTarget | ( | IN ISCSI_CHAP_AUTH_DATA * | AuthData, | |
IN UINT8 * | TargetResponse | |||
) |
The initator 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. |
References ISCSI_CHAP_RSP_LEN, and IScsiCHAPCalculateResponse().
Referenced by IScsiCHAPOnRspReceived().
EFI_STATUS IScsiCHAPCalculateResponse | ( | IN UINT32 | ChapIdentifier, | |
IN CHAR8 * | ChapSecret, | |||
IN UINT32 | SecretLength, | |||
IN UINT8 * | ChapChallenge, | |||
IN UINT32 | ChallengeLength, | |||
OUT UINT8 * | ChapResponse | |||
) |
Initator 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. |
[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 | MD5 hash operation fail. | |
EFI_OUT_OF_RESOURCES | Fail to allocate resource to complete MD5. |
References ISCSI_CHAP_SECRET_MIN_LEN.
Referenced by IScsiCHAPAuthTarget(), and IScsiCHAPOnRspReceived().
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. |
References _ISCSI_CHAP_AUTH_DATA::AuthConfig, _ISCSI_SESSION::AuthData, _ISCSI_SESSION::AuthType, _ISCSI_SESSION::CHAP, _ISCSI_CHAP_AUTH_DATA::CHAPResponse, _ISCSI_CHAP_AUTH_CONFIG_NVDATA::CHAPSecret, _ISCSI_CHAP_AUTH_CONFIG_NVDATA::CHAPType, _ISCSI_CHAP_AUTH_DATA::InChallenge, _ISCSI_CHAP_AUTH_DATA::InChallengeLength, _ISCSI_CHAP_AUTH_DATA::InIdentifier, ISCSI_AUTH_INITIAL, ISCSI_AUTH_METHOD_CHAP, ISCSI_AUTH_TYPE_CHAP, ISCSI_AUTH_TYPE_NONE, ISCSI_CHAP_ALGORITHM_MD5, ISCSI_CHAP_AUTH_MAX_LEN, ISCSI_CHAP_MUTUAL, ISCSI_CHAP_RSP_LEN, ISCSI_CHAP_STEP_FOUR, ISCSI_CHAP_STEP_ONE, ISCSI_CHAP_STEP_THREE, ISCSI_CHAP_STEP_TWO, ISCSI_KEY_AUTH_METHOD, ISCSI_KEY_CHAP_ALGORITHM, ISCSI_KEY_CHAP_CHALLENGE, ISCSI_KEY_CHAP_IDENTIFIER, ISCSI_KEY_CHAP_NAME, ISCSI_KEY_CHAP_RESPONSE, ISCSI_KEY_TARGET_PORTAL_GROUP_TAG, ISCSI_KEY_VALUE_NONE, ISCSI_SECURITY_NEGOTIATION, IScsiBuildKeyValueList(), IScsiCHAPAuthTarget(), IScsiCHAPCalculateResponse(), IScsiFreeKeyValueList(), IScsiGetValueByKeyFromList(), IScsiHexToBin(), IScsiNetNtoi(), and _ISCSI_SESSION::TargetPortalGroupTag.
Referenced by IScsiProcessLoginRsp().
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. |
References _ISCSI_CHAP_AUTH_DATA::AuthConfig, _ISCSI_SESSION::AuthData, _ISCSI_SESSION::AuthType, _ISCSI_SESSION::CHAP, _ISCSI_CHAP_AUTH_CONFIG_NVDATA::CHAPName, _ISCSI_CHAP_AUTH_DATA::CHAPResponse, _ISCSI_CHAP_AUTH_CONFIG_NVDATA::CHAPType, _ISCSI_SESSION::ConfigData, ISCSI_PRIVATE_DATA::InitiatorName, ISCSI_AUTH_INITIAL, ISCSI_AUTH_METHOD_CHAP, ISCSI_AUTH_TYPE_NONE, ISCSI_CHAP_ALGORITHM_MD5, ISCSI_CHAP_MUTUAL, ISCSI_CHAP_RSP_LEN, ISCSI_CHAP_STEP_FOUR, ISCSI_CHAP_STEP_ONE, ISCSI_CHAP_STEP_THREE, ISCSI_CHAP_STEP_TWO, ISCSI_KEY_AUTH_METHOD, ISCSI_KEY_CHAP_ALGORITHM, ISCSI_KEY_CHAP_CHALLENGE, ISCSI_KEY_CHAP_IDENTIFIER, ISCSI_KEY_CHAP_NAME, ISCSI_KEY_CHAP_RESPONSE, ISCSI_KEY_INITIATOR_NAME, ISCSI_KEY_SESSION_TYPE, ISCSI_KEY_TARGET_NAME, ISCSI_KEY_VALUE_NONE, ISCSI_LOGIN_REQ_PDU_FLAG_TRANSIT, ISCSI_SECURITY_NEGOTIATION, ISCSI_SET_FLAG, IScsiAddKeyValuePair(), IScsiBinToHex(), IScsiGenRandom(), mPrivate, _ISCSI_CHAP_AUTH_DATA::OutChallenge, _ISCSI_CHAP_AUTH_DATA::OutChallengeLength, _ISCSI_CHAP_AUTH_DATA::OutIdentifier, _ISCSI_ATTEMPT_CONFIG_NVDATA::SessionConfigData, and _ISCSI_SESSION_CONFIG_NVDATA::TargetName.
Referenced by IScsiPrepareLoginReq().