#include <gnutls_int.h>
#include <gnutls_hash_int.h>
#include <gnutls_errors.h>
Go to the source code of this file.
Functions | |
static Gc_hash | MHD__gnutls_mac2gc (enum MHD_GNUTLS_HashAlgorithm mac) |
GNUTLS_HASH_HANDLE | MHD_gtls_hash_init (enum MHD_GNUTLS_HashAlgorithm algorithm) |
int | MHD_gnutls_hash_get_algo_len (enum MHD_GNUTLS_HashAlgorithm algorithm) |
int | MHD_gnutls_hash (GNUTLS_HASH_HANDLE handle, const void *text, size_t textlen) |
GNUTLS_HASH_HANDLE | MHD_gnutls_hash_copy (GNUTLS_HASH_HANDLE handle) |
void | MHD_gnutls_hash_deinit (GNUTLS_HASH_HANDLE handle, void *digest) |
mac_hd_t | MHD_gtls_MHD_hmac_init (enum MHD_GNUTLS_HashAlgorithm algorithm, const void *key, int keylen) |
void | MHD_gnutls_MHD_hmac_deinit (mac_hd_t handle, void *digest) |
static int | get_padsize (enum MHD_GNUTLS_HashAlgorithm algorithm) |
mac_hd_t | MHD_gnutls_mac_init_ssl3 (enum MHD_GNUTLS_HashAlgorithm algorithm, void *key, int keylen) |
void | MHD_gnutls_mac_deinit_ssl3 (mac_hd_t handle, void *digest) |
void | MHD_gnutls_mac_deinit_ssl3_handshake (mac_hd_t handle, void *digest, opaque *key, uint32_t key_size) |
static int | ssl3_sha (int i, opaque *secret, int secret_len, opaque *rnd, int rnd_len, void *digest) |
static int | ssl3_md5 (int i, opaque *secret, int secret_len, opaque *rnd, int rnd_len, void *digest) |
int | MHD_gnutls_ssl3_hash_md5 (void *first, int first_len, void *second, int second_len, int ret_len, opaque *ret) |
int | MHD_gnutls_ssl3_generate_random (void *secret, int secret_len, void *rnd, int rnd_len, int ret_bytes, opaque *ret) |
static int get_padsize | ( | enum MHD_GNUTLS_HashAlgorithm | algorithm | ) | [inline, static] |
Definition at line 193 of file gnutls_hash_int.c.
References MHD_GNUTLS_MAC_MD5, and MHD_GNUTLS_MAC_SHA1.
Referenced by MHD_gnutls_mac_deinit_ssl3(), MHD_gnutls_mac_deinit_ssl3_handshake(), and MHD_gnutls_mac_init_ssl3().
static Gc_hash MHD__gnutls_mac2gc | ( | enum MHD_GNUTLS_HashAlgorithm | mac | ) | [inline, static] |
Definition at line 34 of file gnutls_hash_int.c.
References GC_MD5, GC_SHA1, GC_SHA256, MHD_gnutls_assert, MHD_GNUTLS_MAC_MD5, MHD_GNUTLS_MAC_NULL, MHD_GNUTLS_MAC_SHA1, and MHD_GNUTLS_MAC_SHA256.
Referenced by MHD_gnutls_hash_get_algo_len(), MHD_gtls_hash_init(), and MHD_gtls_MHD_hmac_init().
int MHD_gnutls_hash | ( | GNUTLS_HASH_HANDLE | handle, | |
const void * | text, | |||
size_t | textlen | |||
) |
Definition at line 95 of file gnutls_hash_int.c.
References mac_hd_st::handle, and MHD_gc_hash_write().
Referenced by MHD__gnutls_cal_PRF_A(), MHD__gnutls_handshake_hash_add_sent(), MHD__gnutls_handshake_hash_pending(), MHD__gnutls_P_hash(), MHD__gnutls_ssl3_finished(), MHD_gnutls_mac_deinit_ssl3(), MHD_gnutls_mac_deinit_ssl3_handshake(), MHD_gnutls_mac_init_ssl3(), MHD_gnutls_ssl3_hash_md5(), MHD_gtls_ciphertext2compressed(), MHD_gtls_compressed2ciphertext(), MHD_gtls_tls_sign_params(), MHD_gtls_verify_sig_params(), ssl3_md5(), and ssl3_sha().
GNUTLS_HASH_HANDLE MHD_gnutls_hash_copy | ( | GNUTLS_HASH_HANDLE | handle | ) |
Definition at line 103 of file gnutls_hash_int.c.
References mac_hd_st::algorithm, GNUTLS_HASH_FAILED, mac_hd_st::handle, mac_hd_st::key, mac_hd_st::keysize, MHD_gc_hash_clone(), MHD_gnutls_free, and MHD_gnutls_malloc.
Referenced by MHD__gnutls_finished(), MHD__gnutls_ssl3_finished(), MHD_gtls_tls_sign_hdata(), and MHD_gtls_verify_sig_hdata().
void MHD_gnutls_hash_deinit | ( | GNUTLS_HASH_HANDLE | handle, | |
void * | digest | |||
) |
Definition at line 129 of file gnutls_hash_int.c.
References mac_hd_st::algorithm, mac_hd_st::handle, MHD_gc_hash_close(), MHD_gc_hash_read(), MHD_gnutls_free, and MHD_gnutls_hash_get_algo_len().
Referenced by MHD__gnutls_finished(), MHD__gnutls_handshake_hash_buffers_clear(), MHD__gnutls_ssl3_finished(), MHD_gnutls_mac_deinit_ssl3(), MHD_gnutls_mac_deinit_ssl3_handshake(), MHD_gnutls_ssl3_hash_md5(), MHD_gtls_tls_sign_hdata(), MHD_gtls_tls_sign_params(), MHD_gtls_verify_sig_hdata(), MHD_gtls_verify_sig_params(), ssl3_md5(), and ssl3_sha().
int MHD_gnutls_hash_get_algo_len | ( | enum MHD_GNUTLS_HashAlgorithm | algorithm | ) |
Definition at line 84 of file gnutls_hash_int.c.
References MHD__gnutls_mac2gc(), and MHD_gc_hash_digest_length().
Referenced by MHD__gnutls_P_hash(), MHD__gnutls_set_read_keys(), MHD__gnutls_set_write_keys(), MHD_gnutls_hash_deinit(), MHD_gnutls_mac_deinit_ssl3(), MHD_gnutls_mac_deinit_ssl3_handshake(), MHD_gnutls_MHD_hmac_deinit(), MHD_gnutls_ssl3_generate_random(), MHD_gnutls_ssl3_hash_md5(), MHD_gtls_ciphertext2compressed(), MHD_gtls_compressed2ciphertext(), MHD_gtls_read_connection_state_init(), MHD_gtls_write_connection_state_init(), and ssl3_md5().
void MHD_gnutls_mac_deinit_ssl3 | ( | mac_hd_t | handle, | |
void * | digest | |||
) |
Definition at line 238 of file gnutls_hash_int.c.
References mac_hd_st::algorithm, get_padsize(), GNUTLS_MAC_FAILED, mac_hd_st::key, mac_hd_st::keysize, MAX_HASH_SIZE, MHD_gnutls_assert, MHD_gnutls_hash(), MHD_gnutls_hash_deinit(), MHD_gnutls_hash_get_algo_len(), and MHD_gtls_hash_init().
Referenced by mac_deinit().
void MHD_gnutls_mac_deinit_ssl3_handshake | ( | mac_hd_t | handle, | |
void * | digest, | |||
opaque * | key, | |||
uint32_t | key_size | |||
) |
Definition at line 271 of file gnutls_hash_int.c.
References mac_hd_st::algorithm, get_padsize(), GNUTLS_HASH_FAILED, MAX_HASH_SIZE, MHD_gnutls_assert, MHD_gnutls_hash(), MHD_gnutls_hash_deinit(), MHD_gnutls_hash_get_algo_len(), and MHD_gtls_hash_init().
Referenced by MHD__gnutls_ssl3_finished(), MHD_gtls_tls_sign_hdata(), and MHD_gtls_verify_sig_hdata().
mac_hd_t MHD_gnutls_mac_init_ssl3 | ( | enum MHD_GNUTLS_HashAlgorithm | algorithm, | |
void * | key, | |||
int | keylen | |||
) |
Definition at line 207 of file gnutls_hash_int.c.
References get_padsize(), GNUTLS_HASH_FAILED, GNUTLS_MAC_FAILED, mac_hd_st::key, mac_hd_st::keysize, MHD_gnutls_assert, MHD_gnutls_hash(), and MHD_gtls_hash_init().
Referenced by mac_init().
void MHD_gnutls_MHD_hmac_deinit | ( | mac_hd_t | handle, | |
void * | digest | |||
) |
Definition at line 175 of file gnutls_hash_int.c.
References mac_hd_st::algorithm, mac_hd_st::handle, MHD_gc_hash_close(), MHD_gc_hash_read(), MHD_gnutls_free, and MHD_gnutls_hash_get_algo_len().
Referenced by mac_deinit(), MHD__gnutls_cal_PRF_A(), and MHD__gnutls_P_hash().
int MHD_gnutls_ssl3_generate_random | ( | void * | secret, | |
int | secret_len, | |||
void * | rnd, | |||
int | rnd_len, | |||
int | ret_bytes, | |||
opaque * | ret | |||
) |
Definition at line 407 of file gnutls_hash_int.c.
References MAX_HASH_SIZE, MHD_gnutls_assert, MHD_gnutls_hash_get_algo_len(), MHD_GNUTLS_MAC_MD5, and ssl3_md5().
Referenced by generate_normal_master(), and MHD__gnutls_set_keys().
int MHD_gnutls_ssl3_hash_md5 | ( | void * | first, | |
int | first_len, | |||
void * | second, | |||
int | second_len, | |||
int | ret_len, | |||
opaque * | ret | |||
) |
Definition at line 374 of file gnutls_hash_int.c.
References GNUTLS_E_HASH_FAILED, GNUTLS_E_INTERNAL_ERROR, MAX_HASH_SIZE, MHD_gnutls_assert, MHD_gnutls_hash(), MHD_gnutls_hash_deinit(), MHD_gnutls_hash_get_algo_len(), MHD_GNUTLS_MAC_MD5, and MHD_gtls_hash_init().
Referenced by MHD__gnutls_set_keys().
GNUTLS_HASH_HANDLE MHD_gtls_hash_init | ( | enum MHD_GNUTLS_HashAlgorithm | algorithm | ) |
Definition at line 58 of file gnutls_hash_int.c.
References mac_hd_st::algorithm, GNUTLS_HASH_FAILED, mac_hd_st::handle, MHD__gnutls_mac2gc(), MHD_gc_hash_open(), MHD_gnutls_assert, MHD_gnutls_free, and MHD_gnutls_malloc.
Referenced by MHD__gnutls_handshake_hash_init(), MHD_gnutls_mac_deinit_ssl3(), MHD_gnutls_mac_deinit_ssl3_handshake(), MHD_gnutls_mac_init_ssl3(), MHD_gnutls_ssl3_hash_md5(), MHD_gtls_tls_sign_params(), MHD_gtls_verify_sig_params(), ssl3_md5(), and ssl3_sha().
mac_hd_t MHD_gtls_MHD_hmac_init | ( | enum MHD_GNUTLS_HashAlgorithm | algorithm, | |
const void * | key, | |||
int | keylen | |||
) |
Definition at line 147 of file gnutls_hash_int.c.
References mac_hd_st::algorithm, GC_HMAC, GNUTLS_MAC_FAILED, mac_hd_st::handle, mac_hd_st::key, mac_hd_st::keysize, MHD__gnutls_mac2gc(), MHD_gc_hash_MHD_hmac_setkey(), MHD_gc_hash_open(), MHD_gnutls_free, and MHD_gnutls_malloc.
Referenced by mac_init(), MHD__gnutls_cal_PRF_A(), and MHD__gnutls_P_hash().
static int ssl3_md5 | ( | int | i, | |
opaque * | secret, | |||
int | secret_len, | |||
opaque * | rnd, | |||
int | rnd_len, | |||
void * | digest | |||
) | [static] |
Definition at line 342 of file gnutls_hash_int.c.
References GNUTLS_E_HASH_FAILED, MAX_HASH_SIZE, MHD_gnutls_assert, MHD_gnutls_hash(), MHD_gnutls_hash_deinit(), MHD_gnutls_hash_get_algo_len(), MHD_GNUTLS_MAC_MD5, MHD_GNUTLS_MAC_SHA1, MHD_gtls_hash_init(), and ssl3_sha().
Referenced by MHD_gnutls_ssl3_generate_random().
static int ssl3_sha | ( | int | i, | |
opaque * | secret, | |||
int | secret_len, | |||
opaque * | rnd, | |||
int | rnd_len, | |||
void * | digest | |||
) | [static] |
Definition at line 313 of file gnutls_hash_int.c.
References GNUTLS_E_HASH_FAILED, MHD_gnutls_assert, MHD_gnutls_hash(), MHD_gnutls_hash_deinit(), MHD_GNUTLS_MAC_SHA1, and MHD_gtls_hash_init().
Referenced by ssl3_md5().