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

TLS PRF P_SHA256. More...

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

Functions

void tls_prf_sha256 (const u8 *secret, size_t secret_len, const char *label, const u8 *seed, size_t seed_len, u8 *out, size_t outlen)
 Pseudo-Random Function for TLS v1.2 (P_SHA256, RFC 5246) More...
 

Detailed Description

TLS PRF P_SHA256.

Function Documentation

void tls_prf_sha256 ( const u8 *  secret,
size_t  secret_len,
const char *  label,
const u8 *  seed,
size_t  seed_len,
u8 *  out,
size_t  outlen 
)

Pseudo-Random Function for TLS v1.2 (P_SHA256, RFC 5246)

Parameters
secretKey for PRF
secret_lenLength of the key in bytes
labelA unique label for each purpose of the PRF
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 TLS. This PRF is defined in RFC 2246, Chapter 5.