+++ /dev/null
-/** @file\r
- The header file of CHAP configuration.\r
-\r
-Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials\r
-are licensed and made available under the terms and conditions of the BSD License\r
-which accompanies this distribution. The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php\r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-#ifndef _ISCSI_CHAP_H_\r
-#define _ISCSI_CHAP_H_\r
-\r
-#define ISCSI_AUTH_METHOD_CHAP "CHAP"\r
-\r
-#define ISCSI_KEY_CHAP_ALGORITHM "CHAP_A"\r
-#define ISCSI_KEY_CHAP_IDENTIFIER "CHAP_I"\r
-#define ISCSI_KEY_CHAP_CHALLENGE "CHAP_C"\r
-#define ISCSI_KEY_CHAP_NAME "CHAP_N"\r
-#define ISCSI_KEY_CHAP_RESPONSE "CHAP_R"\r
-\r
-#define ISCSI_CHAP_ALGORITHM_MD5 5\r
-\r
-#define ISCSI_CHAP_AUTH_MAX_LEN 1024\r
-///\r
-/// MD5_HASHSIZE\r
-///\r
-#define ISCSI_CHAP_RSP_LEN 16\r
-\r
-#define ISCSI_CHAP_INITIAL 0\r
-#define ISCSI_CHAP_STEP_ONE 1\r
-#define ISCSI_CHAP_STEP_TWO 2\r
-#define ISCSI_CHAP_STEP_THREE 3\r
-#define ISCSI_CHAP_STEP_FOUR 4\r
-\r
-#pragma pack(1)\r
-\r
-typedef struct _ISCSI_CHAP_AUTH_CONFIG_NVDATA {\r
- UINT8 CHAPType;\r
- CHAR8 CHAPName[ISCSI_CHAP_NAME_STORAGE];\r
- CHAR8 CHAPSecret[ISCSI_CHAP_SECRET_STORAGE];\r
- CHAR8 ReverseCHAPName[ISCSI_CHAP_NAME_STORAGE];\r
- CHAR8 ReverseCHAPSecret[ISCSI_CHAP_SECRET_STORAGE];\r
-} ISCSI_CHAP_AUTH_CONFIG_NVDATA;\r
-\r
-#pragma pack()\r
-\r
-///\r
-/// ISCSI CHAP Authentication Data\r
-///\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
- UINT32 InChallengeLength;\r
- //\r
- // Calculated CHAP Response (CHAP_R) value\r
- //\r
- UINT8 CHAPResponse[ISCSI_CHAP_RSP_LEN];\r
-\r
- //\r
- // Auth-data to be sent out for mutual authentication\r
- //\r
- UINT32 OutIdentifier;\r
- UINT8 OutChallenge[ISCSI_CHAP_AUTH_MAX_LEN];\r
- UINT32 OutChallengeLength;\r
-} ISCSI_CHAP_AUTH_DATA;\r
-\r
-/**\r
- This function checks the received iSCSI Login Response during the security\r
- negotiation stage.\r
-\r
- @param[in] Conn The iSCSI connection.\r
-\r
- @retval EFI_SUCCESS The Login Response passed the CHAP validation.\r
- @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.\r
- @retval EFI_PROTOCOL_ERROR Some kind of protocol error happend.\r
- @retval Others Other errors as indicated.\r
-**/\r
-EFI_STATUS\r
-IScsiCHAPOnRspReceived (\r
- IN ISCSI_CONNECTION *Conn\r
- );\r
-/**\r
- This function fills the CHAP authentication information into the login PDU\r
- during the security negotiation stage in the iSCSI connection login.\r
-\r
- @param[in] Conn The iSCSI connection.\r
- @param[in, out] Pdu The PDU to send out.\r
-\r
- @retval EFI_SUCCESS All check passed and the phase-related CHAP\r
- authentication info is filled into the iSCSI PDU.\r
- @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.\r
- @retval EFI_PROTOCOL_ERROR Some kind of protocol error happend.\r
-**/\r
-EFI_STATUS\r
-IScsiCHAPToSendReq (\r
- IN ISCSI_CONNECTION *Conn,\r
- IN OUT NET_BUF *Pdu\r
- );\r
-\r
-#endif\r