iPXE
|
CHAP protocol. More...
Go to the source code of this file.
Data Structures | |
struct | chap_response |
A CHAP response. More... | |
Functions | |
FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
int | chap_init (struct chap_response *chap, struct digest_algorithm *digest) |
Initialise CHAP challenge/response. More... | |
void | chap_update (struct chap_response *chap, const void *data, size_t len) |
Add data to the CHAP challenge. More... | |
void | chap_respond (struct chap_response *chap) |
Respond to the CHAP challenge. More... | |
void | chap_finish (struct chap_response *chap) |
Free resources used by a CHAP response. More... | |
static void | chap_set_identifier (struct chap_response *chap, unsigned int identifier) |
Add identifier data to the CHAP challenge. More... | |
CHAP protocol.
Definition in file chap.h.
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
int chap_init | ( | struct chap_response * | chap, |
struct digest_algorithm * | digest | ||
) |
Initialise CHAP challenge/response.
chap | CHAP challenge/response |
digest | Digest algorithm to use |
rc | Return status code |
Initialises a CHAP challenge/response structure. This routine allocates memory, and so may fail. The allocated memory must eventually be freed by a call to chap_finish().
Definition at line 51 of file chap.c.
References assert(), digest_algorithm::ctxsize, DBG, chap_response::digest, chap_response::digest_context, digest_init(), digest_algorithm::digestsize, ENOMEM, malloc(), digest_algorithm::name, NULL, chap_response::response, chap_response::response_len, and state.
Referenced by eap_rx_md5(), iscsi_handle_chap_i_value(), and iscsi_handle_chap_r_value().
void chap_update | ( | struct chap_response * | chap, |
const void * | data, | ||
size_t | len | ||
) |
Add data to the CHAP challenge.
chap | CHAP response |
data | Data to add |
len | Length of data to add |
Definition at line 85 of file chap.c.
References assert(), data, chap_response::digest, chap_response::digest_context, digest_update(), len, and NULL.
Referenced by chap_set_identifier(), eap_rx_md5(), iscsi_handle_chap_c_value(), iscsi_handle_chap_i_value(), and iscsi_handle_chap_r_value().
void chap_respond | ( | struct chap_response * | chap | ) |
Respond to the CHAP challenge.
chap | CHAP response |
Calculates the final CHAP response value, and places it in chap->response
, with a length of chap->response_len
.
Definition at line 104 of file chap.c.
References assert(), DBG, chap_response::digest, chap_response::digest_context, digest_final(), NULL, and chap_response::response.
Referenced by eap_rx_md5(), iscsi_handle_chap_c_value(), and iscsi_handle_chap_r_value().
void chap_finish | ( | struct chap_response * | chap | ) |
Free resources used by a CHAP response.
chap | CHAP response |
Definition at line 122 of file chap.c.
References DBG, chap_response::digest_context, free, memset(), and state.
Referenced by eap_rx_md5(), iscsi_close_connection(), iscsi_free(), iscsi_handle_chap_i_value(), iscsi_handle_chap_r_value(), and iscsi_login_request_done().
|
inlinestatic |
Add identifier data to the CHAP challenge.
chap | CHAP response |
identifier | CHAP identifier |
The CHAP identifier is the first byte of the CHAP challenge. This function is a notational convenience for calling chap_update() for the identifier byte.
Definition at line 46 of file chap.h.
References chap_update().
Referenced by eap_rx_md5(), iscsi_handle_chap_i_value(), and iscsi_handle_chap_r_value().