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

SHA1-based key derivation function (PBKDF2) for IEEE 802.11i. More...

#include "includes.h"
#include "common.h"
#include "sha1.h"

Functions

int pbkdf2_sha1 (const char *passphrase, const u8 *ssid, size_t ssid_len, int iterations, u8 *buf, size_t buflen)
 SHA1-based key derivation function (PBKDF2) for IEEE 802.11i. More...
 

Detailed Description

SHA1-based key derivation function (PBKDF2) for IEEE 802.11i.

Function Documentation

int pbkdf2_sha1 ( const char *  passphrase,
const u8 *  ssid,
size_t  ssid_len,
int  iterations,
u8 *  buf,
size_t  buflen 
)

SHA1-based key derivation function (PBKDF2) for IEEE 802.11i.

Parameters
passphraseASCII passphrase
ssidSSID
ssid_lenSSID length in bytes
iterationsNumber of iterations to run
bufBuffer for the generated key
buflenLength of the buffer in bytes
Returns
0 on success, -1 of failure

This function is used to derive PSK for WPA-PSK. For this protocol, iterations is set to 4096 and buflen to 32. This function is described in IEEE Std 802.11-2004, Clause H.4. The main construction is from PKCS#5 v2.0.