wpa_supplicant / hostapd  2.5
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Functions
wps_common.c File Reference

Wi-Fi Protected Setup - common functionality. More...

#include "includes.h"
#include "common.h"
#include "common/defs.h"
#include "common/ieee802_11_common.h"
#include "crypto/aes_wrap.h"
#include "crypto/crypto.h"
#include "crypto/dh_group5.h"
#include "crypto/sha1.h"
#include "crypto/sha256.h"
#include "crypto/random.h"
#include "wps_i.h"
#include "wps_dev_attr.h"

Functions

void wps_kdf (const u8 *key, const u8 *label_prefix, size_t label_prefix_len, const char *label, u8 *res, size_t res_len)
 
int wps_derive_keys (struct wps_data *wps)
 
void wps_derive_psk (struct wps_data *wps, const u8 *dev_passwd, size_t dev_passwd_len)
 
struct wpabufwps_decrypt_encr_settings (struct wps_data *wps, const u8 *encr, size_t encr_len)
 
unsigned int wps_pin_checksum (unsigned int pin)
 Compute PIN checksum. More...
 
unsigned int wps_pin_valid (unsigned int pin)
 Check whether a PIN has a valid checksum. More...
 
unsigned int wps_generate_pin (void)
 Generate a random PIN. More...
 
int wps_pin_str_valid (const char *pin)
 
void wps_fail_event (struct wps_context *wps, enum wps_msg_type msg, u16 config_error, u16 error_indication, const u8 *mac_addr)
 
void wps_success_event (struct wps_context *wps, const u8 *mac_addr)
 
void wps_pwd_auth_fail_event (struct wps_context *wps, int enrollee, int part, const u8 *mac_addr)
 
void wps_pbc_overlap_event (struct wps_context *wps)
 
void wps_pbc_timeout_event (struct wps_context *wps)
 
void wps_pbc_active_event (struct wps_context *wps)
 
void wps_pbc_disable_event (struct wps_context *wps)
 
int wps_dev_type_str2bin (const char *str, u8 dev_type[WPS_DEV_TYPE_LEN])
 
char * wps_dev_type_bin2str (const u8 dev_type[WPS_DEV_TYPE_LEN], char *buf, size_t buf_len)
 
void uuid_gen_mac_addr (const u8 *mac_addr, u8 *uuid)
 
u16 wps_config_methods_str2bin (const char *str)
 
struct wpabufwps_build_wsc_ack (struct wps_data *wps)
 
struct wpabufwps_build_wsc_nack (struct wps_data *wps)
 

Detailed Description

Wi-Fi Protected Setup - common functionality.

Function Documentation

unsigned int wps_generate_pin ( void  )

Generate a random PIN.

Returns
Eight digit PIN (i.e., including the checksum digit)
unsigned int wps_pin_checksum ( unsigned int  pin)

Compute PIN checksum.

Parameters
pinSeven digit PIN (i.e., eight digit PIN without the checksum digit)
Returns
Checksum digit
unsigned int wps_pin_valid ( unsigned int  pin)

Check whether a PIN has a valid checksum.

Parameters
pinEight digit PIN (i.e., including the checksum digit)
Returns
1 if checksum digit is valid, or 0 if not