gnutls_algorithms.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation
00003  *
00004  * Author: Nikos Mavrogiannopoulos
00005  *
00006  * This file is part of GNUTLS.
00007  *
00008  * The GNUTLS library is free software; you can redistribute it and/or
00009  * modify it under the terms of the GNU Lesser General Public License
00010  * as published by the Free Software Foundation; either version 2.1 of
00011  * the License, or (at your option) any later version.
00012  *
00013  * This library is distributed in the hope that it will be useful, but
00014  * WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016  * Lesser General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU Lesser General Public
00019  * License along with this library; if not, write to the Free Software
00020  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
00021  * USA
00022  *
00023  */
00024 
00025 #ifndef ALGORITHMS_H
00026 #define ALGORITHMS_H
00027 
00028 #include "gnutls_auth.h"
00029 
00030 /* Functions for version handling. */
00031 enum MHD_GNUTLS_Protocol MHD_gtls_version_max (MHD_gtls_session_t session);
00032 int MHD_gtls_version_priority (MHD_gtls_session_t session,
00033                                enum MHD_GNUTLS_Protocol version);
00034 int MHD_gtls_version_is_supported (MHD_gtls_session_t session,
00035                                    const enum MHD_GNUTLS_Protocol version);
00036 int MHD_gtls_version_get_major (enum MHD_GNUTLS_Protocol ver);
00037 int MHD_gtls_version_get_minor (enum MHD_GNUTLS_Protocol ver);
00038 enum MHD_GNUTLS_Protocol MHD_gtls_version_get (int major, int minor);
00039 
00040 /* Functions for MACs. */
00041 int MHD_gnutls_mac_is_ok (enum MHD_GNUTLS_HashAlgorithm algorithm);
00042 /* Functions for cipher suites. */
00043 int MHD_gtls_supported_ciphersuites (MHD_gtls_session_t session,
00044                                      cipher_suite_st ** ciphers);
00045 int MHD_gtls_supported_ciphersuites_sorted (MHD_gtls_session_t session,
00046                                             cipher_suite_st ** ciphers);
00047 int MHD_gtls_supported_compression_methods (MHD_gtls_session_t session,
00048                                             uint8_t ** comp);
00049 const char *MHD_gtls_cipher_suite_get_name (cipher_suite_st * algorithm);
00050 enum MHD_GNUTLS_CipherAlgorithm MHD_gtls_cipher_suite_get_cipher_algo (const
00051                                                                        cipher_suite_st
00052                                                                        *
00053                                                                        algorithm);
00054 enum MHD_GNUTLS_KeyExchangeAlgorithm MHD_gtls_cipher_suite_get_kx_algo (const
00055                                                                         cipher_suite_st
00056                                                                         *
00057                                                                         algorithm);
00058 enum MHD_GNUTLS_HashAlgorithm MHD_gtls_cipher_suite_get_mac_algo (const
00059                                                                   cipher_suite_st
00060                                                                   *
00061                                                                   algorithm);
00062 enum MHD_GNUTLS_Protocol MHD_gtls_cipher_suite_get_version (const
00063                                                             cipher_suite_st *
00064                                                             algorithm);
00065 cipher_suite_st MHD_gtls_cipher_suite_get_suite_name (cipher_suite_st *
00066                                                       algorithm);
00067 
00068 /* Functions for ciphers. */
00069 int MHD_gtls_cipher_get_block_size (enum MHD_GNUTLS_CipherAlgorithm
00070                                     algorithm);
00071 int MHD_gtls_cipher_is_block (enum MHD_GNUTLS_CipherAlgorithm algorithm);
00072 int MHD_gtls_cipher_is_ok (enum MHD_GNUTLS_CipherAlgorithm algorithm);
00073 int MHD_gtls_cipher_get_iv_size (enum MHD_GNUTLS_CipherAlgorithm algorithm);
00074 int MHD_gtls_cipher_get_export_flag (enum MHD_GNUTLS_CipherAlgorithm
00075                                      algorithm);
00076 
00077 /* Functions for key exchange. */
00078 int MHD_gtls_kx_needs_dh_params (enum MHD_GNUTLS_KeyExchangeAlgorithm
00079                                  algorithm);
00080 int MHD_gtls_kx_needs_rsa_params (enum MHD_GNUTLS_KeyExchangeAlgorithm
00081                                   algorithm);
00082 MHD_gtls_mod_auth_st *MHD_gtls_kx_auth_struct (enum
00083                                                MHD_GNUTLS_KeyExchangeAlgorithm
00084                                                algorithm);
00085 int MHD_gtls_kx_is_ok (enum MHD_GNUTLS_KeyExchangeAlgorithm algorithm);
00086 
00087 /* Functions for compression. */
00088 int MHD_gtls_compression_is_ok (enum MHD_GNUTLS_CompressionMethod algorithm);
00089 int MHD_gtls_compression_get_num (enum MHD_GNUTLS_CompressionMethod
00090                                   algorithm);
00091 enum MHD_GNUTLS_CompressionMethod MHD_gtls_compression_get_id_from_int (int
00092                                                                         num);
00093 int MHD_gtls_compression_get_mem_level (enum MHD_GNUTLS_CompressionMethod
00094                                         algorithm);
00095 int MHD_gtls_compression_get_comp_level (enum MHD_GNUTLS_CompressionMethod
00096                                          algorithm);
00097 int MHD_gtls_compression_get_wbits (enum MHD_GNUTLS_CompressionMethod
00098                                     algorithm);
00099 
00100 /* Type to KX mappings. */
00101 enum MHD_GNUTLS_CredentialsType MHD_gtls_map_kx_get_cred (enum
00102                                                           MHD_GNUTLS_KeyExchangeAlgorithm
00103                                                           algorithm,
00104                                                           int server);
00105 
00106 /* KX to PK mapping. */
00107 enum MHD_GNUTLS_PublicKeyAlgorithm MHD_gtls_map_pk_get_pk (enum
00108                                                            MHD_GNUTLS_KeyExchangeAlgorithm
00109                                                            kx_algorithm);
00110 enum MHD_GNUTLS_PublicKeyAlgorithm MHD_gtls_x509_oid2pk_algorithm (const char
00111                                                                    *oid);
00112 enum encipher_type
00113 { CIPHER_ENCRYPT = 0, CIPHER_SIGN = 1, CIPHER_IGN };
00114 
00115 enum encipher_type MHD_gtls_kx_encipher_type (enum
00116                                               MHD_GNUTLS_KeyExchangeAlgorithm
00117                                               algorithm);
00118 
00119 struct MHD_gtls_compression_entry
00120 {
00121   const char *name;
00122   enum MHD_GNUTLS_CompressionMethod id;
00123   int num;                      /* the number reserved in TLS for the specific compression method */
00124 
00125   /* used in zlib compressor */
00126   int window_bits;
00127   int mem_level;
00128   int comp_level;
00129 };
00130 typedef struct MHD_gtls_compression_entry MHD_gnutls_compression_entry;
00131 
00132 /* Functions for sign algorithms. */
00133 
00134 int MHD_gtls_mac_priority (MHD_gtls_session_t session,
00135                            enum MHD_GNUTLS_HashAlgorithm algorithm);
00136 int MHD_gtls_cipher_priority (MHD_gtls_session_t session,
00137                               enum MHD_GNUTLS_CipherAlgorithm algorithm);
00138 int MHD_gtls_kx_priority (MHD_gtls_session_t session,
00139                           enum MHD_GNUTLS_KeyExchangeAlgorithm algorithm);
00140 
00141 enum MHD_GNUTLS_HashAlgorithm MHD_gtls_mac_get_id (const char *name);
00142 enum MHD_GNUTLS_CipherAlgorithm MHD_gtls_cipher_get_id (const char *name);
00143 enum MHD_GNUTLS_KeyExchangeAlgorithm MHD_gtls_kx_get_id (const char *name);
00144 enum MHD_GNUTLS_Protocol MHD_gtls_protocol_get_id (const char *name);
00145 enum MHD_GNUTLS_CertificateType MHD_gtls_certificate_type_get_id (const char
00146                                                                   *name);
00147 
00148 #endif

Generated on Fri Feb 27 18:31:58 2009 for GNU libmicrohttpd by  doxygen 1.5.7.1