106 if (
len <
sizeof ( *msreq ) ) {
107 DBGC (
netdev,
"EAP %s underlength MS-CHAPv2 request\n",
117 if ( username_len < 0 ) {
119 DBGC (
netdev,
"EAP %s has no username: %s\n",
125 if ( password_len < 0 ) {
127 DBGC (
netdev,
"EAP %s has no password: %s\n",
135 for ( i = 0 ; i < (
sizeof (
peer.
byte ) /
141 msrsp_len = (
sizeof ( *msrsp ) + username_len );
142 msrsp =
malloc ( msrsp_len );
152 msrsp->
len =
sizeof ( msrsp->
msg );
221 const void *req,
size_t req_len ) {
226 if ( req_len <
sizeof ( *
hdr ) ) {
227 DBGC (
netdev,
"EAP %s underlength MS-CHAPv2:\n",
234 switch (
hdr->code ) {
240 DBGC (
netdev,
"EAP %s unsupported MS-CHAPv2 opcode %d\n",
uint8_t len
MS-CHAPv2 response length (fixed value)
struct mschapv2_challenge msg
MS-CHAPv2 challenge.
#define EINVAL
Invalid argument.
struct arbelprm_rc_send_wqe rc
EAP MS-CHAPv2 request/response type data.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
struct golan_inbox_hdr hdr
Message header.
#define EAP_CODE_REQUEST
EAP request.
void mschapv2_response(const char *username, const char *password, const struct mschapv2_challenge *challenge, const struct mschapv2_challenge *peer, struct mschapv2_response *response)
Calculate MS-CHAPv2 challenge response.
uint8_t len
MS-CHAPv2 challenge length (fixed value)
uint8_t byte[16]
Raw bytes.
static struct settings * netdev_settings(struct net_device *netdev)
Get per-netdevice configuration settings block.
#define ENOTSUP
Operation not supported.
#define EAP_CODE_RESPONSE
EAP response.
struct eap_mschapv2 hdr
EAP-MSCHAPv2 header.
static int eap_rx_mschapv2(struct eap_supplicant *supplicant, const void *req, size_t req_len)
Handle EAP MS-CHAPv2.
#define ENOMEM
Not enough space.
void * memcpy(void *dest, const void *src, size_t len) __nonnull
#define EAP_TYPE_MSCHAPV2
EAP MS-CHAPv2 request/response.
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)
#define container_of(ptr, type, field)
Get containing structure.
MS-CHAPv2 authentication.
static struct net_device * netdev
int fetch_string_setting_copy(struct settings *settings, const struct setting *setting, char **data)
Fetch value of string setting.
struct eap_method eap_mschapv2_method __eap_method
EAP MS-CHAPv2 method.
char * strerror(int errno)
Retrieve string representation of error number.
static void(* free)(struct refcnt *refcnt))
long int random(void)
Generate a pseudo-random number between 0 and 2147483647L or 2147483562?
An EAP MS-CHAPv2 success response message.
An EAP MS-CHAPv2 success request message.
An MS-CHAPv2 challenge response.
#define EAP_CODE_SUCCESS
EAP success.
void * malloc(size_t size)
Allocate memory.
static struct dynamic_item password
char name[NETDEV_NAME_LEN]
Name of this network device.
static int eap_rx_mschapv2_success(struct eap_supplicant *supplicant, const struct eap_mschapv2 *hdr, size_t len)
Handle EAP MS-CHAPv2 success request.
static struct dynamic_item username
An EAP MS-CHAPv2 request message.
struct net_device * netdev
Network device.
struct mschapv2_challenge peer
Peer challenge.
struct eap_mschapv2 hdr
EAP-MSCHAPv2 header.
struct mschapv2_response msg
MS-CHAPv2 response.
struct eap_mschapv2 hdr
EAP-MSCHAPv2 header.
static int eap_rx_mschapv2_request(struct eap_supplicant *supplicant, const struct eap_mschapv2 *hdr, size_t len)
Handle EAP MS-CHAPv2 request.
An EAP MS-CHAPv2 response message.
Extensible Authentication Protocol.