OpenHIP 0.9svn1
|
#include <stdio.h>
#include <string.h>
#include <openssl/sha.h>
#include <openssl/des.h>
#include <openssl/dsa.h>
#include <hip/hip_types.h>
#include <hip/hip_proto.h>
#include <hip/hip_globals.h>
#include <hip/hip_funcs.h>
#include <hip/hip_sadb.h>
Defines | |
#define | MAX_KEYS 8 |
Functions | |
int | set_secret_key (unsigned char *key, hip_assoc *hip_a) |
unsigned char * | get_key (hip_assoc *hip_a, int type, int peer) |
void | compute_keys (hip_assoc *hip_a) |
int | compute_keymat (hip_assoc *hip_a) |
int | draw_keys (hip_assoc *hip_a, int draw_hip_keys, int keymat_index) |
int | draw_mr_key (hip_assoc *hip_a, int keymat_index) |
int | auth_key_len (int suite_id) |
int | enc_key_len (int suite_id) |
int | enc_iv_len (int suite_id) |
int | transform_to_ealg (int transform) |
int | transform_to_aalg (int transform) |
#define MAX_KEYS 8 |
int auth_key_len | ( | int | suite_id | ) |
References ESP_3DES_CBC_HMAC_MD5, ESP_3DES_CBC_HMAC_SHA1, ESP_AES_CBC_HMAC_SHA1, ESP_BLOWFISH_CBC_HMAC_SHA1, ESP_NULL_HMAC_MD5, ESP_NULL_HMAC_SHA1, KEY_LEN_MD5, and KEY_LEN_SHA1.
Referenced by build_tlv_hmac(), build_tlv_proxy_hmac(), complete_base_exchange(), draw_keys(), draw_mr_key(), hip_send_update_proxy_ticket(), rebuild_sa(), rebuild_sa_x2(), and validate_hmac().
int compute_keymat | ( | hip_assoc * | hip_a | ) |
References _hip_assoc::cookie_j, _hip_assoc::cookie_r, _hip_assoc::dh, _hip_assoc::dh_secret, _hip_assoc::hi, _hi_node::hit, HIT_SIZE, _hip_assoc::keymat, KEYMAT_SIZE, log_(), NORM, and _hip_assoc::peer_hi.
Referenced by compute_keys(), and hip_finish_rekey().
void compute_keys | ( | hip_assoc * | hip_a | ) |
References compute_keymat(), draw_keys(), and TRUE.
Referenced by hip_parse_I2(), and hip_send_I2().
int draw_keys | ( | hip_assoc * | hip_a, |
int | draw_hip_keys, | ||
int | keymat_index | ||
) |
References auth_key_len(), enc_key_len(), _hip_assoc::esp_transform, GL_ESP_AUTH_KEY, GL_ESP_ENCRYPTION_KEY, GL_HIP_ENCRYPTION_KEY, GL_HIP_INTEGRITY_KEY, HIP_KEY_SIZE, _hip_assoc::hip_transform, key_entry::key, _hip_assoc::keymat, _hip_assoc::keymat_index, KEYMAT_SIZE, _hip_assoc::keys, key_entry::length, LG_ESP_AUTH_KEY, LG_ESP_ENCRYPTION_KEY, LG_HIP_ENCRYPTION_KEY, LG_HIP_INTEGRITY_KEY, log_(), NORM, NUMKEYS, print_hex(), and key_entry::type.
Referenced by compute_keys(), hip_finish_rekey(), hip_handle_I2(), and hip_handle_R2().
int draw_mr_key | ( | hip_assoc * | hip_a, |
int | keymat_index | ||
) |
References auth_key_len(), _hip_assoc::hip_transform, key_entry::key, _hip_assoc::keymat, _hip_assoc::keymat_index, KEYMAT_SIZE, key_entry::length, log_(), _hip_assoc::mr_key, NORM, print_hex(), and key_entry::type.
Referenced by hip_handle_I2(), and hip_handle_R2().
int enc_iv_len | ( | int | suite_id | ) |
References ESP_3DES_CBC_HMAC_MD5, ESP_3DES_CBC_HMAC_SHA1, ESP_AES_CBC_HMAC_SHA1, ESP_BLOWFISH_CBC_HMAC_SHA1, ESP_NULL_HMAC_MD5, and ESP_NULL_HMAC_SHA1.
Referenced by hip_parse_I2(), and hip_send_I2().
int enc_key_len | ( | int | suite_id | ) |
References ESP_3DES_CBC_HMAC_MD5, ESP_3DES_CBC_HMAC_SHA1, ESP_AES_CBC_HMAC_SHA1, ESP_BLOWFISH_CBC_HMAC_SHA1, ESP_NULL_HMAC_MD5, ESP_NULL_HMAC_SHA1, KEY_LEN_3DES, KEY_LEN_AES, KEY_LEN_BLOWFISH, and KEY_LEN_NULL.
Referenced by complete_base_exchange(), draw_keys(), hip_parse_I2(), hip_send_I2(), rebuild_sa(), and rebuild_sa_x2().
unsigned char* get_key | ( | hip_assoc * | hip_a, |
int | type, | ||
int | peer | ||
) |
References compare_hits(), ESP_AUTH, ESP_ENCRYPTION, GL_ESP_AUTH_KEY, GL_ESP_ENCRYPTION_KEY, GL_HIP_ENCRYPTION_KEY, GL_HIP_INTEGRITY_KEY, _hip_assoc::hi, HIP_ENCRYPTION, HIP_INTEGRITY, _hi_node::hit, key_entry::key, _hip_assoc::keys, LG_ESP_AUTH_KEY, LG_ESP_ENCRYPTION_KEY, LG_HIP_ENCRYPTION_KEY, LG_HIP_INTEGRITY_KEY, and _hip_assoc::peer_hi.
Referenced by build_tlv_hmac(), complete_base_exchange(), hip_parse_close(), hip_parse_I1(), hip_parse_I2(), hip_parse_R2(), hip_parse_update(), hip_send_I2(), hip_send_update_proxy_ticket(), rebuild_sa(), and rebuild_sa_x2().
int set_secret_key | ( | unsigned char * | key, |
hip_assoc * | hip_a | ||
) |
References _hip_assoc::dh, _hip_assoc::dh_secret, log_(), NORM, and print_hex().
Referenced by hip_finish_rekey(), hip_parse_I2(), and hip_parse_R1().
int transform_to_aalg | ( | int | transform | ) |
References ESP_3DES_CBC_HMAC_MD5, ESP_3DES_CBC_HMAC_SHA1, ESP_AES_CBC_HMAC_SHA1, ESP_BLOWFISH_CBC_HMAC_SHA1, ESP_NULL_HMAC_MD5, ESP_NULL_HMAC_SHA1, SADB_AALG_MD5HMAC, and SADB_AALG_SHA1HMAC.
Referenced by complete_base_exchange(), rebuild_sa(), and rebuild_sa_x2().
int transform_to_ealg | ( | int | transform | ) |
References ESP_3DES_CBC_HMAC_MD5, ESP_3DES_CBC_HMAC_SHA1, ESP_AES_CBC_HMAC_SHA1, ESP_BLOWFISH_CBC_HMAC_SHA1, ESP_NULL_HMAC_MD5, ESP_NULL_HMAC_SHA1, SADB_EALG_3DESCBC, SADB_EALG_NULL, SADB_X_EALG_AESCBC, and SADB_X_EALG_BLOWFISHCBC.
Referenced by complete_base_exchange(), rebuild_sa(), and rebuild_sa_x2().