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

IKEv2 common routines for initiator and responder. More...

#include "includes.h"
#include "common.h"
#include "crypto/crypto.h"
#include "crypto/md5.h"
#include "crypto/sha1.h"
#include "crypto/random.h"
#include "ikev2_common.h"

Macros

#define NUM_INTEG_ALGS   ARRAY_SIZE(ikev2_integ_algs)
 
#define NUM_PRF_ALGS   ARRAY_SIZE(ikev2_prf_algs)
 
#define NUM_ENCR_ALGS   ARRAY_SIZE(ikev2_encr_algs)
 

Functions

const struct ikev2_integ_algikev2_get_integ (int id)
 
int ikev2_integ_hash (int alg, const u8 *key, size_t key_len, const u8 *data, size_t data_len, u8 *hash)
 
const struct ikev2_prf_algikev2_get_prf (int id)
 
int ikev2_prf_hash (int alg, const u8 *key, size_t key_len, size_t num_elem, const u8 *addr[], const size_t *len, u8 *hash)
 
int ikev2_prf_plus (int alg, const u8 *key, size_t key_len, const u8 *data, size_t data_len, u8 *out, size_t out_len)
 
const struct ikev2_encr_algikev2_get_encr (int id)
 
int ikev2_encr_encrypt (int alg, const u8 *key, size_t key_len, const u8 *iv, const u8 *plain, u8 *crypt, size_t len)
 
int ikev2_encr_decrypt (int alg, const u8 *key, size_t key_len, const u8 *iv, const u8 *crypt, u8 *plain, size_t len)
 
int ikev2_parse_payloads (struct ikev2_payloads *payloads, u8 next_payload, const u8 *pos, const u8 *end)
 
int ikev2_derive_auth_data (int prf_alg, const struct wpabuf *sign_msg, const u8 *ID, size_t ID_len, u8 ID_type, struct ikev2_keys *keys, int initiator, const u8 *shared_secret, size_t shared_secret_len, const u8 *nonce, size_t nonce_len, const u8 *key_pad, size_t key_pad_len, u8 *auth_data)
 
u8 * ikev2_decrypt_payload (int encr_id, int integ_id, struct ikev2_keys *keys, int initiator, const struct ikev2_hdr *hdr, const u8 *encrypted, size_t encrypted_len, size_t *res_len)
 
void ikev2_update_hdr (struct wpabuf *msg)
 
int ikev2_build_encrypted (int encr_id, int integ_id, struct ikev2_keys *keys, int initiator, struct wpabuf *msg, struct wpabuf *plain, u8 next_payload)
 
int ikev2_keys_set (struct ikev2_keys *keys)
 
void ikev2_free_keys (struct ikev2_keys *keys)
 
int ikev2_derive_sk_keys (const struct ikev2_prf_alg *prf, const struct ikev2_integ_alg *integ, const struct ikev2_encr_alg *encr, const u8 *skeyseed, const u8 *data, size_t data_len, struct ikev2_keys *keys)
 

Detailed Description

IKEv2 common routines for initiator and responder.