TLSv1 common routines. More...
#include "includes.h"
#include "common.h"
#include "x509v3.h"
#include "tlsv1_common.h"
Go to the source code of this file.
Defines | |
#define | NUM_ELEMS(a) (sizeof(a) / sizeof((a)[0])) |
#define | NUM_TLS_CIPHER_SUITES NUM_ELEMS(tls_cipher_suites) |
#define | NUM_TLS_CIPHER_DATA NUM_ELEMS(tls_ciphers) |
Functions | |
struct tls_cipher_suite * | tls_get_cipher_suite (u16 suite) |
Get TLS cipher suite. | |
struct tls_cipher_data * | tls_get_cipher_data (tls_cipher cipher) |
int | tls_server_key_exchange_allowed (tls_cipher cipher) |
int | tls_parse_cert (const u8 *buf, size_t len, struct crypto_public_key **pk) |
Parse DER encoded X.509 certificate and get public key. | |
int | tls_verify_hash_init (struct tls_verify_hash *verify) |
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) |
TLSv1 common routines.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.
Alternatively, this software may be distributed under the terms of BSD license.
See README and COPYING for more details.
Definition in file tlsv1_common.c.
struct tls_cipher_suite* tls_get_cipher_suite | ( | u16 | suite | ) | [read] |
Get TLS cipher suite.
suite | Cipher suite identifier |
Definition at line 93 of file tlsv1_common.c.
int tls_parse_cert | ( | const u8 * | buf, | |
size_t | len, | |||
struct crypto_public_key ** | pk | |||
) |
Parse DER encoded X.509 certificate and get public key.
buf | ASN.1 DER encoded certificate | |
len | Length of the buffer | |
pk | Buffer for returning the allocated public key |
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 150 of file tlsv1_common.c.