TianoCore EDK2 master
Loading...
Searching...
No Matches
IScsiCHAP.h File Reference

Go to the source code of this file.

Data Structures

struct  _ISCSI_CHAP_AUTH_CONFIG_NVDATA
 
struct  CHAP_HASH
 
struct  _ISCSI_CHAP_AUTH_DATA
 

Macros

#define ISCSI_AUTH_METHOD_CHAP   "CHAP"
 
#define ISCSI_KEY_CHAP_ALGORITHM   "CHAP_A"
 
#define ISCSI_KEY_CHAP_IDENTIFIER   "CHAP_I"
 
#define ISCSI_KEY_CHAP_CHALLENGE   "CHAP_C"
 
#define ISCSI_KEY_CHAP_NAME   "CHAP_N"
 
#define ISCSI_KEY_CHAP_RESPONSE   "CHAP_R"
 
#define ISCSI_CHAP_ALGORITHM_MD5   5
 
#define ISCSI_CHAP_ALGORITHM_SHA256   7
 
#define ISCSI_CHAP_MAX_DIGEST_SIZE   SHA256_DIGEST_SIZE
 
#define ISCSI_CHAP_STEP_ONE   1
 
#define ISCSI_CHAP_STEP_TWO   2
 
#define ISCSI_CHAP_STEP_THREE   3
 
#define ISCSI_CHAP_STEP_FOUR   4
 

Typedefs

typedef struct _ISCSI_CHAP_AUTH_CONFIG_NVDATA ISCSI_CHAP_AUTH_CONFIG_NVDATA
 
typedef UINTN(EFIAPI * CHAP_HASH_GET_CONTEXT_SIZE) (VOID)
 
typedef BOOLEAN(EFIAPI * CHAP_HASH_INIT) (OUT VOID *Context)
 
typedef BOOLEAN(EFIAPI * CHAP_HASH_UPDATE) (IN OUT VOID *Context, IN CONST VOID *Data, IN UINTN DataSize)
 
typedef BOOLEAN(EFIAPI * CHAP_HASH_FINAL) (IN OUT VOID *Context, OUT UINT8 *HashValue)
 
typedef struct _ISCSI_CHAP_AUTH_DATA ISCSI_CHAP_AUTH_DATA
 

Functions

EFI_STATUS IScsiCHAPOnRspReceived (IN ISCSI_CONNECTION *Conn)
 
EFI_STATUS IScsiCHAPToSendReq (IN ISCSI_CONNECTION *Conn, IN OUT NET_BUF *Pdu)
 
VOID IScsiCHAPInitHashList (VOID)
 

Detailed Description

The header file of CHAP configuration.

Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file IScsiCHAP.h.

Macro Definition Documentation

◆ ISCSI_AUTH_METHOD_CHAP

#define ISCSI_AUTH_METHOD_CHAP   "CHAP"

Definition at line 12 of file IScsiCHAP.h.

◆ ISCSI_CHAP_ALGORITHM_MD5

#define ISCSI_CHAP_ALGORITHM_MD5   5

Definition at line 24 of file IScsiCHAP.h.

◆ ISCSI_CHAP_ALGORITHM_SHA256

#define ISCSI_CHAP_ALGORITHM_SHA256   7

Definition at line 25 of file IScsiCHAP.h.

◆ ISCSI_CHAP_MAX_DIGEST_SIZE

#define ISCSI_CHAP_MAX_DIGEST_SIZE   SHA256_DIGEST_SIZE

Definition at line 31 of file IScsiCHAP.h.

◆ ISCSI_CHAP_STEP_FOUR

#define ISCSI_CHAP_STEP_FOUR   4

Definition at line 36 of file IScsiCHAP.h.

◆ ISCSI_CHAP_STEP_ONE

#define ISCSI_CHAP_STEP_ONE   1

Definition at line 33 of file IScsiCHAP.h.

◆ ISCSI_CHAP_STEP_THREE

#define ISCSI_CHAP_STEP_THREE   3

Definition at line 35 of file IScsiCHAP.h.

◆ ISCSI_CHAP_STEP_TWO

#define ISCSI_CHAP_STEP_TWO   2

Definition at line 34 of file IScsiCHAP.h.

◆ ISCSI_KEY_CHAP_ALGORITHM

#define ISCSI_KEY_CHAP_ALGORITHM   "CHAP_A"

Definition at line 14 of file IScsiCHAP.h.

◆ ISCSI_KEY_CHAP_CHALLENGE

#define ISCSI_KEY_CHAP_CHALLENGE   "CHAP_C"

Definition at line 16 of file IScsiCHAP.h.

◆ ISCSI_KEY_CHAP_IDENTIFIER

#define ISCSI_KEY_CHAP_IDENTIFIER   "CHAP_I"

Definition at line 15 of file IScsiCHAP.h.

◆ ISCSI_KEY_CHAP_NAME

#define ISCSI_KEY_CHAP_NAME   "CHAP_N"

Definition at line 17 of file IScsiCHAP.h.

◆ ISCSI_KEY_CHAP_RESPONSE

#define ISCSI_KEY_CHAP_RESPONSE   "CHAP_R"

Definition at line 18 of file IScsiCHAP.h.

Typedef Documentation

◆ CHAP_HASH_FINAL

typedef BOOLEAN(EFIAPI * CHAP_HASH_FINAL) (IN OUT VOID *Context, OUT UINT8 *HashValue)

Definition at line 74 of file IScsiCHAP.h.

◆ CHAP_HASH_GET_CONTEXT_SIZE

typedef UINTN(EFIAPI * CHAP_HASH_GET_CONTEXT_SIZE) (VOID)

Definition at line 54 of file IScsiCHAP.h.

◆ CHAP_HASH_INIT

typedef BOOLEAN(EFIAPI * CHAP_HASH_INIT) (OUT VOID *Context)

Definition at line 60 of file IScsiCHAP.h.

◆ CHAP_HASH_UPDATE

typedef BOOLEAN(EFIAPI * CHAP_HASH_UPDATE) (IN OUT VOID *Context, IN CONST VOID *Data, IN UINTN DataSize)

Definition at line 66 of file IScsiCHAP.h.

◆ ISCSI_CHAP_AUTH_DATA

ISCSI CHAP Authentication Data

Function Documentation

◆ IScsiCHAPInitHashList()

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.

◆ IScsiCHAPOnRspReceived()

EFI_STATUS IScsiCHAPOnRspReceived ( IN ISCSI_CONNECTION Conn)

This function checks the received iSCSI Login Response during the security negotiation stage.

Parameters
[in]ConnThe iSCSI connection.
Return values
EFI_SUCCESSThe Login Response passed the CHAP validation.
EFI_OUT_OF_RESOURCESFailed to allocate memory.
EFI_PROTOCOL_ERRORSome kind of protocol error occurred.
OthersOther errors as indicated.

Definition at line 215 of file IScsiCHAP.c.

◆ IScsiCHAPToSendReq()

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.

Parameters
[in]ConnThe iSCSI connection.
[in,out]PduThe PDU to send out.
Return values
EFI_SUCCESSAll check passed and the phase-related CHAP authentication info is filled into the iSCSI PDU.
EFI_OUT_OF_RESOURCESFailed to allocate memory.
EFI_PROTOCOL_ERRORSome kind of protocol error occurred.

Definition at line 470 of file IScsiCHAP.c.