renaming enums to have MHD_ prefix always, removing a few redundant values

This commit is contained in:
Christian Grothoff committed 2008-08-24 17:53:48 +00:00
1 parent bb5fc0ba65
commit 46622f6b02
52 files changed
+754 -665

No files matched your search

+12 -12
View File
@@ -113,9 +113,9 @@ clear:
* -1 otherwise.
*/
inline static int
_gnutls_check_pk_algo_in_list (const gnutls_pk_algorithm_t *
_gnutls_check_pk_algo_in_list (const enum MHD_GNUTLS_PublicKeyAlgorithm *
pk_algos, int pk_algos_length,
gnutls_pk_algorithm_t algo_to_check)
enum MHD_GNUTLS_PublicKeyAlgorithm algo_to_check)
{
int i;
for (i = 0; i < pk_algos_length; i++)
@@ -185,7 +185,7 @@ _gnutls_cert_get_issuer_dn (gnutls_cert * cert, gnutls_datum_t * odn)
static int
_find_x509_cert (const mhd_gtls_cert_credentials_t cred,
opaque * _data, size_t _data_size,
const gnutls_pk_algorithm_t * pk_algos,
const enum MHD_GNUTLS_PublicKeyAlgorithm * pk_algos,
int pk_algos_length, int *indx)
{
unsigned size;
@@ -348,14 +348,14 @@ static int
call_get_cert_callback (mhd_gtls_session_t session,
gnutls_datum_t * issuers_dn,
int issuers_dn_length,
gnutls_pk_algorithm_t * pk_algos, int pk_algos_length)
enum MHD_GNUTLS_PublicKeyAlgorithm * pk_algos, int pk_algos_length)
{
unsigned i;
gnutls_cert *local_certs = NULL;
gnutls_privkey *local_key = NULL;
gnutls_retr_st st;
int ret;
gnutls_certificate_type_t type = gnutls_certificate_type_get (session);
enum MHD_GNUTLS_CertificateType type = gnutls_certificate_type_get (session);
mhd_gtls_cert_credentials_t cred;
cred = (mhd_gtls_cert_credentials_t)
@@ -443,7 +443,7 @@ cleanup:
static int
_select_client_cert (mhd_gtls_session_t session,
opaque * _data, size_t _data_size,
gnutls_pk_algorithm_t * pk_algos, int pk_algos_length)
enum MHD_GNUTLS_PublicKeyAlgorithm * pk_algos, int pk_algos_length)
{
int result;
int indx = -1;
@@ -793,7 +793,7 @@ typedef enum CertificateSigType
} CertificateSigType;
/* Checks if we support the given signature algorithm
* (RSA or DSA). Returns the corresponding gnutls_pk_algorithm_t
* (RSA or DSA). Returns the corresponding enum MHD_GNUTLS_PublicKeyAlgorithm
* if true;
*/
inline static int
@@ -818,9 +818,9 @@ mhd_gtls_proc_cert_cert_req (mhd_gtls_session_t session, opaque * data,
cert_auth_info_t info;
ssize_t dsize;
int i, j;
gnutls_pk_algorithm_t pk_algos[MAX_SIGN_ALGOS];
enum MHD_GNUTLS_PublicKeyAlgorithm pk_algos[MAX_SIGN_ALGOS];
int pk_algos_length;
gnutls_protocol_t ver = MHD_gnutls_protocol_get_version (session);
enum MHD_GNUTLS_Protocol ver = MHD_gnutls_protocol_get_version (session);
cred = (mhd_gtls_cert_credentials_t)
mhd_gtls_get_cred (session->key, MHD_GNUTLS_CRD_CERTIFICATE, NULL);
@@ -1014,7 +1014,7 @@ mhd_gtls_gen_cert_server_cert_req (mhd_gtls_session_t session, opaque ** data)
mhd_gtls_cert_credentials_t cred;
int size;
opaque *pdata;
gnutls_protocol_t ver = MHD_gnutls_protocol_get_version (session);
enum MHD_GNUTLS_Protocol ver = MHD_gnutls_protocol_get_version (session);
/* Now we need to generate the RDN sequence. This is
* already in the CERTIFICATE_CRED structure, to improve
@@ -1029,7 +1029,7 @@ mhd_gtls_gen_cert_server_cert_req (mhd_gtls_session_t session, opaque ** data)
return GNUTLS_E_INSUFFICIENT_CREDENTIALS;
}
size = CERTTYPE_SIZE + 2; /* 2 for gnutls_certificate_type_t + 2 for size of rdn_seq
size = CERTTYPE_SIZE + 2; /* 2 for enum MHD_GNUTLS_CertificateType + 2 for size of rdn_seq
*/
if (session->security_parameters.cert_type == MHD_GNUTLS_CRT_X509 &&
@@ -1248,7 +1248,7 @@ mhd_gtls_selected_certs_set (mhd_gtls_session_t session,
*/
int
mhd_gtls_server_select_cert (mhd_gtls_session_t session,
gnutls_pk_algorithm_t requested_algo)
enum MHD_GNUTLS_PublicKeyAlgorithm requested_algo)
{
unsigned i;
int idx, ret;
+1 -1
View File
@@ -141,7 +141,7 @@ int mhd_gtls_get_selected_cert (mhd_gtls_session_t session,
gnutls_privkey ** apr_pkey);
int mhd_gtls_server_select_cert (struct MHD_gtls_session_int *,
gnutls_pk_algorithm_t);
enum MHD_GNUTLS_PublicKeyAlgorithm);
void mhd_gtls_selected_certs_deinit (mhd_gtls_session_t session);
void mhd_gtls_selected_certs_set (mhd_gtls_session_t session,
gnutls_cert * certs, int ncerts,
+1 -1
View File
@@ -325,7 +325,7 @@ _gnutls_gen_rsa_client_kx (mhd_gtls_session_t session, opaque ** data)
mpi_t params[MAX_PUBLIC_PARAMS_SIZE];
int params_len = MAX_PUBLIC_PARAMS_SIZE;
int ret, i;
gnutls_protocol_t ver;
enum MHD_GNUTLS_Protocol ver;
if (auth == NULL)
{
+115 -115
View File
@@ -35,9 +35,9 @@
*/
typedef struct
{
gnutls_kx_algorithm_t algorithm;
gnutls_credentials_type_t client_type;
gnutls_credentials_type_t server_type; /* The type of credentials a server
enum MHD_GNUTLS_KeyExchangeAlgorithm algorithm;
enum MHD_GNUTLS_CredentialsType client_type;
enum MHD_GNUTLS_CredentialsType server_type; /* The type of credentials a server
* needs to set */
} gnutls_cred_map;
@@ -84,8 +84,8 @@ static const gnutls_cred_map mhd_gtls_cred_mappings[] = {
/* KX mappings to PK algorithms */
typedef struct
{
gnutls_kx_algorithm_t kx_algorithm;
gnutls_pk_algorithm_t pk_algorithm;
enum MHD_GNUTLS_KeyExchangeAlgorithm kx_algorithm;
enum MHD_GNUTLS_PublicKeyAlgorithm pk_algorithm;
enum encipher_type encipher_type; /* CIPHER_ENCRYPT if this algorithm is to be used
* for encryption, CIPHER_SIGN if signature only,
* CIPHER_IGN if this does not apply at all.
@@ -130,7 +130,7 @@ static const gnutls_pk_map mhd_gtls_pk_mappings[] = {
typedef struct
{
const char *name;
gnutls_protocol_t id; /* gnutls internal version number */
enum MHD_GNUTLS_Protocol id; /* gnutls internal version number */
int major; /* defined by the protocol */
int minor; /* defined by the protocol */
int supported; /* 0 not supported, > 0 is supported */
@@ -165,7 +165,7 @@ static const gnutls_version_entry mhd_gtls_sup_versions[] = {
};
/* Keep the contents of this struct the same as the previous one. */
static const gnutls_protocol_t mhd_gtls_supported_protocols[] = { MHD_GNUTLS_SSL3,
static const enum MHD_GNUTLS_Protocol mhd_gtls_supported_protocols[] = { MHD_GNUTLS_SSL3,
MHD_GNUTLS_TLS1_0,
MHD_GNUTLS_TLS1_1,
MHD_GNUTLS_TLS1_2,
@@ -182,7 +182,7 @@ static const gnutls_protocol_t mhd_gtls_supported_protocols[] = { MHD_GNUTLS_SSL
struct gnutls_cipher_entry
{
const char *name;
gnutls_cipher_algorithm_t id;
enum MHD_GNUTLS_CipherAlgorithm id;
uint16_t blocksize;
uint16_t keysize;
cipher_type_t block;
@@ -271,7 +271,7 @@ static const gnutls_cipher_entry mhd_gtls_algorithms[] = {
};
/* Keep the contents of this struct the same as the previous one. */
static const gnutls_cipher_algorithm_t mhd_gtls_supported_ciphers[] =
static const enum MHD_GNUTLS_CipherAlgorithm mhd_gtls_supported_ciphers[] =
{ MHD_GNUTLS_CIPHER_AES_256_CBC,
MHD_GNUTLS_CIPHER_AES_128_CBC,
MHD_GNUTLS_CIPHER_3DES_CBC,
@@ -298,7 +298,7 @@ struct gnutls_hash_entry
{
const char *name;
const char *oid;
gnutls_mac_algorithm_t id;
enum MHD_GNUTLS_HashAlgorithm id;
size_t key_size; /* in case of mac */
};
typedef struct gnutls_hash_entry gnutls_hash_entry;
@@ -327,7 +327,7 @@ static const gnutls_hash_entry mhd_gtls_hash_algorithms[] = {
};
/* Keep the contents of this struct the same as the previous one. */
static const gnutls_mac_algorithm_t mhd_gtls_supported_macs[] = { MHD_GNUTLS_MAC_SHA1,
static const enum MHD_GNUTLS_HashAlgorithm mhd_gtls_supported_macs[] = { MHD_GNUTLS_MAC_SHA1,
MHD_GNUTLS_MAC_MD5,
MHD_GNUTLS_MAC_SHA256,
MHD_GNUTLS_MAC_NULL,
@@ -364,7 +364,7 @@ gnutls_compression_entry _gnutls_compression_algorithms[MAX_COMP_METHODS] =
0}
};
static const gnutls_compression_method_t mhd_gtls_supported_compressions[] = {
static const enum MHD_GNUTLS_CompressionMethod mhd_gtls_supported_compressions[] = {
#ifdef HAVE_LIBZ
MHD_GNUTLS_COMP_DEFLATE,
#endif
@@ -395,7 +395,7 @@ extern mhd_gtls_mod_auth_st srp_dss_auth_struct;
typedef struct mhd_gtls_kx_algo_entry
{
const char *name;
gnutls_kx_algorithm_t algorithm;
enum MHD_GNUTLS_KeyExchangeAlgorithm algorithm;
mhd_gtls_mod_auth_st *auth_struct;
int needs_dh_params;
int needs_rsa_params;
@@ -444,7 +444,7 @@ static const mhd_gtls_kx_algo_entry_t mhd_gtls_kx_algorithms[] = {
};
/* Keep the contents of this struct the same as the previous one. */
static const gnutls_kx_algorithm_t mhd_gtls_supported_kxs[] = {
static const enum MHD_GNUTLS_KeyExchangeAlgorithm mhd_gtls_supported_kxs[] = {
#ifdef ENABLE_ANON
MHD_GNUTLS_KX_ANON_DH,
#endif
@@ -479,10 +479,10 @@ typedef struct
{
const char *name;
cipher_suite_st id;
gnutls_cipher_algorithm_t block_algorithm;
gnutls_kx_algorithm_t kx_algorithm;
gnutls_mac_algorithm_t mac_algorithm;
gnutls_protocol_t version; /* this cipher suite is supported
enum MHD_GNUTLS_CipherAlgorithm block_algorithm;
enum MHD_GNUTLS_KeyExchangeAlgorithm kx_algorithm;
enum MHD_GNUTLS_HashAlgorithm mac_algorithm;
enum MHD_GNUTLS_Protocol version; /* this cipher suite is supported
* from 'version' and above;
*/
} mhd_gtls_cipher_suite_entry;
@@ -763,7 +763,7 @@ static const mhd_gtls_cipher_suite_entry mhd_gtls_cs_algorithms[] = {
int
mhd_gtls_mac_priority (mhd_gtls_session_t session,
gnutls_mac_algorithm_t algorithm)
enum MHD_GNUTLS_HashAlgorithm algorithm)
{ /* actually returns the priority */
unsigned int i;
for (i = 0; i < session->internals.priorities.mac.num_algorithms; i++)
@@ -782,7 +782,7 @@ mhd_gtls_mac_priority (mhd_gtls_session_t session,
* algorithm, or %NULL.
**/
const char *
MHD_gnutls_mac_get_name (gnutls_mac_algorithm_t algorithm)
MHD_gnutls_mac_get_name (enum MHD_GNUTLS_HashAlgorithm algorithm)
{
const char *ret = NULL;
@@ -796,14 +796,14 @@ MHD_gnutls_mac_get_name (gnutls_mac_algorithm_t algorithm)
* MHD_gtls_mac_get_id - Returns the gnutls id of the specified in string algorithm
* @algorithm: is a MAC algorithm name
*
* Returns: an %gnutls_mac_algorithm_tid of the specified in a string
* Returns: an %enum MHD_GNUTLS_HashAlgorithmid of the specified in a string
* MAC algorithm, or %GNUTLS_MAC_UNKNOWN on failures. The names are
* compared in a case insensitive way.
**/
gnutls_mac_algorithm_t
enum MHD_GNUTLS_HashAlgorithm
MHD_gtls_mac_get_id (const char *name)
{
gnutls_mac_algorithm_t ret = MHD_GNUTLS_MAC_UNKNOWN;
enum MHD_GNUTLS_HashAlgorithm ret = MHD_GNUTLS_MAC_UNKNOWN;
GNUTLS_HASH_LOOP (if (strcasecmp (p->name, name) == 0) ret = p->id)
;
@@ -820,7 +820,7 @@ MHD_gtls_mac_get_id (const char *name)
*
**/
size_t
MHD_gnutls_mac_get_key_size (gnutls_mac_algorithm_t algorithm)
MHD_gnutls_mac_get_key_size (enum MHD_GNUTLS_HashAlgorithm algorithm)
{
size_t ret = 0;
@@ -838,17 +838,17 @@ MHD_gnutls_mac_get_key_size (gnutls_mac_algorithm_t algorithm)
* example, MD2 is not supported as a cipher suite, but is supported
* for other purposes (e.g., X.509 signature verification or similar).
*
* Returns: Return a zero-terminated list of %gnutls_mac_algorithm_t
* Returns: Return a zero-terminated list of %enum MHD_GNUTLS_HashAlgorithm
* integers indicating the available MACs.
**/
const gnutls_mac_algorithm_t *
const enum MHD_GNUTLS_HashAlgorithm *
MHD_gtls_mac_list (void)
{
return mhd_gtls_supported_macs;
}
const char *
mhd_gtls_x509_mac_to_oid (gnutls_mac_algorithm_t algorithm)
mhd_gtls_x509_mac_to_oid (enum MHD_GNUTLS_HashAlgorithm algorithm)
{
const char *ret = NULL;
@@ -858,10 +858,10 @@ mhd_gtls_x509_mac_to_oid (gnutls_mac_algorithm_t algorithm)
return ret;
}
gnutls_mac_algorithm_t
enum MHD_GNUTLS_HashAlgorithm
mhd_gtls_x509_oid2mac_algorithm (const char *oid)
{
gnutls_mac_algorithm_t ret = 0;
enum MHD_GNUTLS_HashAlgorithm ret = 0;
GNUTLS_HASH_LOOP (if (p->oid && strcmp (oid, p->oid) == 0)
{
@@ -875,7 +875,7 @@ mhd_gtls_x509_oid2mac_algorithm (const char *oid)
}
int
mhd_gnutls_mac_is_ok (gnutls_mac_algorithm_t algorithm)
mhd_gnutls_mac_is_ok (enum MHD_GNUTLS_HashAlgorithm algorithm)
{
ssize_t ret = -1;
GNUTLS_HASH_ALG_LOOP (ret = p->id);
@@ -889,7 +889,7 @@ mhd_gnutls_mac_is_ok (gnutls_mac_algorithm_t algorithm)
/* Compression Functions */
int
mhd_gtls_compression_priority (mhd_gtls_session_t session,
gnutls_compression_method_t algorithm)
enum MHD_GNUTLS_CompressionMethod algorithm)
{ /* actually returns the priority */
unsigned int i;
for (i = 0; i < session->internals.priorities.compression.num_algorithms; i++)
@@ -908,7 +908,7 @@ mhd_gtls_compression_priority (mhd_gtls_session_t session,
* specified compression algorithm, or %NULL.
**/
const char *
MHD_gnutls_compression_get_name (gnutls_compression_method_t algorithm)
MHD_gnutls_compression_get_name (enum MHD_GNUTLS_CompressionMethod algorithm)
{
const char *ret = NULL;
@@ -928,10 +928,10 @@ MHD_gnutls_compression_get_name (gnutls_compression_method_t algorithm)
* %GNUTLS_COMP_UNKNOWN on error.
*
**/
gnutls_compression_method_t
enum MHD_GNUTLS_CompressionMethod
MHD_gtls_compression_get_id (const char *name)
{
gnutls_compression_method_t ret = MHD_GNUTLS_COMP_UNKNOWN;
enum MHD_GNUTLS_CompressionMethod ret = MHD_GNUTLS_COMP_UNKNOWN;
GNUTLS_COMPRESSION_LOOP (if
(strcasecmp
@@ -949,10 +949,10 @@ MHD_gtls_compression_get_id (const char *name)
* compression, you must link to libgnutls-extra and call
* gnutls_global_init_extra().
*
* Returns: a zero-terminated list of %gnutls_compression_method_t
* Returns: a zero-terminated list of %enum MHD_GNUTLS_CompressionMethod
* integers indicating the available compression methods.
**/
const gnutls_compression_method_t *
const enum MHD_GNUTLS_CompressionMethod *
MHD_gtls_compression_list (void)
{
return mhd_gtls_supported_compressions;
@@ -960,7 +960,7 @@ MHD_gtls_compression_list (void)
/* return the tls number of the specified algorithm */
int
mhd_gtls_compression_get_num (gnutls_compression_method_t algorithm)
mhd_gtls_compression_get_num (enum MHD_GNUTLS_CompressionMethod algorithm)
{
int ret = -1;
@@ -971,7 +971,7 @@ mhd_gtls_compression_get_num (gnutls_compression_method_t algorithm)
}
int
mhd_gtls_compression_get_wbits (gnutls_compression_method_t algorithm)
mhd_gtls_compression_get_wbits (enum MHD_GNUTLS_CompressionMethod algorithm)
{
int ret = -1;
/* avoid prefix */
@@ -980,7 +980,7 @@ mhd_gtls_compression_get_wbits (gnutls_compression_method_t algorithm)
}
int
mhd_gtls_compression_get_mem_level (gnutls_compression_method_t algorithm)
mhd_gtls_compression_get_mem_level (enum MHD_GNUTLS_CompressionMethod algorithm)
{
int ret = -1;
/* avoid prefix */
@@ -989,7 +989,7 @@ mhd_gtls_compression_get_mem_level (gnutls_compression_method_t algorithm)
}
int
mhd_gtls_compression_get_comp_level (gnutls_compression_method_t algorithm)
mhd_gtls_compression_get_comp_level (enum MHD_GNUTLS_CompressionMethod algorithm)
{
int ret = -1;
/* avoid prefix */
@@ -1000,10 +1000,10 @@ mhd_gtls_compression_get_comp_level (gnutls_compression_method_t algorithm)
/* returns the gnutls internal ID of the TLS compression
* method num
*/
gnutls_compression_method_t
enum MHD_GNUTLS_CompressionMethod
mhd_gtls_compression_get_id (int num)
{
gnutls_compression_method_t ret = -1;
enum MHD_GNUTLS_CompressionMethod ret = -1;
/* avoid prefix */
GNUTLS_COMPRESSION_ALG_LOOP_NUM (ret = p->id);
@@ -1012,7 +1012,7 @@ mhd_gtls_compression_get_id (int num)
}
int
mhd_gtls_compression_is_ok (gnutls_compression_method_t algorithm)
mhd_gtls_compression_is_ok (enum MHD_GNUTLS_CompressionMethod algorithm)
{
ssize_t ret = -1;
GNUTLS_COMPRESSION_ALG_LOOP (ret = p->id);
@@ -1025,7 +1025,7 @@ mhd_gtls_compression_is_ok (gnutls_compression_method_t algorithm)
/* CIPHER functions */
int
mhd_gtls_cipher_get_block_size (gnutls_cipher_algorithm_t algorithm)
mhd_gtls_cipher_get_block_size (enum MHD_GNUTLS_CipherAlgorithm algorithm)
{
size_t ret = 0;
GNUTLS_ALG_LOOP (ret = p->blocksize);
@@ -1036,7 +1036,7 @@ mhd_gtls_cipher_get_block_size (gnutls_cipher_algorithm_t algorithm)
/* returns the priority */
int
mhd_gtls_cipher_priority (mhd_gtls_session_t session,
gnutls_cipher_algorithm_t algorithm)
enum MHD_GNUTLS_CipherAlgorithm algorithm)
{
unsigned int i;
for (i = 0; i < session->internals.priorities.cipher.num_algorithms; i++)
@@ -1048,7 +1048,7 @@ mhd_gtls_cipher_priority (mhd_gtls_session_t session,
}
int
mhd_gtls_cipher_is_block (gnutls_cipher_algorithm_t algorithm)
mhd_gtls_cipher_is_block (enum MHD_GNUTLS_CipherAlgorithm algorithm)
{
size_t ret = 0;
@@ -1065,7 +1065,7 @@ mhd_gtls_cipher_is_block (gnutls_cipher_algorithm_t algorithm)
* the given cipher is invalid.
**/
size_t
MHD_gnutls_cipher_get_key_size (gnutls_cipher_algorithm_t algorithm)
MHD_gnutls_cipher_get_key_size (enum MHD_GNUTLS_CipherAlgorithm algorithm)
{ /* In bytes */
size_t ret = 0;
GNUTLS_ALG_LOOP (ret = p->keysize);
@@ -1074,7 +1074,7 @@ MHD_gnutls_cipher_get_key_size (gnutls_cipher_algorithm_t algorithm)
}
int
mhd_gtls_cipher_get_iv_size (gnutls_cipher_algorithm_t algorithm)
mhd_gtls_cipher_get_iv_size (enum MHD_GNUTLS_CipherAlgorithm algorithm)
{ /* In bytes */
size_t ret = 0;
GNUTLS_ALG_LOOP (ret = p->iv);
@@ -1083,7 +1083,7 @@ mhd_gtls_cipher_get_iv_size (gnutls_cipher_algorithm_t algorithm)
}
int
mhd_gtls_cipher_get_export_flag (gnutls_cipher_algorithm_t algorithm)
mhd_gtls_cipher_get_export_flag (enum MHD_GNUTLS_CipherAlgorithm algorithm)
{ /* In bytes */
size_t ret = 0;
GNUTLS_ALG_LOOP (ret = p->export_flag);
@@ -1099,7 +1099,7 @@ mhd_gtls_cipher_get_export_flag (gnutls_cipher_algorithm_t algorithm)
* specified cipher, or %NULL.
**/
const char *
MHD_gnutls_cipher_get_name (gnutls_cipher_algorithm_t algorithm)
MHD_gnutls_cipher_get_name (enum MHD_GNUTLS_CipherAlgorithm algorithm)
{
const char *ret = NULL;
@@ -1119,10 +1119,10 @@ MHD_gnutls_cipher_get_name (gnutls_cipher_algorithm_t algorithm)
* on error.
*
**/
gnutls_cipher_algorithm_t
enum MHD_GNUTLS_CipherAlgorithm
MHD_gtls_cipher_get_id (const char *name)
{
gnutls_cipher_algorithm_t ret = MHD_GNUTLS_CIPHER_UNKNOWN;
enum MHD_GNUTLS_CipherAlgorithm ret = MHD_GNUTLS_CIPHER_UNKNOWN;
GNUTLS_LOOP (if (strcasecmp (p->name, name) == 0) ret = p->id)
;
@@ -1138,18 +1138,18 @@ MHD_gtls_cipher_get_id (const char *name)
* example, DES is not supported as a cipher suite, but is supported
* for other purposes (e.g., PKCS#8 or similar).
*
* Returns: a zero-terminated list of %gnutls_cipher_algorithm_t
* Returns: a zero-terminated list of %enum MHD_GNUTLS_CipherAlgorithm
* integers indicating the available ciphers.
*
**/
const gnutls_cipher_algorithm_t *
const enum MHD_GNUTLS_CipherAlgorithm *
MHD_gtls_cipher_list (void)
{
return mhd_gtls_supported_ciphers;
}
int
mhd_gtls_cipher_is_ok (gnutls_cipher_algorithm_t algorithm)
mhd_gtls_cipher_is_ok (enum MHD_GNUTLS_CipherAlgorithm algorithm)
{
ssize_t ret = -1;
GNUTLS_ALG_LOOP (ret = p->id);
@@ -1162,7 +1162,7 @@ mhd_gtls_cipher_is_ok (gnutls_cipher_algorithm_t algorithm)
/* Key EXCHANGE functions */
mhd_gtls_mod_auth_st *
mhd_gtls_kx_auth_struct (gnutls_kx_algorithm_t algorithm)
mhd_gtls_kx_auth_struct (enum MHD_GNUTLS_KeyExchangeAlgorithm algorithm)
{
mhd_gtls_mod_auth_st *ret = NULL;
GNUTLS_KX_ALG_LOOP (ret = p->auth_struct);
@@ -1172,7 +1172,7 @@ mhd_gtls_kx_auth_struct (gnutls_kx_algorithm_t algorithm)
int
mhd_gtls_kx_priority (mhd_gtls_session_t session,
gnutls_kx_algorithm_t algorithm)
enum MHD_GNUTLS_KeyExchangeAlgorithm algorithm)
{
unsigned int i;
for (i = 0; i < session->internals.priorities.kx.num_algorithms; i++)
@@ -1191,7 +1191,7 @@ mhd_gtls_kx_priority (mhd_gtls_session_t session,
* specified key exchange algorithm, or %NULL.
**/
const char *
MHD_gnutls_kx_get_name (gnutls_kx_algorithm_t algorithm)
MHD_gnutls_kx_get_name (enum MHD_GNUTLS_KeyExchangeAlgorithm algorithm)
{
const char *ret = NULL;
@@ -1210,10 +1210,10 @@ MHD_gnutls_kx_get_name (gnutls_kx_algorithm_t algorithm)
* Returns: an id of the specified KX algorithm, or
* %GNUTLS_KX_UNKNOWN on error.
**/
gnutls_kx_algorithm_t
enum MHD_GNUTLS_KeyExchangeAlgorithm
MHD_gtls_kx_get_id (const char *name)
{
gnutls_cipher_algorithm_t ret = MHD_GNUTLS_KX_UNKNOWN;
enum MHD_GNUTLS_CipherAlgorithm ret = MHD_GNUTLS_KX_UNKNOWN;
GNUTLS_KX_LOOP (if (strcasecmp (p->name, name) == 0) ret = p->algorithm)
;
@@ -1226,17 +1226,17 @@ MHD_gtls_kx_get_id (const char *name)
*
* Get a list of supported key exchange algorithms.
*
* Returns: a zero-terminated list of %gnutls_kx_algorithm_t integers
* Returns: a zero-terminated list of %enum MHD_GNUTLS_KeyExchangeAlgorithm integers
* indicating the available key exchange algorithms.
**/
const gnutls_kx_algorithm_t *
const enum MHD_GNUTLS_KeyExchangeAlgorithm *
MHD_gtls_kx_list (void)
{
return mhd_gtls_supported_kxs;
}
int
mhd_gtls_kx_is_ok (gnutls_kx_algorithm_t algorithm)
mhd_gtls_kx_is_ok (enum MHD_GNUTLS_KeyExchangeAlgorithm algorithm)
{
ssize_t ret = -1;
GNUTLS_KX_ALG_LOOP (ret = p->algorithm);
@@ -1248,7 +1248,7 @@ mhd_gtls_kx_is_ok (gnutls_kx_algorithm_t algorithm)
}
int
mhd_gtls_kx_needs_rsa_params (gnutls_kx_algorithm_t algorithm)
mhd_gtls_kx_needs_rsa_params (enum MHD_GNUTLS_KeyExchangeAlgorithm algorithm)
{
ssize_t ret = 0;
GNUTLS_KX_ALG_LOOP (ret = p->needs_rsa_params);
@@ -1256,7 +1256,7 @@ mhd_gtls_kx_needs_rsa_params (gnutls_kx_algorithm_t algorithm)
}
int
mhd_gtls_kx_needs_dh_params (gnutls_kx_algorithm_t algorithm)
mhd_gtls_kx_needs_dh_params (enum MHD_GNUTLS_KeyExchangeAlgorithm algorithm)
{
ssize_t ret = 0;
GNUTLS_KX_ALG_LOOP (ret = p->needs_dh_params);
@@ -1265,7 +1265,7 @@ mhd_gtls_kx_needs_dh_params (gnutls_kx_algorithm_t algorithm)
/* Version */
int
mhd_gtls_version_priority (mhd_gtls_session_t session, gnutls_protocol_t version)
mhd_gtls_version_priority (mhd_gtls_session_t session, enum MHD_GNUTLS_Protocol version)
{ /* actually returns the priority */
unsigned int i;
@@ -1283,7 +1283,7 @@ mhd_gtls_version_priority (mhd_gtls_session_t session, gnutls_protocol_t version
return -1;
}
gnutls_protocol_t
enum MHD_GNUTLS_Protocol
mhd_gtls_version_lowest (mhd_gtls_session_t session)
{ /* returns the lowest version supported */
unsigned int i, min = 0xff;
@@ -1305,7 +1305,7 @@ mhd_gtls_version_lowest (mhd_gtls_session_t session)
return min;
}
gnutls_protocol_t
enum MHD_GNUTLS_Protocol
mhd_gtls_version_max (mhd_gtls_session_t session)
{ /* returns the maximum version supported */
unsigned int i, max = 0x00;
@@ -1335,7 +1335,7 @@ mhd_gtls_version_max (mhd_gtls_session_t session)
* version (e.g., "TLS 1.0"), or %NULL.
**/
const char *
MHD_gnutls_protocol_get_name (gnutls_protocol_t version)
MHD_gnutls_protocol_get_name (enum MHD_GNUTLS_Protocol version)
{
const char *ret = NULL;
@@ -1353,10 +1353,10 @@ MHD_gnutls_protocol_get_name (gnutls_protocol_t version)
* Returns: an id of the specified protocol, or
* %GNUTLS_VERSION_UNKNOWN on error.
**/
gnutls_protocol_t
enum MHD_GNUTLS_Protocol
MHD_gtls_protocol_get_id (const char *name)
{
gnutls_protocol_t ret = MHD_GNUTLS_VERSION_UNKNOWN;
enum MHD_GNUTLS_Protocol ret = MHD_GNUTLS_VERSION_UNKNOWN;
GNUTLS_VERSION_LOOP (if (strcasecmp (p->name, name) == 0) ret = p->id)
;
@@ -1369,18 +1369,18 @@ MHD_gtls_protocol_get_id (const char *name)
*
* Get a list of supported protocols, e.g. SSL 3.0, TLS 1.0 etc.
*
* Returns: a zero-terminated list of %gnutls_protocol_t integers
* Returns: a zero-terminated list of %enum MHD_GNUTLS_Protocol integers
* indicating the available protocols.
*
**/
const gnutls_protocol_t *
const enum MHD_GNUTLS_Protocol *
MHD_gtls_protocol_list (void)
{
return mhd_gtls_supported_protocols;
}
int
mhd_gtls_version_get_minor (gnutls_protocol_t version)
mhd_gtls_version_get_minor (enum MHD_GNUTLS_Protocol version)
{
int ret = -1;
@@ -1388,7 +1388,7 @@ mhd_gtls_version_get_minor (gnutls_protocol_t version)
return ret;
}
gnutls_protocol_t
enum MHD_GNUTLS_Protocol
mhd_gtls_version_get (int major, int minor)
{
int ret = -1;
@@ -1400,7 +1400,7 @@ mhd_gtls_version_get (int major, int minor)
}
int
mhd_gtls_version_get_major (gnutls_protocol_t version)
mhd_gtls_version_get_major (enum MHD_GNUTLS_Protocol version)
{
int ret = -1;
@@ -1412,7 +1412,7 @@ mhd_gtls_version_get_major (gnutls_protocol_t version)
int
mhd_gtls_version_is_supported (mhd_gtls_session_t session,
const gnutls_protocol_t version)
const enum MHD_GNUTLS_Protocol version)
{
int ret = 0;
@@ -1427,10 +1427,10 @@ mhd_gtls_version_is_supported (mhd_gtls_session_t session,
}
/* Type to KX mappings */
gnutls_kx_algorithm_t
mhd_gtls_map_kx_get_kx (gnutls_credentials_type_t type, int server)
enum MHD_GNUTLS_KeyExchangeAlgorithm
mhd_gtls_map_kx_get_kx (enum MHD_GNUTLS_CredentialsType type, int server)
{
gnutls_kx_algorithm_t ret = -1;
enum MHD_GNUTLS_KeyExchangeAlgorithm ret = -1;
if (server)
{
@@ -1443,10 +1443,10 @@ mhd_gtls_map_kx_get_kx (gnutls_credentials_type_t type, int server)
return ret;
}
gnutls_credentials_type_t
mhd_gtls_map_kx_get_cred (gnutls_kx_algorithm_t algorithm, int server)
enum MHD_GNUTLS_CredentialsType
mhd_gtls_map_kx_get_cred (enum MHD_GNUTLS_KeyExchangeAlgorithm algorithm, int server)
{
gnutls_credentials_type_t ret = -1;
enum MHD_GNUTLS_CredentialsType ret = -1;
if (server)
{
GNUTLS_KX_MAP_LOOP (if (p->algorithm == algorithm) ret = p->server_type)
@@ -1462,7 +1462,7 @@ mhd_gtls_map_kx_get_cred (gnutls_kx_algorithm_t algorithm, int server)
}
/* Cipher Suite's functions */
gnutls_cipher_algorithm_t
enum MHD_GNUTLS_CipherAlgorithm
mhd_gtls_cipher_suite_get_cipher_algo (const cipher_suite_st * suite)
{
int ret = 0;
@@ -1470,7 +1470,7 @@ mhd_gtls_cipher_suite_get_cipher_algo (const cipher_suite_st * suite)
return ret;
}
gnutls_protocol_t
enum MHD_GNUTLS_Protocol
mhd_gtls_cipher_suite_get_version (const cipher_suite_st * suite)
{
int ret = 0;
@@ -1478,7 +1478,7 @@ mhd_gtls_cipher_suite_get_version (const cipher_suite_st * suite)
return ret;
}
gnutls_kx_algorithm_t
enum MHD_GNUTLS_KeyExchangeAlgorithm
mhd_gtls_cipher_suite_get_kx_algo (const cipher_suite_st * suite)
{
int ret = 0;
@@ -1488,7 +1488,7 @@ mhd_gtls_cipher_suite_get_kx_algo (const cipher_suite_st * suite)
}
gnutls_mac_algorithm_t
enum MHD_GNUTLS_HashAlgorithm
mhd_gtls_cipher_suite_get_mac_algo (const cipher_suite_st * suite)
{ /* In bytes */
int ret = 0;
@@ -1613,17 +1613,17 @@ static int
_gnutls_compare_algo (mhd_gtls_session_t session,
const void *i_A1, const void *i_A2)
{
gnutls_kx_algorithm_t kA1 =
enum MHD_GNUTLS_KeyExchangeAlgorithm kA1 =
mhd_gtls_cipher_suite_get_kx_algo ((const cipher_suite_st *) i_A1);
gnutls_kx_algorithm_t kA2 =
enum MHD_GNUTLS_KeyExchangeAlgorithm kA2 =
mhd_gtls_cipher_suite_get_kx_algo ((const cipher_suite_st *) i_A2);
gnutls_cipher_algorithm_t cA1 =
enum MHD_GNUTLS_CipherAlgorithm cA1 =
mhd_gtls_cipher_suite_get_cipher_algo ((const cipher_suite_st *) i_A1);
gnutls_cipher_algorithm_t cA2 =
enum MHD_GNUTLS_CipherAlgorithm cA2 =
mhd_gtls_cipher_suite_get_cipher_algo ((const cipher_suite_st *) i_A2);
gnutls_mac_algorithm_t mA1 =
enum MHD_GNUTLS_HashAlgorithm mA1 =
mhd_gtls_cipher_suite_get_mac_algo ((const cipher_suite_st *) i_A1);
gnutls_mac_algorithm_t mA2 =
enum MHD_GNUTLS_HashAlgorithm mA2 =
mhd_gtls_cipher_suite_get_mac_algo ((const cipher_suite_st *) i_A2);
int p1 = (mhd_gtls_kx_priority (session, kA1) + 1) * 64;
@@ -1717,7 +1717,7 @@ mhd_gtls_supported_ciphersuites (mhd_gtls_session_t session,
unsigned int count = CIPHER_SUITES_COUNT;
cipher_suite_st *tmp_ciphers;
cipher_suite_st *ciphers;
gnutls_protocol_t version;
enum MHD_GNUTLS_Protocol version;
if (count == 0)
{
@@ -1860,7 +1860,7 @@ mhd_gtls_supported_compression_methods (mhd_gtls_session_t session,
* specified certificate type.
**/
const char *
MHD_gnutls_certificate_type_get_name (gnutls_certificate_type_t type)
MHD_gnutls_certificate_type_get_name (enum MHD_GNUTLS_CertificateType type)
{
const char *ret = NULL;
@@ -1878,17 +1878,17 @@ MHD_gnutls_certificate_type_get_name (gnutls_certificate_type_t type)
* Returns: an id of the specified in a string certificate type, or
* %GNUTLS_CRT_UNKNOWN on error.
**/
gnutls_certificate_type_t
enum MHD_GNUTLS_CertificateType
MHD_gtls_certificate_type_get_id (const char *name)
{
gnutls_certificate_type_t ret = MHD_GNUTLS_CRT_UNKNOWN;
enum MHD_GNUTLS_CertificateType ret = MHD_GNUTLS_CRT_UNKNOWN;
if (strcasecmp (name, "X.509") == 0 || strcasecmp (name, "X509") == 0)
return MHD_GNUTLS_CRT_X509;
return ret;
}
static const gnutls_certificate_type_t mhd_gtls_supported_certificate_types[] =
static const enum MHD_GNUTLS_CertificateType mhd_gtls_supported_certificate_types[] =
{ MHD_GNUTLS_CRT_X509,
0
};
@@ -1898,23 +1898,23 @@ static const gnutls_certificate_type_t mhd_gtls_supported_certificate_types[] =
*
* Get a list of certificate types.
*
* Returns: a zero-terminated list of %gnutls_certificate_type_t
* Returns: a zero-terminated list of %enum MHD_GNUTLS_CertificateType
* integers indicating the available certificate types.
*
**/
const gnutls_certificate_type_t *
const enum MHD_GNUTLS_CertificateType *
MHD_gtls_certificate_type_list (void)
{
return mhd_gtls_supported_certificate_types;
}
/* returns the gnutls_pk_algorithm_t which is compatible with
* the given gnutls_kx_algorithm_t.
/* returns the enum MHD_GNUTLS_PublicKeyAlgorithm which is compatible with
* the given enum MHD_GNUTLS_KeyExchangeAlgorithm.
*/
gnutls_pk_algorithm_t
mhd_gtls_map_pk_get_pk (gnutls_kx_algorithm_t kx_algorithm)
enum MHD_GNUTLS_PublicKeyAlgorithm
mhd_gtls_map_pk_get_pk (enum MHD_GNUTLS_KeyExchangeAlgorithm kx_algorithm)
{
gnutls_pk_algorithm_t ret = -1;
enum MHD_GNUTLS_PublicKeyAlgorithm ret = -1;
GNUTLS_PK_MAP_ALG_LOOP (ret = p->pk_algorithm) return ret;
}
@@ -1925,7 +1925,7 @@ mhd_gtls_map_pk_get_pk (gnutls_kx_algorithm_t kx_algorithm)
* ex. GNUTLS_KX_RSA requires a certificate able to encrypt... so returns CIPHER_ENCRYPT.
*/
enum encipher_type
mhd_gtls_kx_encipher_type (gnutls_kx_algorithm_t kx_algorithm)
mhd_gtls_kx_encipher_type (enum MHD_GNUTLS_KeyExchangeAlgorithm kx_algorithm)
{
int ret = CIPHER_IGN;
GNUTLS_PK_MAP_ALG_LOOP (ret = p->encipher_type) return ret;
@@ -1939,8 +1939,8 @@ struct gnutls_sign_entry
const char *name;
const char *oid;
gnutls_sign_algorithm_t id;
gnutls_pk_algorithm_t pk;
gnutls_mac_algorithm_t mac;
enum MHD_GNUTLS_PublicKeyAlgorithm pk;
enum MHD_GNUTLS_HashAlgorithm mac;
};
typedef struct gnutls_sign_entry gnutls_sign_entry;
@@ -2005,7 +2005,7 @@ mhd_gtls_x509_oid2sign_algorithm (const char *oid)
}
gnutls_sign_algorithm_t
mhd_gtls_x509_pk_to_sign (gnutls_pk_algorithm_t pk, gnutls_mac_algorithm_t mac)
mhd_gtls_x509_pk_to_sign (enum MHD_GNUTLS_PublicKeyAlgorithm pk, enum MHD_GNUTLS_HashAlgorithm mac)
{
gnutls_sign_algorithm_t ret = 0;
@@ -2020,8 +2020,8 @@ mhd_gtls_x509_pk_to_sign (gnutls_pk_algorithm_t pk, gnutls_mac_algorithm_t mac)
}
const char *
mhd_gtls_x509_sign_to_oid (gnutls_pk_algorithm_t pk,
gnutls_mac_algorithm_t mac)
mhd_gtls_x509_sign_to_oid (enum MHD_GNUTLS_PublicKeyAlgorithm pk,
enum MHD_GNUTLS_HashAlgorithm mac)
{
gnutls_sign_algorithm_t sign;
const char *ret = NULL;
@@ -2040,7 +2040,7 @@ struct gnutls_pk_entry
{
const char *name;
const char *oid;
gnutls_pk_algorithm_t id;
enum MHD_GNUTLS_PublicKeyAlgorithm id;
};
typedef struct gnutls_pk_entry gnutls_pk_entry;
@@ -2059,10 +2059,10 @@ static const gnutls_pk_entry mhd_gtls_pk_algorithms[] = {
0}
};
gnutls_pk_algorithm_t
enum MHD_GNUTLS_PublicKeyAlgorithm
mhd_gtls_x509_oid2pk_algorithm (const char *oid)
{
gnutls_pk_algorithm_t ret = MHD_GNUTLS_PK_UNKNOWN;
enum MHD_GNUTLS_PublicKeyAlgorithm ret = MHD_GNUTLS_PK_UNKNOWN;
const gnutls_pk_entry *p;
for (p = mhd_gtls_pk_algorithms; p->name != NULL; p++)
@@ -2076,7 +2076,7 @@ mhd_gtls_x509_oid2pk_algorithm (const char *oid)
}
const char *
mhd_gtls_x509_pk_to_oid (gnutls_pk_algorithm_t algorithm)
mhd_gtls_x509_pk_to_oid (enum MHD_GNUTLS_PublicKeyAlgorithm algorithm)
{
const char *ret = NULL;
const gnutls_pk_entry *p;
+49 -49
View File
@@ -28,20 +28,20 @@
#include "gnutls_auth.h"
/* Functions for version handling. */
gnutls_protocol_t mhd_gtls_version_lowest (mhd_gtls_session_t session);
gnutls_protocol_t mhd_gtls_version_max (mhd_gtls_session_t session);
enum MHD_GNUTLS_Protocol mhd_gtls_version_lowest (mhd_gtls_session_t session);
enum MHD_GNUTLS_Protocol mhd_gtls_version_max (mhd_gtls_session_t session);
int mhd_gtls_version_priority (mhd_gtls_session_t session,
gnutls_protocol_t version);
enum MHD_GNUTLS_Protocol version);
int mhd_gtls_version_is_supported (mhd_gtls_session_t session,
const gnutls_protocol_t version);
int mhd_gtls_version_get_major (gnutls_protocol_t ver);
int mhd_gtls_version_get_minor (gnutls_protocol_t ver);
gnutls_protocol_t mhd_gtls_version_get (int major, int minor);
const enum MHD_GNUTLS_Protocol version);
int mhd_gtls_version_get_major (enum MHD_GNUTLS_Protocol ver);
int mhd_gtls_version_get_minor (enum MHD_GNUTLS_Protocol ver);
enum MHD_GNUTLS_Protocol mhd_gtls_version_get (int major, int minor);
/* Functions for MACs. */
int mhd_gnutls_mac_is_ok (gnutls_mac_algorithm_t algorithm);
gnutls_mac_algorithm_t mhd_gtls_x509_oid2mac_algorithm (const char *oid);
const char * mhd_gtls_x509_mac_to_oid (gnutls_mac_algorithm_t mac);
int mhd_gnutls_mac_is_ok (enum MHD_GNUTLS_HashAlgorithm algorithm);
enum MHD_GNUTLS_HashAlgorithm mhd_gtls_x509_oid2mac_algorithm (const char *oid);
const char * mhd_gtls_x509_mac_to_oid (enum MHD_GNUTLS_HashAlgorithm mac);
/* Functions for cipher suites. */
int mhd_gtls_supported_ciphersuites (mhd_gtls_session_t session,
@@ -51,62 +51,62 @@ int mhd_gtls_supported_ciphersuites_sorted (mhd_gtls_session_t session,
int mhd_gtls_supported_compression_methods (mhd_gtls_session_t session,
uint8_t ** comp);
const char * mhd_gtls_cipher_suite_get_name (cipher_suite_st * algorithm);
gnutls_cipher_algorithm_t mhd_gtls_cipher_suite_get_cipher_algo (const
enum MHD_GNUTLS_CipherAlgorithm mhd_gtls_cipher_suite_get_cipher_algo (const
cipher_suite_st
* algorithm);
gnutls_kx_algorithm_t mhd_gtls_cipher_suite_get_kx_algo (const cipher_suite_st
enum MHD_GNUTLS_KeyExchangeAlgorithm mhd_gtls_cipher_suite_get_kx_algo (const cipher_suite_st
* algorithm);
gnutls_mac_algorithm_t mhd_gtls_cipher_suite_get_mac_algo (const
enum MHD_GNUTLS_HashAlgorithm mhd_gtls_cipher_suite_get_mac_algo (const
cipher_suite_st *
algorithm);
gnutls_protocol_t mhd_gtls_cipher_suite_get_version (const cipher_suite_st *
enum MHD_GNUTLS_Protocol mhd_gtls_cipher_suite_get_version (const cipher_suite_st *
algorithm);
cipher_suite_st mhd_gtls_cipher_suite_get_suite_name (cipher_suite_st *
algorithm);
/* Functions for ciphers. */
int mhd_gtls_cipher_get_block_size (gnutls_cipher_algorithm_t algorithm);
int mhd_gtls_cipher_is_block (gnutls_cipher_algorithm_t algorithm);
int mhd_gtls_cipher_is_ok (gnutls_cipher_algorithm_t algorithm);
int mhd_gtls_cipher_get_iv_size (gnutls_cipher_algorithm_t algorithm);
int mhd_gtls_cipher_get_export_flag (gnutls_cipher_algorithm_t algorithm);
int mhd_gtls_cipher_get_block_size (enum MHD_GNUTLS_CipherAlgorithm algorithm);
int mhd_gtls_cipher_is_block (enum MHD_GNUTLS_CipherAlgorithm algorithm);
int mhd_gtls_cipher_is_ok (enum MHD_GNUTLS_CipherAlgorithm algorithm);
int mhd_gtls_cipher_get_iv_size (enum MHD_GNUTLS_CipherAlgorithm algorithm);
int mhd_gtls_cipher_get_export_flag (enum MHD_GNUTLS_CipherAlgorithm algorithm);
/* Functions for key exchange. */
int mhd_gtls_kx_needs_dh_params (gnutls_kx_algorithm_t algorithm);
int mhd_gtls_kx_needs_rsa_params (gnutls_kx_algorithm_t algorithm);
mhd_gtls_mod_auth_st * mhd_gtls_kx_auth_struct (gnutls_kx_algorithm_t algorithm);
int mhd_gtls_kx_is_ok (gnutls_kx_algorithm_t algorithm);
int mhd_gtls_kx_needs_dh_params (enum MHD_GNUTLS_KeyExchangeAlgorithm algorithm);
int mhd_gtls_kx_needs_rsa_params (enum MHD_GNUTLS_KeyExchangeAlgorithm algorithm);
mhd_gtls_mod_auth_st * mhd_gtls_kx_auth_struct (enum MHD_GNUTLS_KeyExchangeAlgorithm algorithm);
int mhd_gtls_kx_is_ok (enum MHD_GNUTLS_KeyExchangeAlgorithm algorithm);
/* Functions for compression. */
int mhd_gtls_compression_is_ok (gnutls_compression_method_t algorithm);
int mhd_gtls_compression_get_num (gnutls_compression_method_t algorithm);
gnutls_compression_method_t mhd_gtls_compression_get_id (int num);
int mhd_gtls_compression_get_mem_level (gnutls_compression_method_t algorithm);
int mhd_gtls_compression_get_comp_level (gnutls_compression_method_t
int mhd_gtls_compression_is_ok (enum MHD_GNUTLS_CompressionMethod algorithm);
int mhd_gtls_compression_get_num (enum MHD_GNUTLS_CompressionMethod algorithm);
enum MHD_GNUTLS_CompressionMethod mhd_gtls_compression_get_id (int num);
int mhd_gtls_compression_get_mem_level (enum MHD_GNUTLS_CompressionMethod algorithm);
int mhd_gtls_compression_get_comp_level (enum MHD_GNUTLS_CompressionMethod
algorithm);
int mhd_gtls_compression_get_wbits (gnutls_compression_method_t algorithm);
int mhd_gtls_compression_get_wbits (enum MHD_GNUTLS_CompressionMethod algorithm);
/* Type to KX mappings. */
gnutls_kx_algorithm_t mhd_gtls_map_kx_get_kx (gnutls_credentials_type_t type,
enum MHD_GNUTLS_KeyExchangeAlgorithm mhd_gtls_map_kx_get_kx (enum MHD_GNUTLS_CredentialsType type,
int server);
gnutls_credentials_type_t mhd_gtls_map_kx_get_cred (gnutls_kx_algorithm_t
enum MHD_GNUTLS_CredentialsType mhd_gtls_map_kx_get_cred (enum MHD_GNUTLS_KeyExchangeAlgorithm
algorithm, int server);
/* KX to PK mapping. */
gnutls_pk_algorithm_t mhd_gtls_map_pk_get_pk (gnutls_kx_algorithm_t
enum MHD_GNUTLS_PublicKeyAlgorithm mhd_gtls_map_pk_get_pk (enum MHD_GNUTLS_KeyExchangeAlgorithm
kx_algorithm);
gnutls_pk_algorithm_t mhd_gtls_x509_oid2pk_algorithm (const char *oid);
const char * mhd_gtls_x509_pk_to_oid (gnutls_pk_algorithm_t pk);
enum MHD_GNUTLS_PublicKeyAlgorithm mhd_gtls_x509_oid2pk_algorithm (const char *oid);
const char * mhd_gtls_x509_pk_to_oid (enum MHD_GNUTLS_PublicKeyAlgorithm pk);
enum encipher_type
{ CIPHER_ENCRYPT = 0, CIPHER_SIGN = 1, CIPHER_IGN };
enum encipher_type mhd_gtls_kx_encipher_type (gnutls_kx_algorithm_t algorithm);
enum encipher_type mhd_gtls_kx_encipher_type (enum MHD_GNUTLS_KeyExchangeAlgorithm algorithm);
struct mhd_gtls_compression_entry
{
const char *name;
gnutls_compression_method_t id;
enum MHD_GNUTLS_CompressionMethod id;
int num; /* the number reserved in TLS for the specific compression method */
/* used in zlib compressor */
@@ -118,24 +118,24 @@ typedef struct mhd_gtls_compression_entry gnutls_compression_entry;
/* Functions for sign algorithms. */
gnutls_sign_algorithm_t mhd_gtls_x509_oid2sign_algorithm (const char *oid);
gnutls_sign_algorithm_t mhd_gtls_x509_pk_to_sign (gnutls_pk_algorithm_t pk,
gnutls_mac_algorithm_t mac);
const char * mhd_gtls_x509_sign_to_oid (gnutls_pk_algorithm_t,
gnutls_mac_algorithm_t mac);
gnutls_sign_algorithm_t mhd_gtls_x509_pk_to_sign (enum MHD_GNUTLS_PublicKeyAlgorithm pk,
enum MHD_GNUTLS_HashAlgorithm mac);
const char * mhd_gtls_x509_sign_to_oid (enum MHD_GNUTLS_PublicKeyAlgorithm,
enum MHD_GNUTLS_HashAlgorithm mac);
int mhd_gtls_mac_priority (mhd_gtls_session_t session,
gnutls_mac_algorithm_t algorithm);
enum MHD_GNUTLS_HashAlgorithm algorithm);
int mhd_gtls_cipher_priority (mhd_gtls_session_t session,
gnutls_cipher_algorithm_t algorithm);
enum MHD_GNUTLS_CipherAlgorithm algorithm);
int mhd_gtls_kx_priority (mhd_gtls_session_t session,
gnutls_kx_algorithm_t algorithm);
enum MHD_GNUTLS_KeyExchangeAlgorithm algorithm);
int mhd_gtls_compression_priority (mhd_gtls_session_t session,
gnutls_compression_method_t algorithm);
enum MHD_GNUTLS_CompressionMethod algorithm);
gnutls_mac_algorithm_t MHD_gtls_mac_get_id (const char* name);
gnutls_cipher_algorithm_t MHD_gtls_cipher_get_id (const char* name);
gnutls_kx_algorithm_t MHD_gtls_kx_get_id (const char* name);
gnutls_protocol_t MHD_gtls_protocol_get_id (const char* name);
gnutls_certificate_type_t MHD_gtls_certificate_type_get_id (const char* name);
enum MHD_GNUTLS_HashAlgorithm MHD_gtls_mac_get_id (const char* name);
enum MHD_GNUTLS_CipherAlgorithm MHD_gtls_cipher_get_id (const char* name);
enum MHD_GNUTLS_KeyExchangeAlgorithm MHD_gtls_kx_get_id (const char* name);
enum MHD_GNUTLS_Protocol MHD_gtls_protocol_get_id (const char* name);
enum MHD_GNUTLS_CertificateType MHD_gtls_certificate_type_get_id (const char* name);
#endif
+7 -7
View File
@@ -91,7 +91,7 @@ MHD_gnutls_credentials_clear (mhd_gtls_session_t session)
**/
int
MHD_gnutls_credentials_set (mhd_gtls_session_t session,
gnutls_credentials_type_t type, void *cred)
enum MHD_GNUTLS_CredentialsType type, void *cred)
{
auth_cred_st *ccred = NULL, *pcred = NULL;
int exists = 0;
@@ -160,7 +160,7 @@ MHD_gnutls_credentials_set (mhd_gtls_session_t session,
* Eg. for CERTIFICATE ciphersuites (key exchange algorithms: KX_RSA, KX_DHE_RSA),
* the same function are to be used to access the authentication data.
**/
gnutls_credentials_type_t
enum MHD_GNUTLS_CredentialsType
MHD_gtls_auth_get_type (mhd_gtls_session_t session)
{
/* This is not the credentials we must set, but the authentication data
@@ -183,7 +183,7 @@ MHD_gtls_auth_get_type (mhd_gtls_session_t session)
* to access authentication data.
*
**/
gnutls_credentials_type_t
enum MHD_GNUTLS_CredentialsType
MHD_gtls_auth_server_get_type (mhd_gtls_session_t session)
{
return
@@ -201,7 +201,7 @@ MHD_gtls_auth_server_get_type (mhd_gtls_session_t session)
* to access authentication data.
*
**/
gnutls_credentials_type_t
enum MHD_GNUTLS_CredentialsType
MHD_gtls_auth_client_get_type (mhd_gtls_session_t session)
{
return
@@ -217,7 +217,7 @@ MHD_gtls_auth_client_get_type (mhd_gtls_session_t session)
*/
const void *
mhd_gtls_get_kx_cred (mhd_gtls_session_t session,
gnutls_kx_algorithm_t algo, int *err)
enum MHD_GNUTLS_KeyExchangeAlgorithm algo, int *err)
{
int server = session->security_parameters.entity == GNUTLS_SERVER ? 1 : 0;
@@ -226,7 +226,7 @@ mhd_gtls_get_kx_cred (mhd_gtls_session_t session,
}
const void *
mhd_gtls_get_cred (mhd_gtls_key_st key, gnutls_credentials_type_t type, int *err)
mhd_gtls_get_cred (mhd_gtls_key_st key, enum MHD_GNUTLS_CredentialsType type, int *err)
{
const void *retval = NULL;
int _err = -1;
@@ -354,7 +354,7 @@ mhd_gtls_free_auth_info (mhd_gtls_session_t session)
*/
int
mhd_gtls_auth_info_set (mhd_gtls_session_t session,
gnutls_credentials_type_t type, int size,
enum MHD_GNUTLS_CredentialsType type, int size,
int allow_change)
{
if (session->key->auth_info == NULL)
+3 -3
View File
@@ -23,10 +23,10 @@
*/
const void * mhd_gtls_get_cred (mhd_gtls_key_st key,
gnutls_credentials_type_t kx, int *err);
enum MHD_GNUTLS_CredentialsType kx, int *err);
const void * mhd_gtls_get_kx_cred (mhd_gtls_session_t session,
gnutls_kx_algorithm_t algo, int *err);
enum MHD_GNUTLS_KeyExchangeAlgorithm algo, int *err);
void * mhd_gtls_get_auth_info (mhd_gtls_session_t session);
int mhd_gtls_auth_info_set (mhd_gtls_session_t session,
gnutls_credentials_type_t type, int size,
enum MHD_GNUTLS_CredentialsType type, int size,
int allow_change);
+10 -10
View File
@@ -232,12 +232,12 @@ MHD_gnutls_certificate_allocate_credentials (mhd_gtls_cert_credentials_t *
*/
int
mhd_gtls_selected_cert_supported_kx (mhd_gtls_session_t session,
gnutls_kx_algorithm_t ** alg,
enum MHD_GNUTLS_KeyExchangeAlgorithm ** alg,
int *alg_size)
{
gnutls_kx_algorithm_t kx;
gnutls_pk_algorithm_t pk;
gnutls_kx_algorithm_t kxlist[MAX_ALGOS];
enum MHD_GNUTLS_KeyExchangeAlgorithm kx;
enum MHD_GNUTLS_PublicKeyAlgorithm pk;
enum MHD_GNUTLS_KeyExchangeAlgorithm kxlist[MAX_ALGOS];
gnutls_cert *cert;
int i;
@@ -271,13 +271,13 @@ mhd_gtls_selected_cert_supported_kx (mhd_gtls_session_t session,
return GNUTLS_E_INVALID_REQUEST;
}
*alg = gnutls_calloc (1, sizeof (gnutls_kx_algorithm_t) * i);
*alg = gnutls_calloc (1, sizeof (enum MHD_GNUTLS_KeyExchangeAlgorithm) * i);
if (*alg == NULL)
return GNUTLS_E_MEMORY_ERROR;
*alg_size = i;
memcpy (*alg, kxlist, i * sizeof (gnutls_kx_algorithm_t));
memcpy (*alg, kxlist, i * sizeof (enum MHD_GNUTLS_KeyExchangeAlgorithm));
return 0;
}
@@ -311,7 +311,7 @@ MHD_gtls_certificate_server_set_request (mhd_gtls_session_t session,
* to be used in the handshake.
* The callback's function prototype is:
* int (*callback)(mhd_gtls_session_t, const gnutls_datum_t* req_ca_dn, int nreqs,
* const gnutls_pk_algorithm_t* pk_algos, int pk_algos_length, gnutls_retr_st* st);
* const enum MHD_GNUTLS_PublicKeyAlgorithm* pk_algos, int pk_algos_length, gnutls_retr_st* st);
*
* @req_ca_cert is only used in X.509 certificates.
* Contains a list with the CA names that the server considers trusted.
@@ -598,7 +598,7 @@ MHD_gtls_certificate_activation_time_peers (mhd_gtls_session_t session)
int
mhd_gtls_raw_cert_to_gcert (gnutls_cert * gcert,
gnutls_certificate_type_t type,
enum MHD_GNUTLS_CertificateType type,
const gnutls_datum_t * raw_cert,
int flags /* OR of ConvFlags */ )
{
@@ -614,7 +614,7 @@ mhd_gtls_raw_cert_to_gcert (gnutls_cert * gcert,
int
mhd_gtls_raw_privkey_to_gkey (gnutls_privkey * key,
gnutls_certificate_type_t type,
enum MHD_GNUTLS_CertificateType type,
const gnutls_datum_t * raw_key,
int key_enc /* DER or PEM */ )
{
@@ -780,7 +780,7 @@ mhd_gtls_gcert_deinit (gnutls_cert * cert)
*
* typedef int (*gnutls_sign_func) (mhd_gtls_session_t session,
* void *userdata,
* gnutls_certificate_type_t cert_type,
* enum MHD_GNUTLS_CertificateType cert_type,
* const gnutls_datum_t * cert,
* const gnutls_datum_t * hash,
* gnutls_datum_t * signature);
+6 -6
View File
@@ -61,7 +61,7 @@ typedef struct gnutls_cert
*/
int params_size; /* holds the size of MPI params */
gnutls_pk_algorithm_t subject_pk_algorithm;
enum MHD_GNUTLS_PublicKeyAlgorithm subject_pk_algorithm;
unsigned int key_usage; /* bits from KEY_*
*/
@@ -69,7 +69,7 @@ typedef struct gnutls_cert
unsigned int version;
/* holds the type (PGP, X509)
*/
gnutls_certificate_type_t cert_type;
enum MHD_GNUTLS_CertificateType cert_type;
gnutls_datum_t raw;
@@ -95,7 +95,7 @@ typedef struct gnutls_privkey_int
*/
int params_size; /* holds the number of params */
gnutls_pk_algorithm_t pk_algorithm;
enum MHD_GNUTLS_PublicKeyAlgorithm pk_algorithm;
} gnutls_privkey;
struct MHD_gtls_session_int; /* because mhd_gtls_session_t is not defined when this file is included */
@@ -117,15 +117,15 @@ void mhd_gtls_gkey_deinit (gnutls_privkey * key);
void mhd_gtls_gcert_deinit (gnutls_cert * cert);
int mhd_gtls_selected_cert_supported_kx (struct MHD_gtls_session_int *session,
gnutls_kx_algorithm_t ** alg,
enum MHD_GNUTLS_KeyExchangeAlgorithm ** alg,
int *alg_size);
int mhd_gtls_raw_cert_to_gcert (gnutls_cert * gcert,
gnutls_certificate_type_t type,
enum MHD_GNUTLS_CertificateType type,
const gnutls_datum_t * raw_cert,
int flags /* OR of ConvFlags */ );
int mhd_gtls_raw_privkey_to_gkey (gnutls_privkey * key,
gnutls_certificate_type_t type,
enum MHD_GNUTLS_CertificateType type,
const gnutls_datum_t * raw_key,
int key_enc /* DER or PEM */ );
+3 -3
View File
@@ -194,7 +194,7 @@ mhd_gtls_decrypt (mhd_gtls_session_t session, opaque * ciphertext,
}
inline static mac_hd_t
mac_init (gnutls_mac_algorithm_t mac, opaque * secret, int secret_size,
mac_init (enum MHD_GNUTLS_HashAlgorithm mac, opaque * secret, int secret_size,
int ver)
{
mac_hd_t td;
@@ -304,7 +304,7 @@ mhd_gtls_compressed2ciphertext (mhd_gtls_session_t session,
int hash_size =
mhd_gnutls_hash_get_algo_len (session->security_parameters.
write_mac_algorithm);
gnutls_protocol_t ver;
enum MHD_GNUTLS_Protocol ver;
int blocksize =
mhd_gtls_cipher_get_block_size (session->security_parameters.
write_bulk_cipher_algorithm);
@@ -429,7 +429,7 @@ mhd_gtls_ciphertext2compressed (mhd_gtls_session_t session,
uint16_t blocksize;
int ret, i, pad_failed = 0;
uint8_t major, minor;
gnutls_protocol_t ver;
enum MHD_GNUTLS_Protocol ver;
int hash_size =
mhd_gnutls_hash_get_algo_len (session->security_parameters.
read_mac_algorithm);
+1 -1
View File
@@ -28,7 +28,7 @@
#include <gnutls_datum.h>
cipher_hd_t
mhd_gtls_cipher_init (gnutls_cipher_algorithm_t cipher,
mhd_gtls_cipher_init (enum MHD_GNUTLS_CipherAlgorithm cipher,
const gnutls_datum_t * key, const gnutls_datum_t * iv)
{
cipher_hd_t ret = NULL;
+1 -1
View File
@@ -29,7 +29,7 @@
#define GNUTLS_CIPHER_FAILED NULL
// TODO gc_cipher_handle -> void * x3
void * mhd_gtls_cipher_init(gnutls_cipher_algorithm_t cipher,
void * mhd_gtls_cipher_init(enum MHD_GNUTLS_CipherAlgorithm cipher,
const gnutls_datum_t * key,
const gnutls_datum_t * iv);
+1 -1
View File
@@ -31,7 +31,7 @@
* decompress.
*/
comp_hd_t
mhd_gtls_comp_init (gnutls_compression_method_t method, int d)
mhd_gtls_comp_init (enum MHD_GNUTLS_CompressionMethod method, int d)
{
comp_hd_t ret;
+2 -2
View File
@@ -34,10 +34,10 @@
typedef struct comp_hd_t_STRUCT
{
void *handle;
gnutls_compression_method_t algo;
enum MHD_GNUTLS_CompressionMethod algo;
} *comp_hd_t;
comp_hd_t mhd_gtls_comp_init (gnutls_compression_method_t, int d);
comp_hd_t mhd_gtls_comp_init (enum MHD_GNUTLS_CompressionMethod, int d);
void mhd_gtls_comp_deinit (comp_hd_t handle, int d);
int mhd_gtls_decompress (comp_hd_t handle, opaque * compressed,
+11 -11
View File
@@ -390,8 +390,8 @@ _gnutls_set_read_keys (mhd_gtls_session_t session)
int hash_size;
int IV_size;
int key_size, export_flag;
gnutls_cipher_algorithm_t algo;
gnutls_mac_algorithm_t mac_algo;
enum MHD_GNUTLS_CipherAlgorithm algo;
enum MHD_GNUTLS_HashAlgorithm mac_algo;
mac_algo = session->security_parameters.read_mac_algorithm;
algo = session->security_parameters.read_bulk_cipher_algorithm;
@@ -411,8 +411,8 @@ _gnutls_set_write_keys (mhd_gtls_session_t session)
int hash_size;
int IV_size;
int key_size, export_flag;
gnutls_cipher_algorithm_t algo;
gnutls_mac_algorithm_t mac_algo;
enum MHD_GNUTLS_CipherAlgorithm algo;
enum MHD_GNUTLS_HashAlgorithm mac_algo;
mac_algo = session->security_parameters.write_mac_algorithm;
algo = session->security_parameters.write_bulk_cipher_algorithm;
@@ -874,7 +874,7 @@ mhd_gtls_write_connection_state_init (mhd_gtls_session_t session)
*/
int
mhd_gtls_set_read_cipher (mhd_gtls_session_t session,
gnutls_cipher_algorithm_t algo)
enum MHD_GNUTLS_CipherAlgorithm algo)
{
if (mhd_gtls_cipher_is_ok (algo) == 0)
@@ -900,7 +900,7 @@ mhd_gtls_set_read_cipher (mhd_gtls_session_t session,
int
mhd_gtls_set_write_cipher (mhd_gtls_session_t session,
gnutls_cipher_algorithm_t algo)
enum MHD_GNUTLS_CipherAlgorithm algo)
{
if (mhd_gtls_cipher_is_ok (algo) == 0)
@@ -929,7 +929,7 @@ mhd_gtls_set_write_cipher (mhd_gtls_session_t session,
*/
int
mhd_gtls_set_read_compression (mhd_gtls_session_t session,
gnutls_compression_method_t algo)
enum MHD_GNUTLS_CompressionMethod algo)
{
if (mhd_gtls_compression_is_ok (algo) == 0)
@@ -947,7 +947,7 @@ mhd_gtls_set_read_compression (mhd_gtls_session_t session,
int
mhd_gtls_set_write_compression (mhd_gtls_session_t session,
gnutls_compression_method_t algo)
enum MHD_GNUTLS_CompressionMethod algo)
{
if (mhd_gtls_compression_is_ok (algo) == 0)
@@ -966,7 +966,7 @@ mhd_gtls_set_write_compression (mhd_gtls_session_t session,
/* Sets the specified kx algorithm into pending session
*/
int
mhd_gtls_set_kx (mhd_gtls_session_t session, gnutls_kx_algorithm_t algo)
mhd_gtls_set_kx (mhd_gtls_session_t session, enum MHD_GNUTLS_KeyExchangeAlgorithm algo)
{
if (mhd_gtls_kx_is_ok (algo) == 0)
@@ -991,7 +991,7 @@ mhd_gtls_set_kx (mhd_gtls_session_t session, gnutls_kx_algorithm_t algo)
/* Sets the specified mac algorithm into pending session */
int
mhd_gtls_set_read_mac (mhd_gtls_session_t session, gnutls_mac_algorithm_t algo)
mhd_gtls_set_read_mac (mhd_gtls_session_t session, enum MHD_GNUTLS_HashAlgorithm algo)
{
if (mhd_gnutls_mac_is_ok (algo) == 0)
@@ -1015,7 +1015,7 @@ mhd_gtls_set_read_mac (mhd_gtls_session_t session, gnutls_mac_algorithm_t algo)
}
int
mhd_gtls_set_write_mac (mhd_gtls_session_t session, gnutls_mac_algorithm_t algo)
mhd_gtls_set_write_mac (mhd_gtls_session_t session, enum MHD_GNUTLS_HashAlgorithm algo)
{
if (mhd_gnutls_mac_is_ok (algo) == 0)
+7 -7
View File
@@ -26,15 +26,15 @@ int mhd_gtls_connection_state_init (mhd_gtls_session_t session);
int mhd_gtls_read_connection_state_init (mhd_gtls_session_t session);
int mhd_gtls_write_connection_state_init (mhd_gtls_session_t session);
int mhd_gtls_set_write_cipher (mhd_gtls_session_t session,
gnutls_cipher_algorithm_t algo);
enum MHD_GNUTLS_CipherAlgorithm algo);
int mhd_gtls_set_write_mac (mhd_gtls_session_t session,
gnutls_mac_algorithm_t algo);
enum MHD_GNUTLS_HashAlgorithm algo);
int mhd_gtls_set_read_cipher (mhd_gtls_session_t session,
gnutls_cipher_algorithm_t algo);
enum MHD_GNUTLS_CipherAlgorithm algo);
int mhd_gtls_set_read_mac (mhd_gtls_session_t session,
gnutls_mac_algorithm_t algo);
enum MHD_GNUTLS_HashAlgorithm algo);
int mhd_gtls_set_read_compression (mhd_gtls_session_t session,
gnutls_compression_method_t algo);
enum MHD_GNUTLS_CompressionMethod algo);
int mhd_gtls_set_write_compression (mhd_gtls_session_t session,
gnutls_compression_method_t algo);
int mhd_gtls_set_kx (mhd_gtls_session_t session, gnutls_kx_algorithm_t algo);
enum MHD_GNUTLS_CompressionMethod algo);
int mhd_gtls_set_kx (mhd_gtls_session_t session, enum MHD_GNUTLS_KeyExchangeAlgorithm algo);
+18 -18
View File
@@ -195,7 +195,7 @@ _gnutls_finished (mhd_gtls_session_t session, int type, void *ret)
const char *mesg;
mac_hd_t td_md5 = NULL;
mac_hd_t td_sha;
gnutls_protocol_t ver = MHD_gnutls_protocol_get_version (session);
enum MHD_GNUTLS_Protocol ver = MHD_gnutls_protocol_get_version (session);
if (ver < MHD_GNUTLS_TLS1_2)
{
@@ -271,7 +271,7 @@ mhd_gtls_tls_create_random (opaque * dst)
*/
int
mhd_gtls_negotiate_version (mhd_gtls_session_t session,
gnutls_protocol_t adv_version)
enum MHD_GNUTLS_Protocol adv_version)
{
int ret;
@@ -302,7 +302,7 @@ mhd_gtls_negotiate_version (mhd_gtls_session_t session,
int
mhd_gtls_user_hello_func (mhd_gtls_session_t session,
gnutls_protocol_t adv_version)
enum MHD_GNUTLS_Protocol adv_version)
{
int ret;
@@ -339,7 +339,7 @@ _gnutls_read_client_hello (mhd_gtls_session_t session, opaque * data,
uint8_t session_id_len;
int pos = 0, ret = 0;
uint16_t suite_size, comp_size;
gnutls_protocol_t adv_version;
enum MHD_GNUTLS_Protocol adv_version;
int neg_version;
int len = datalen;
opaque rnd[TLS_RANDOM_SIZE], *suite_ptr, *comp_ptr;
@@ -637,8 +637,8 @@ _gnutls_server_find_pk_algos_in_ciphersuites (const opaque *
data, int datalen)
{
int j;
gnutls_pk_algorithm_t algo = GNUTLS_PK_NONE, prev_algo = 0;
gnutls_kx_algorithm_t kx;
enum MHD_GNUTLS_PublicKeyAlgorithm algo = GNUTLS_PK_NONE, prev_algo = 0;
enum MHD_GNUTLS_KeyExchangeAlgorithm kx;
cipher_suite_st cs;
if (datalen % 2 != 0)
@@ -676,7 +676,7 @@ mhd_gtls_server_select_suite (mhd_gtls_session_t session, opaque * data,
int x, i, j;
cipher_suite_st *ciphers, cs;
int retval, err;
gnutls_pk_algorithm_t pk_algo; /* will hold the pk algorithms
enum MHD_GNUTLS_PublicKeyAlgorithm pk_algo; /* will hold the pk algorithms
* supported by the peer.
*/
@@ -811,7 +811,7 @@ _gnutls_server_select_comp_method (mhd_gtls_session_t session,
}
memset (&session->internals.compression_method, 0,
sizeof (gnutls_compression_method_t));
sizeof (enum MHD_GNUTLS_CompressionMethod));
for (j = 0; j < datalen; j++)
{
@@ -819,7 +819,7 @@ _gnutls_server_select_comp_method (mhd_gtls_session_t session,
{
if (comps[i] == data[j])
{
gnutls_compression_method_t method =
enum MHD_GNUTLS_CompressionMethod method =
mhd_gtls_compression_get_id (comps[i]);
session->internals.compression_method = method;
@@ -1454,7 +1454,7 @@ _gnutls_read_server_hello (mhd_gtls_session_t session,
uint8_t session_id_len = 0;
int pos = 0;
int ret = 0;
gnutls_protocol_t version;
enum MHD_GNUTLS_Protocol version;
int len = datalen;
if (datalen < 38)
@@ -1672,7 +1672,7 @@ _gnutls_send_client_hello (mhd_gtls_session_t session, int again)
int pos = 0;
int datalen = 0, ret = 0;
opaque rnd[TLS_RANDOM_SIZE];
gnutls_protocol_t hver;
enum MHD_GNUTLS_Protocol hver;
opaque extdata[MAX_EXT_DATA_LENGTH];
opaque *SessionID =
@@ -2700,8 +2700,8 @@ mhd_gtls_recv_hello_request (mhd_gtls_session_t session, void *data,
*/
inline static int
check_server_params (mhd_gtls_session_t session,
gnutls_kx_algorithm_t kx,
gnutls_kx_algorithm_t * alg, int alg_size)
enum MHD_GNUTLS_KeyExchangeAlgorithm kx,
enum MHD_GNUTLS_KeyExchangeAlgorithm * alg, int alg_size)
{
int cred_type;
mhd_gtls_dh_params_t dh_params = NULL;
@@ -2818,16 +2818,16 @@ int
mhd_gtls_remove_unwanted_ciphersuites (mhd_gtls_session_t session,
cipher_suite_st ** cipherSuites,
int numCipherSuites,
gnutls_pk_algorithm_t requested_pk_algo)
enum MHD_GNUTLS_PublicKeyAlgorithm requested_pk_algo)
{
int ret = 0;
cipher_suite_st *newSuite, cs;
int newSuiteSize = 0, i;
mhd_gtls_cert_credentials_t cert_cred;
gnutls_kx_algorithm_t kx;
enum MHD_GNUTLS_KeyExchangeAlgorithm kx;
int server = session->security_parameters.entity == GNUTLS_SERVER ? 1 : 0;
gnutls_kx_algorithm_t *alg = NULL;
enum MHD_GNUTLS_KeyExchangeAlgorithm *alg = NULL;
int alg_size = 0;
/* if we should use a specific certificate,
@@ -2959,13 +2959,13 @@ MHD_gnutls_handshake_set_max_packet_length (mhd_gtls_session_t session, size_t m
}
void
mhd_gtls_set_adv_version (mhd_gtls_session_t session, gnutls_protocol_t ver)
mhd_gtls_set_adv_version (mhd_gtls_session_t session, enum MHD_GNUTLS_Protocol ver)
{
set_adv_version (session, mhd_gtls_version_get_major (ver),
mhd_gtls_version_get_minor (ver));
}
gnutls_protocol_t
enum MHD_GNUTLS_Protocol
mhd_gtls_get_adv_version (mhd_gtls_session_t session)
{
return mhd_gtls_version_get (_gnutls_get_adv_version_major (session),
+3 -3
View File
@@ -44,13 +44,13 @@ int mhd_gtls_tls_create_random (opaque * dst);
int mhd_gtls_remove_unwanted_ciphersuites (mhd_gtls_session_t session,
cipher_suite_st ** cipherSuites,
int numCipherSuites,
gnutls_pk_algorithm_t);
enum MHD_GNUTLS_PublicKeyAlgorithm);
int mhd_gtls_find_pk_algos_in_ciphersuites (opaque * data, int datalen);
int mhd_gtls_server_select_suite (mhd_gtls_session_t session, opaque * data,
int datalen);
int mhd_gtls_negotiate_version( mhd_gtls_session_t session, gnutls_protocol_t adv_version);
int mhd_gtls_user_hello_func( mhd_gtls_session_t, gnutls_protocol_t adv_version);
int mhd_gtls_negotiate_version( mhd_gtls_session_t session, enum MHD_GNUTLS_Protocol adv_version);
int mhd_gtls_user_hello_func( mhd_gtls_session_t, enum MHD_GNUTLS_Protocol adv_version);
#if MHD_DEBUG_TLS
int mhd_gtls_handshake_client (mhd_gtls_session_t session);
+6 -6
View File
@@ -31,7 +31,7 @@
#include <gnutls_errors.h>
static inline Gc_hash
_gnutls_mac2gc (gnutls_mac_algorithm_t mac)
_gnutls_mac2gc (enum MHD_GNUTLS_HashAlgorithm mac)
{
switch (mac)
{
@@ -55,7 +55,7 @@ _gnutls_mac2gc (gnutls_mac_algorithm_t mac)
}
GNUTLS_HASH_HANDLE
mhd_gtls_hash_init (gnutls_mac_algorithm_t algorithm)
mhd_gtls_hash_init (enum MHD_GNUTLS_HashAlgorithm algorithm)
{
mac_hd_t ret;
int result;
@@ -81,7 +81,7 @@ mhd_gtls_hash_init (gnutls_mac_algorithm_t algorithm)
}
int
mhd_gnutls_hash_get_algo_len (gnutls_mac_algorithm_t algorithm)
mhd_gnutls_hash_get_algo_len (enum MHD_GNUTLS_HashAlgorithm algorithm)
{
int ret;
@@ -144,7 +144,7 @@ mhd_gnutls_hash_deinit (GNUTLS_HASH_HANDLE handle, void *digest)
mac_hd_t
mhd_gtls_hmac_init (gnutls_mac_algorithm_t algorithm,
mhd_gtls_hmac_init (enum MHD_GNUTLS_HashAlgorithm algorithm,
const void *key, int keylen)
{
mac_hd_t ret;
@@ -189,7 +189,7 @@ mhd_gnutls_hmac_deinit (mac_hd_t handle, void *digest)
}
inline static int
get_padsize (gnutls_mac_algorithm_t algorithm)
get_padsize (enum MHD_GNUTLS_HashAlgorithm algorithm)
{
switch (algorithm)
{
@@ -203,7 +203,7 @@ get_padsize (gnutls_mac_algorithm_t algorithm)
}
mac_hd_t
mhd_gnutls_mac_init_ssl3 (gnutls_mac_algorithm_t algorithm, void *key,
mhd_gnutls_mac_init_ssl3 (enum MHD_GNUTLS_HashAlgorithm algorithm, void *key,
int keylen)
{
mac_hd_t ret;
+5 -5
View File
@@ -32,7 +32,7 @@
typedef struct
{
gc_hash_handle handle;
gnutls_mac_algorithm_t algorithm;
enum MHD_GNUTLS_HashAlgorithm algorithm;
const void *key;
int keysize;
} mac_hd_st;
@@ -42,17 +42,17 @@ typedef mac_hd_t GNUTLS_HASH_HANDLE;
#define GNUTLS_HASH_FAILED NULL
#define GNUTLS_MAC_FAILED NULL
mac_hd_t mhd_gtls_hmac_init (gnutls_mac_algorithm_t algorithm,
mac_hd_t mhd_gtls_hmac_init (enum MHD_GNUTLS_HashAlgorithm algorithm,
const void *key, int keylen);
void mhd_gnutls_hmac_deinit (mac_hd_t handle, void *digest);
mac_hd_t mhd_gnutls_mac_init_ssl3 (gnutls_mac_algorithm_t algorithm, void *key,
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);
GNUTLS_HASH_HANDLE mhd_gtls_hash_init (gnutls_mac_algorithm_t algorithm);
int mhd_gnutls_hash_get_algo_len (gnutls_mac_algorithm_t algorithm);
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);
void mhd_gnutls_hash_deinit (GNUTLS_HASH_HANDLE handle, void *digest);
+18 -18
View File
@@ -96,7 +96,7 @@
#define DECR_LENGTH_RET(len, x, RET) do { len-=x; if (len<0) {gnutls_assert(); return RET;} } while (0)
#define DECR_LENGTH_COM(len, x, COM) do { len-=x; if (len<0) {gnutls_assert(); COM;} } while (0)
#define HASH2MAC(x) ((gnutls_mac_algorithm_t)x)
#define HASH2MAC(x) ((enum MHD_GNUTLS_HashAlgorithm)x)
/* TODO rm */
/* Additional cast to bring void* to a type castable to int. */
@@ -171,8 +171,8 @@ typedef enum content_type_t
GNUTLS_INNER_APPLICATION = 24
} content_type_t;
#define GNUTLS_PK_ANY (gnutls_pk_algorithm_t)-1
#define GNUTLS_PK_NONE (gnutls_pk_algorithm_t)-2
#define GNUTLS_PK_ANY (enum MHD_GNUTLS_PublicKeyAlgorithm)-1
#define GNUTLS_PK_NONE (enum MHD_GNUTLS_PublicKeyAlgorithm)-2
/* STATE (stop) */
@@ -182,7 +182,7 @@ typedef void (*LOG_FUNC)(int,
/* Store & Retrieve functions defines: */
typedef struct mhd_gtls_auth_cred_st
{
gnutls_credentials_type_t algorithm;
enum MHD_GNUTLS_CredentialsType algorithm;
/* the type of credentials depends on algorithm
*/
@@ -217,7 +217,7 @@ struct mhd_gtls_key
* Rememember that this should be calloced!
*/
void *auth_info;
gnutls_credentials_type_t auth_info_type;
enum MHD_GNUTLS_CredentialsType auth_info_type;
int auth_info_size; /* needed in order to store to db for restoring
*/
uint8_t crypt_algo;
@@ -316,18 +316,18 @@ typedef enum tls_ext_parse_type_t
typedef struct
{
gnutls_connection_end_t entity;
gnutls_kx_algorithm_t kx_algorithm;
enum MHD_GNUTLS_KeyExchangeAlgorithm kx_algorithm;
/* we've got separate write/read bulk/macs because
* there is a time in handshake where the peer has
* null cipher and we don't
*/
gnutls_cipher_algorithm_t read_bulk_cipher_algorithm;
gnutls_mac_algorithm_t read_mac_algorithm;
gnutls_compression_method_t read_compression_algorithm;
enum MHD_GNUTLS_CipherAlgorithm read_bulk_cipher_algorithm;
enum MHD_GNUTLS_HashAlgorithm read_mac_algorithm;
enum MHD_GNUTLS_CompressionMethod read_compression_algorithm;
gnutls_cipher_algorithm_t write_bulk_cipher_algorithm;
gnutls_mac_algorithm_t write_mac_algorithm;
gnutls_compression_method_t write_compression_algorithm;
enum MHD_GNUTLS_CipherAlgorithm write_bulk_cipher_algorithm;
enum MHD_GNUTLS_HashAlgorithm write_mac_algorithm;
enum MHD_GNUTLS_CompressionMethod write_compression_algorithm;
/* this is the ciphersuite we are going to use
* moved here from internals in order to be restored
@@ -348,8 +348,8 @@ typedef struct
uint16_t max_record_send_size;
uint16_t max_record_recv_size;
/* holds the negotiated certificate type */
gnutls_certificate_type_t cert_type;
gnutls_protocol_t version; /* moved here */
enum MHD_GNUTLS_CertificateType cert_type;
enum MHD_GNUTLS_Protocol version; /* moved here */
/* For TLS/IA. XXX: Move to IA credential? */
opaque inner_secret[TLS_MASTER_SIZE];
} mhd_gtls_security_param_st;
@@ -465,7 +465,7 @@ typedef struct
int last_handshake_out;
/* this is the compression method we are going to use */
gnutls_compression_method_t compression_method;
enum MHD_GNUTLS_CompressionMethod compression_method;
/* priorities */
struct MHD_gtls_priority_st priorities;
@@ -654,7 +654,7 @@ struct MHD_gtls_session_int
/* functions */
void mhd_gtls_set_current_version(mhd_gtls_session_t session,
gnutls_protocol_t version);
enum MHD_GNUTLS_Protocol version);
void mhd_gtls_free_auth_info(mhd_gtls_session_t session);
@@ -672,7 +672,7 @@ void mhd_gtls_free_auth_info(mhd_gtls_session_t session);
session->internals.adv_version_minor = minor
void mhd_gtls_set_adv_version(mhd_gtls_session_t,
gnutls_protocol_t);
gnutls_protocol_t mhd_gtls_get_adv_version(mhd_gtls_session_t);
enum MHD_GNUTLS_Protocol);
enum MHD_GNUTLS_Protocol mhd_gtls_get_adv_version(mhd_gtls_session_t);
#endif /* GNUTLS_INT_H */
+6 -6
View File
@@ -35,7 +35,7 @@
/**
* MHD_gnutls_cipher_set_priority - Sets the priority on the ciphers supported by gnutls.
* @session: is a #mhd_gtls_session_t structure.
* @list: is a 0 terminated list of gnutls_cipher_algorithm_t elements.
* @list: is a 0 terminated list of enum MHD_GNUTLS_CipherAlgorithm elements.
*
* Sets the priority on the ciphers supported by gnutls.
* Priority is higher for elements specified before others.
@@ -88,7 +88,7 @@ _set_priority (mhd_gtls_priority_st * st, const int *list)
/**
* MHD_gnutls_kx_set_priority - Sets the priority on the key exchange algorithms supported by gnutls.
* @session: is a #mhd_gtls_session_t structure.
* @list: is a 0 terminated list of gnutls_kx_algorithm_t elements.
* @list: is a 0 terminated list of enum MHD_GNUTLS_KeyExchangeAlgorithm elements.
*
* Sets the priority on the key exchange algorithms supported by gnutls.
* Priority is higher for elements specified before others.
@@ -109,7 +109,7 @@ MHD_gnutls_kx_set_priority (mhd_gtls_session_t session, const int *list)
/**
* MHD_gnutls_mac_set_priority - Sets the priority on the mac algorithms supported by gnutls.
* @session: is a #mhd_gtls_session_t structure.
* @list: is a 0 terminated list of gnutls_mac_algorithm_t elements.
* @list: is a 0 terminated list of enum MHD_GNUTLS_HashAlgorithm elements.
*
* Sets the priority on the mac algorithms supported by gnutls.
* Priority is higher for elements specified before others.
@@ -130,7 +130,7 @@ MHD_gnutls_mac_set_priority (mhd_gtls_session_t session, const int *list)
/**
* MHD_gnutls_compression_set_priority - Sets the priority on the compression algorithms supported by gnutls.
* @session: is a #mhd_gtls_session_t structure.
* @list: is a 0 terminated list of gnutls_compression_method_t elements.
* @list: is a 0 terminated list of enum MHD_GNUTLS_CompressionMethod elements.
*
* Sets the priority on the compression algorithms supported by gnutls.
* Priority is higher for elements specified before others.
@@ -155,7 +155,7 @@ MHD_gnutls_compression_set_priority (mhd_gtls_session_t session, const int *list
/**
* MHD_gnutls_protocol_set_priority - Sets the priority on the protocol versions supported by gnutls.
* @session: is a #mhd_gtls_session_t structure.
* @list: is a 0 terminated list of gnutls_protocol_t elements.
* @list: is a 0 terminated list of enum MHD_GNUTLS_Protocol elements.
*
* Sets the priority on the protocol versions supported by gnutls.
* This function actually enables or disables protocols. Newer protocol
@@ -183,7 +183,7 @@ MHD_gnutls_protocol_set_priority (mhd_gtls_session_t session, const int *list)
/**
* MHD_gnutls_certificate_type_set_priority - Sets the priority on the certificate types supported by gnutls.
* @session: is a #mhd_gtls_session_t structure.
* @list: is a 0 terminated list of gnutls_certificate_type_t elements.
* @list: is a 0 terminated list of enum MHD_GNUTLS_CertificateType elements.
*
* Sets the priority on the certificate types supported by gnutls.
* Priority is higher for elements specified before others.
+3 -3
View File
@@ -49,7 +49,7 @@
*
* Returns: the version of the currently used protocol.
**/
gnutls_protocol_t
enum MHD_GNUTLS_Protocol
MHD_gnutls_protocol_get_version (mhd_gtls_session_t session)
{
return session->security_parameters.version;
@@ -57,7 +57,7 @@ MHD_gnutls_protocol_get_version (mhd_gtls_session_t session)
void
mhd_gtls_set_current_version (mhd_gtls_session_t session,
gnutls_protocol_t version)
enum MHD_GNUTLS_Protocol version)
{
session->security_parameters.version = version;
}
@@ -259,7 +259,7 @@ inline static void
copy_record_version (mhd_gtls_session_t session,
gnutls_handshake_description_t htype, opaque version[2])
{
gnutls_protocol_t lver;
enum MHD_GNUTLS_Protocol lver;
if (htype != GNUTLS_HANDSHAKE_CLIENT_HELLO
|| session->internals.default_record_version[0] == 0)
+5 -5
View File
@@ -56,7 +56,7 @@ mhd_gtls_tls_sign_hdata (mhd_gtls_session_t session,
opaque concat[36];
mac_hd_t td_md5;
mac_hd_t td_sha;
gnutls_protocol_t ver = MHD_gnutls_protocol_get_version (session);
enum MHD_GNUTLS_Protocol ver = MHD_gnutls_protocol_get_version (session);
td_sha = mhd_gnutls_hash_copy (session->internals.handshake_mac_handle_sha);
if (td_sha == NULL)
@@ -128,7 +128,7 @@ mhd_gtls_tls_sign_params (mhd_gtls_session_t session,
int ret;
mac_hd_t td_sha;
opaque concat[36];
gnutls_protocol_t ver = MHD_gnutls_protocol_get_version (session);
enum MHD_GNUTLS_Protocol ver = MHD_gnutls_protocol_get_version (session);
td_sha = mhd_gtls_hash_init (MHD_GNUTLS_MAC_SHA1);
if (td_sha == NULL)
@@ -204,7 +204,7 @@ mhd_gtls_tls_sign_params (mhd_gtls_session_t session,
* given data. The output will be allocated and be put in signature.
*/
int
mhd_gtls_sign (gnutls_pk_algorithm_t algo,
mhd_gtls_sign (enum MHD_GNUTLS_PublicKeyAlgorithm algo,
mpi_t * params,
int params_size,
const gnutls_datum_t * data, gnutls_datum_t * signature)
@@ -335,7 +335,7 @@ mhd_gtls_verify_sig_hdata (mhd_gtls_session_t session,
mac_hd_t td_md5;
mac_hd_t td_sha;
gnutls_datum_t dconcat;
gnutls_protocol_t ver = MHD_gnutls_protocol_get_version (session);
enum MHD_GNUTLS_Protocol ver = MHD_gnutls_protocol_get_version (session);
td_md5 = mhd_gnutls_hash_copy (session->internals.handshake_mac_handle_md5);
if (td_md5 == NULL)
@@ -402,7 +402,7 @@ mhd_gtls_verify_sig_params (mhd_gtls_session_t session,
mac_hd_t td_md5 = NULL;
mac_hd_t td_sha;
opaque concat[36];
gnutls_protocol_t ver = MHD_gnutls_protocol_get_version (session);
enum MHD_GNUTLS_Protocol ver = MHD_gnutls_protocol_get_version (session);
if (ver < MHD_GNUTLS_TLS1_2)
{
+1 -1
View File
@@ -44,7 +44,7 @@ int mhd_gtls_verify_sig_params (mhd_gtls_session_t session,
const gnutls_datum_t * params,
gnutls_datum_t * signature);
int mhd_gtls_sign (gnutls_pk_algorithm_t algo,
int mhd_gtls_sign (enum MHD_GNUTLS_PublicKeyAlgorithm algo,
mpi_t * params, int params_size,
const gnutls_datum_t * data, gnutls_datum_t * signature);
+12 -12
View File
@@ -44,7 +44,7 @@
void
_gnutls_session_cert_type_set (mhd_gtls_session_t session,
gnutls_certificate_type_t ct)
enum MHD_GNUTLS_CertificateType ct)
{
session->security_parameters.cert_type = ct;
}
@@ -55,7 +55,7 @@ _gnutls_session_cert_type_set (mhd_gtls_session_t session,
*
* Returns: the currently used cipher.
**/
gnutls_cipher_algorithm_t
enum MHD_GNUTLS_CipherAlgorithm
gnutls_cipher_get (mhd_gtls_session_t session)
{
return session->security_parameters.read_bulk_cipher_algorithm;
@@ -68,10 +68,10 @@ gnutls_cipher_get (mhd_gtls_session_t session)
* The certificate type is by default X.509, unless it is negotiated
* as a TLS extension.
*
* Returns: the currently used %gnutls_certificate_type_t certificate
* Returns: the currently used %enum MHD_GNUTLS_CertificateType certificate
* type.
**/
gnutls_certificate_type_t
enum MHD_GNUTLS_CertificateType
gnutls_certificate_type_get (mhd_gtls_session_t session)
{
return session->security_parameters.cert_type;
@@ -83,7 +83,7 @@ gnutls_certificate_type_get (mhd_gtls_session_t session)
*
* Returns: the key exchange algorithm used in the last handshake.
**/
gnutls_kx_algorithm_t
enum MHD_GNUTLS_KeyExchangeAlgorithm
gnutls_kx_get (mhd_gtls_session_t session)
{
return session->security_parameters.kx_algorithm;
@@ -95,7 +95,7 @@ gnutls_kx_get (mhd_gtls_session_t session)
*
* Returns: the currently used mac algorithm.
**/
gnutls_mac_algorithm_t
enum MHD_GNUTLS_HashAlgorithm
gnutls_mac_get (mhd_gtls_session_t session)
{
return session->security_parameters.read_mac_algorithm;
@@ -107,7 +107,7 @@ gnutls_mac_get (mhd_gtls_session_t session)
*
* Returns: the currently used compression method.
**/
gnutls_compression_method_t
enum MHD_GNUTLS_CompressionMethod
gnutls_compression_get (mhd_gtls_session_t session)
{
return session->security_parameters.read_compression_algorithm;
@@ -119,7 +119,7 @@ gnutls_compression_get (mhd_gtls_session_t session)
*/
int
mhd_gtls_session_cert_type_supported (mhd_gtls_session_t session,
gnutls_certificate_type_t cert_type)
enum MHD_GNUTLS_CertificateType cert_type)
{
unsigned i;
unsigned cert_found = 0;
@@ -656,7 +656,7 @@ MHD_gtls_handshake_set_private_extensions (mhd_gtls_session_t session, int allow
}
inline static int
_gnutls_cal_PRF_A (gnutls_mac_algorithm_t algorithm,
_gnutls_cal_PRF_A (enum MHD_GNUTLS_HashAlgorithm algorithm,
const void *secret,
int secret_size,
const void *seed, int seed_size, void *result)
@@ -682,7 +682,7 @@ _gnutls_cal_PRF_A (gnutls_mac_algorithm_t algorithm,
* (used in the PRF function)
*/
static int
_gnutls_P_hash (gnutls_mac_algorithm_t algorithm,
_gnutls_P_hash (enum MHD_GNUTLS_HashAlgorithm algorithm,
const opaque * secret,
int secret_size,
const opaque * seed,
@@ -789,7 +789,7 @@ mhd_gtls_PRF (mhd_gtls_session_t session,
opaque s_seed[MAX_SEED_SIZE];
opaque o1[MAX_PRF_BYTES], o2[MAX_PRF_BYTES];
int result;
gnutls_protocol_t ver = MHD_gnutls_protocol_get_version (session);
enum MHD_GNUTLS_Protocol ver = MHD_gnutls_protocol_get_version (session);
if (total_bytes > MAX_PRF_BYTES)
{
@@ -1069,7 +1069,7 @@ MHD_gtls_session_is_resumed (mhd_gtls_session_t session)
int
mhd_gtls_session_is_export (mhd_gtls_session_t session)
{
gnutls_cipher_algorithm_t cipher;
enum MHD_GNUTLS_CipherAlgorithm cipher;
cipher =
mhd_gtls_cipher_suite_get_cipher_algo (&session->security_parameters.
+5 -5
View File
@@ -28,10 +28,10 @@
#include <gnutls_int.h>
void _gnutls_session_cert_type_set (mhd_gtls_session_t session,
gnutls_certificate_type_t);
gnutls_kx_algorithm_t gnutls_kx_get (mhd_gtls_session_t session);
gnutls_cipher_algorithm_t gnutls_cipher_get (mhd_gtls_session_t session);
gnutls_certificate_type_t gnutls_certificate_type_get (mhd_gtls_session_t);
enum MHD_GNUTLS_CertificateType);
enum MHD_GNUTLS_KeyExchangeAlgorithm gnutls_kx_get (mhd_gtls_session_t session);
enum MHD_GNUTLS_CipherAlgorithm gnutls_cipher_get (mhd_gtls_session_t session);
enum MHD_GNUTLS_CertificateType gnutls_certificate_type_get (mhd_gtls_session_t);
#include <gnutls_auth_int.h>
@@ -43,7 +43,7 @@ gnutls_certificate_type_t gnutls_certificate_type_get (mhd_gtls_session_t);
#endif
int mhd_gtls_session_cert_type_supported (mhd_gtls_session_t,
gnutls_certificate_type_t);
enum MHD_GNUTLS_CertificateType);
int mhd_gtls_dh_set_secret_bits (mhd_gtls_session_t session, unsigned bits);
+1 -1
View File
@@ -489,7 +489,7 @@ MHD_gtls_certificate_client_get_request_status (mhd_gtls_session_t session)
*
**/
int
MHD_gnutls_fingerprint (gnutls_digest_algorithm_t algo,
MHD_gnutls_fingerprint (enum MHD_GNUTLS_HashAlgorithm algo,
const gnutls_datum_t * data,
void *result, size_t * result_size)
{
+2 -2
View File
@@ -951,11 +951,11 @@ generate_rdn_seq (mhd_gtls_cert_credentials_t res)
return 0;
}
/* Returns 0 if it's ok to use the gnutls_kx_algorithm_t with this
/* Returns 0 if it's ok to use the enum MHD_GNUTLS_KeyExchangeAlgorithm with this
* certificate (uses the KeyUsage field).
*/
int
_gnutls_check_key_usage (const gnutls_cert * cert, gnutls_kx_algorithm_t alg)
_gnutls_check_key_usage (const gnutls_cert * cert, enum MHD_GNUTLS_KeyExchangeAlgorithm alg)
{
unsigned int key_usage = 0;
int encipher_type;
+1 -1
View File
@@ -37,7 +37,7 @@ int _gnutls_x509_cert_verify_peers (mhd_gtls_session_t session,
#define PEM_KEY_DSA_SEP "-----BEGIN DSA"
int _gnutls_check_key_usage (const gnutls_cert * cert,
gnutls_kx_algorithm_t alg);
enum MHD_GNUTLS_KeyExchangeAlgorithm alg);
int _gnutls_x509_read_rsa_params (opaque * der, int dersize, mpi_t * params);
int _gnutls_x509_read_dsa_pubkey (opaque * der, int dersize, mpi_t * params);