Go to the source code of this file.
Defines | |
#define | NUM_ELEMS(a) (sizeof(a) / sizeof((a)[0])) |
#define | NUM_TLS_CIPHER_DATA NUM_ELEMS(tls_ciphers) |
#define | NUM_TLS_CIPHER_SUITES NUM_ELEMS(tls_cipher_suites) |
Functions | |
struct tls_cipher_data * | tls_get_cipher_data (tls_cipher cipher) |
struct tls_cipher_suite * | tls_get_cipher_suite (u16 suite) |
int | tls_parse_cert (const u8 *buf, size_t len, struct crypto_public_key **pk) |
int | tls_server_key_exchange_allowed (tls_cipher cipher) |
void | tls_verify_hash_add (struct tls_verify_hash *verify, const u8 *buf, size_t len) |
void | tls_verify_hash_free (struct tls_verify_hash *verify) |
int | tls_verify_hash_init (struct tls_verify_hash *verify) |
Variables | |
static struct tls_cipher_suite | tls_cipher_suites [] |
static struct tls_cipher_data | tls_ciphers [] |
#define NUM_ELEMS | ( | a | ) | (sizeof(a) / sizeof((a)[0])) |
Definition at line 56 of file tlsv1_common.c.
#define NUM_TLS_CIPHER_DATA NUM_ELEMS(tls_ciphers) |
Definition at line 83 of file tlsv1_common.c.
Definition at line 57 of file tlsv1_common.c.
struct tls_cipher_data* tls_get_cipher_data | ( | tls_cipher | cipher | ) | [read] |
Definition at line 101 of file tlsv1_common.c.
struct tls_cipher_suite* tls_get_cipher_suite | ( | u16 | suite | ) | [read] |
tls_get_cipher_suite - Get TLS cipher suite : Cipher suite identifier Returns: Pointer to the cipher data or NULL if not found
Definition at line 91 of file tlsv1_common.c.
int tls_parse_cert | ( | const u8 * | buf, |
size_t | len, | ||
struct crypto_public_key ** | pk | ||
) |
tls_parse_cert - Parse DER encoded X.509 certificate and get public key : ASN.1 DER encoded certificate : Length of the buffer : Buffer for returning the allocated public key Returns: 0 on success, -1 on failure
This functions parses an ASN.1 DER encoded X.509 certificate and retrieves the public key from it. The caller is responsible for freeing the public key by calling crypto_public_key_free().
Definition at line 147 of file tlsv1_common.c.
int tls_server_key_exchange_allowed | ( | tls_cipher | cipher | ) |
Definition at line 111 of file tlsv1_common.c.
void tls_verify_hash_add | ( | struct tls_verify_hash * | verify, |
const u8 * | buf, | ||
size_t | len | ||
) |
Definition at line 209 of file tlsv1_common.c.
void tls_verify_hash_free | ( | struct tls_verify_hash * | verify | ) |
Definition at line 227 of file tlsv1_common.c.
int tls_verify_hash_init | ( | struct tls_verify_hash * | verify | ) |
Definition at line 190 of file tlsv1_common.c.
struct tls_cipher_suite tls_cipher_suites[] [static] |
{ { TLS_NULL_WITH_NULL_NULL, TLS_KEY_X_NULL, TLS_CIPHER_NULL, TLS_HASH_NULL }, { TLS_RSA_WITH_RC4_128_MD5, TLS_KEY_X_RSA, TLS_CIPHER_RC4_128, TLS_HASH_MD5 }, { TLS_RSA_WITH_RC4_128_SHA, TLS_KEY_X_RSA, TLS_CIPHER_RC4_128, TLS_HASH_SHA }, { TLS_RSA_WITH_DES_CBC_SHA, TLS_KEY_X_RSA, TLS_CIPHER_DES_CBC, TLS_HASH_SHA }, { TLS_RSA_WITH_3DES_EDE_CBC_SHA, TLS_KEY_X_RSA, TLS_CIPHER_3DES_EDE_CBC, TLS_HASH_SHA }, { TLS_DH_anon_WITH_RC4_128_MD5, TLS_KEY_X_DH_anon, TLS_CIPHER_RC4_128, TLS_HASH_MD5 }, { TLS_DH_anon_WITH_DES_CBC_SHA, TLS_KEY_X_DH_anon, TLS_CIPHER_DES_CBC, TLS_HASH_SHA }, { TLS_DH_anon_WITH_3DES_EDE_CBC_SHA, TLS_KEY_X_DH_anon, TLS_CIPHER_3DES_EDE_CBC, TLS_HASH_SHA }, { TLS_RSA_WITH_AES_128_CBC_SHA, TLS_KEY_X_RSA, TLS_CIPHER_AES_128_CBC, TLS_HASH_SHA }, { TLS_DH_anon_WITH_AES_128_CBC_SHA, TLS_KEY_X_DH_anon, TLS_CIPHER_AES_128_CBC, TLS_HASH_SHA }, { TLS_RSA_WITH_AES_256_CBC_SHA, TLS_KEY_X_RSA, TLS_CIPHER_AES_256_CBC, TLS_HASH_SHA }, { TLS_DH_anon_WITH_AES_256_CBC_SHA, TLS_KEY_X_DH_anon, TLS_CIPHER_AES_256_CBC, TLS_HASH_SHA } }
Definition at line 29 of file tlsv1_common.c.
struct tls_cipher_data tls_ciphers[] [static] |
{ { TLS_CIPHER_NULL, TLS_CIPHER_STREAM, 0, 0, 0, CRYPTO_CIPHER_NULL }, { TLS_CIPHER_IDEA_CBC, TLS_CIPHER_BLOCK, 16, 16, 8, CRYPTO_CIPHER_NULL }, { TLS_CIPHER_RC2_CBC_40, TLS_CIPHER_BLOCK, 5, 16, 0, CRYPTO_CIPHER_ALG_RC2 }, { TLS_CIPHER_RC4_40, TLS_CIPHER_STREAM, 5, 16, 0, CRYPTO_CIPHER_ALG_RC4 }, { TLS_CIPHER_RC4_128, TLS_CIPHER_STREAM, 16, 16, 0, CRYPTO_CIPHER_ALG_RC4 }, { TLS_CIPHER_DES40_CBC, TLS_CIPHER_BLOCK, 5, 8, 8, CRYPTO_CIPHER_ALG_DES }, { TLS_CIPHER_DES_CBC, TLS_CIPHER_BLOCK, 8, 8, 8, CRYPTO_CIPHER_ALG_DES }, { TLS_CIPHER_3DES_EDE_CBC, TLS_CIPHER_BLOCK, 24, 24, 8, CRYPTO_CIPHER_ALG_3DES }, { TLS_CIPHER_AES_128_CBC, TLS_CIPHER_BLOCK, 16, 16, 16, CRYPTO_CIPHER_ALG_AES }, { TLS_CIPHER_AES_256_CBC, TLS_CIPHER_BLOCK, 32, 32, 16, CRYPTO_CIPHER_ALG_AES } }
Definition at line 60 of file tlsv1_common.c.