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

HMAC-SHA256 KDF (RFC 5295) More...

#include "includes.h"
#include "common.h"
#include "sha256.h"

Functions

int hmac_sha256_kdf (const u8 *secret, size_t secret_len, const char *label, const u8 *seed, size_t seed_len, u8 *out, size_t outlen)
 HMAC-SHA256 based KDF (RFC 5295) More...
 

Detailed Description

HMAC-SHA256 KDF (RFC 5295)

Function Documentation

int hmac_sha256_kdf ( const u8 *  secret,
size_t  secret_len,
const char *  label,
const u8 *  seed,
size_t  seed_len,
u8 *  out,
size_t  outlen 
)

HMAC-SHA256 based KDF (RFC 5295)

Parameters
secretKey for KDF
secret_lenLength of the key in bytes
labelA unique label for each purpose of the KDF
seedSeed value to bind into the key
seed_lenLength of the seed
outBuffer for the generated pseudo-random key
outlenNumber of bytes of key to generate
Returns
0 on success, -1 on failure.

This function is used to derive new, cryptographically separate keys from a given key in ERP. This KDF is defined in RFC 5295, Chapter 3.1.2.