Handle EAP MD5-Challenge.
51 const struct eap_md5 *md5req = req;
62 if ( req_len <
sizeof ( *md5req ) ) {
63 DBGC (
netdev,
"EAP %s underlength MD5-Challenge:\n",
69 if ( ( req_len -
sizeof ( *md5req ) ) < md5req->
len ) {
70 DBGC (
netdev,
"EAP %s truncated MD5-Challenge:\n",
79 DBGC (
netdev,
"EAP %s could not initialise CHAP: %s\n",
85 &password_setting, &secret );
86 if ( secret_len < 0 ) {
95 assert ( chap.response_len == sizeof ( md5rsp.value ) );
96 md5rsp.len =
sizeof ( md5rsp.value );
97 memcpy ( md5rsp.value, chap.response, sizeof ( md5rsp.value ) );
101 sizeof ( md5rsp ) ) ) != 0 )
#define EINVAL
Invalid argument.
struct arbelprm_rc_send_wqe rc
int fetch_raw_setting_copy(struct settings *settings, const struct setting *setting, void **data)
Fetch value of setting.
void chap_respond(struct chap_response *chap)
Respond to the CHAP challenge.
EAP MD5 challenge request/response type data.
uint8_t id
ID for current request/response.
static struct settings * netdev_settings(struct net_device *netdev)
Get per-netdevice configuration settings block.
void * memcpy(void *dest, const void *src, size_t len) __nonnull
int eap_tx_response(struct eap_supplicant *supplicant, const void *rsp, size_t rsp_len)
Transmit EAP response.
assert((readw(&hdr->flags) &(GTF_reading|GTF_writing))==0)
int chap_init(struct chap_response *chap, struct digest_algorithm *digest)
Initialise CHAP challenge/response.
static struct net_device * netdev
char * strerror(int errno)
Retrieve string representation of error number.
static void(* free)(struct refcnt *refcnt))
void chap_finish(struct chap_response *chap)
Free resources used by a CHAP response.
static void chap_set_identifier(struct chap_response *chap, unsigned int identifier)
Add identifier data to the CHAP challenge.
char name[NETDEV_NAME_LEN]
Name of this network device.
#define MD5_DIGEST_SIZE
MD5 digest size.
struct net_device * netdev
Network device.
void chap_update(struct chap_response *chap, const void *data, size_t len)
Add data to the CHAP challenge.
struct digest_algorithm md5_algorithm
MD5 algorithm.