2 * Copyright (C) 2000 Nikos Mavroyanopoulos
4 * This file is part of GNUTLS.
6 * GNUTLS is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * GNUTLS is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
21 #include "gnutls_auth.h"
23 /* functions for version */
25 GNUTLS_Version
_gnutls_version_lowest( GNUTLS_STATE state
);
26 GNUTLS_Version
_gnutls_version_max( GNUTLS_STATE state
);
27 int _gnutls_version_priority(GNUTLS_STATE state
, GNUTLS_Version version
);
28 int _gnutls_version_is_supported(GNUTLS_STATE state
, const GNUTLS_Version version
);
29 int _gnutls_version_get_major( GNUTLS_Version ver
);
30 int _gnutls_version_get_minor( GNUTLS_Version ver
);
31 GNUTLS_Version
_gnutls_version_get( int major
, int minor
);
33 /* functions for macs */
34 int _gnutls_mac_get_digest_size(MACAlgorithm algorithm
);
35 const char* gnutls_mac_get_name(MACAlgorithm algorithm
);
36 int _gnutls_mac_is_ok(MACAlgorithm algorithm
);
37 int _gnutls_mac_priority(GNUTLS_STATE state
, MACAlgorithm algorithm
);
39 /* functions for cipher suites */
40 int _gnutls_supported_ciphersuites(GNUTLS_STATE state
, GNUTLS_CipherSuite
**ciphers
);
41 int _gnutls_supported_ciphersuites_sorted(GNUTLS_STATE state
, GNUTLS_CipherSuite
**ciphers
);
42 int _gnutls_supported_compression_methods(GNUTLS_STATE state
, uint8
**comp
);
44 const char* _gnutls_cipher_suite_get_name(GNUTLS_CipherSuite algorithm
);
45 BulkCipherAlgorithm
_gnutls_cipher_suite_get_cipher_algo(const GNUTLS_CipherSuite algorithm
);
46 KXAlgorithm
_gnutls_cipher_suite_get_kx_algo(const GNUTLS_CipherSuite algorithm
);
47 MACAlgorithm
_gnutls_cipher_suite_get_mac_algo(const GNUTLS_CipherSuite algorithm
);
48 GNUTLS_Version
_gnutls_cipher_suite_get_version(const GNUTLS_CipherSuite algorithm
);
49 GNUTLS_CipherSuite
_gnutls_cipher_suite_get_suite_name(GNUTLS_CipherSuite algorithm
);
51 /* functions for ciphers */
52 int _gnutls_cipher_priority(GNUTLS_STATE state
, BulkCipherAlgorithm algorithm
);
53 int _gnutls_cipher_get_block_size(BulkCipherAlgorithm algorithm
);
54 int _gnutls_cipher_is_block(BulkCipherAlgorithm algorithm
);
55 int _gnutls_cipher_is_ok(BulkCipherAlgorithm algorithm
);
56 int _gnutls_cipher_get_key_size(BulkCipherAlgorithm algorithm
);
57 int _gnutls_cipher_get_iv_size(BulkCipherAlgorithm algorithm
);
58 const char *gnutls_cipher_get_name(BulkCipherAlgorithm algorithm
);
60 /* functions for key exchange */
61 int _gnutls_kx_priority(GNUTLS_STATE state
, KXAlgorithm algorithm
);
63 MOD_AUTH_STRUCT
* _gnutls_kx_auth_struct(KXAlgorithm algorithm
);
64 const char *gnutls_kx_get_name(KXAlgorithm algorithm
);
65 int _gnutls_kx_is_ok(KXAlgorithm algorithm
);
67 /* functions for compression */
68 int _gnutls_compression_priority(GNUTLS_STATE state
, CompressionMethod algorithm
);
69 int _gnutls_compression_is_ok(CompressionMethod algorithm
);
70 int _gnutls_compression_get_num(CompressionMethod algorithm
);
71 CompressionMethod
_gnutls_compression_get_id(int num
);
72 const char *gnutls_compression_get_name(CompressionMethod algorithm
);
74 /* Type to KX mappings */
75 KXAlgorithm
_gnutls_map_kx_get_kx(CredType type
);
76 CredType
_gnutls_map_kx_get_cred(KXAlgorithm algorithm
);
78 struct gnutls_kx_algo_entry
{
80 KXAlgorithm algorithm
;
81 MOD_AUTH_STRUCT
*auth_struct
;
83 typedef struct gnutls_kx_algo_entry gnutls_kx_algo_entry
;