Import from 1.9a8 tarball
[mozilla-nss.git] / security / nss / lib / ssl / sslt.h
bloba4e5e370556207717be729ec7b3c6b3a232748b5
1 /*
2 * This file contains prototypes for the public SSL functions.
4 * ***** BEGIN LICENSE BLOCK *****
5 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
7 * The contents of this file are subject to the Mozilla Public License Version
8 * 1.1 (the "License"); you may not use this file except in compliance with
9 * the License. You may obtain a copy of the License at
10 * http://www.mozilla.org/MPL/
12 * Software distributed under the License is distributed on an "AS IS" basis,
13 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
14 * for the specific language governing rights and limitations under the
15 * License.
17 * The Original Code is the Netscape security libraries.
19 * The Initial Developer of the Original Code is
20 * Netscape Communications Corporation.
21 * Portions created by the Initial Developer are Copyright (C) 1994-2000
22 * the Initial Developer. All Rights Reserved.
24 * Contributor(s):
25 * Dr Vipul Gupta <vipul.gupta@sun.com>, Sun Microsystems Laboratories
27 * Alternatively, the contents of this file may be used under the terms of
28 * either the GNU General Public License Version 2 or later (the "GPL"), or
29 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
30 * in which case the provisions of the GPL or the LGPL are applicable instead
31 * of those above. If you wish to allow use of your version of this file only
32 * under the terms of either the GPL or the LGPL, and not to allow others to
33 * use your version of this file under the terms of the MPL, indicate your
34 * decision by deleting the provisions above and replace them with the notice
35 * and other provisions required by the GPL or the LGPL. If you do not delete
36 * the provisions above, a recipient may use your version of this file under
37 * the terms of any one of the MPL, the GPL or the LGPL.
39 * ***** END LICENSE BLOCK ***** */
40 /* $Id: sslt.h,v 1.10 2007/02/28 19:47:38 rrelyea%redhat.com Exp $ */
42 #ifndef __sslt_h_
43 #define __sslt_h_
45 #include "prtypes.h"
47 typedef struct SSL3StatisticsStr {
48 /* statistics from ssl3_SendClientHello (sch) */
49 long sch_sid_cache_hits;
50 long sch_sid_cache_misses;
51 long sch_sid_cache_not_ok;
53 /* statistics from ssl3_HandleServerHello (hsh) */
54 long hsh_sid_cache_hits;
55 long hsh_sid_cache_misses;
56 long hsh_sid_cache_not_ok;
58 /* statistics from ssl3_HandleClientHello (hch) */
59 long hch_sid_cache_hits;
60 long hch_sid_cache_misses;
61 long hch_sid_cache_not_ok;
62 } SSL3Statistics;
64 /* Key Exchange algorithm values */
65 typedef enum {
66 ssl_kea_null = 0,
67 ssl_kea_rsa = 1,
68 ssl_kea_dh = 2,
69 ssl_kea_fortezza = 3, /* deprecated, now unused */
70 ssl_kea_ecdh = 4,
71 ssl_kea_size /* number of ssl_kea_ algorithms */
72 } SSLKEAType;
74 /* The following defines are for backwards compatibility.
75 ** They will be removed in a forthcoming release to reduce namespace pollution.
76 ** programs that use the kt_ symbols should convert to the ssl_kt_ symbols
77 ** soon.
79 #define kt_null ssl_kea_null
80 #define kt_rsa ssl_kea_rsa
81 #define kt_dh ssl_kea_dh
82 #define kt_fortezza ssl_kea_fortezza /* deprecated, now unused */
83 #define kt_ecdh ssl_kea_ecdh
84 #define kt_kea_size ssl_kea_size
86 typedef enum {
87 ssl_sign_null = 0,
88 ssl_sign_rsa = 1,
89 ssl_sign_dsa = 2,
90 ssl_sign_ecdsa = 3
91 } SSLSignType;
93 typedef enum {
94 ssl_auth_null = 0,
95 ssl_auth_rsa = 1,
96 ssl_auth_dsa = 2,
97 ssl_auth_kea = 3,
98 ssl_auth_ecdsa = 4
99 } SSLAuthType;
101 typedef enum {
102 ssl_calg_null = 0,
103 ssl_calg_rc4 = 1,
104 ssl_calg_rc2 = 2,
105 ssl_calg_des = 3,
106 ssl_calg_3des = 4,
107 ssl_calg_idea = 5,
108 ssl_calg_fortezza = 6, /* deprecated, now unused */
109 ssl_calg_aes = 7, /* coming soon */
110 ssl_calg_camellia = 8
111 } SSLCipherAlgorithm;
113 typedef enum {
114 ssl_mac_null = 0,
115 ssl_mac_md5 = 1,
116 ssl_mac_sha = 2,
117 ssl_hmac_md5 = 3, /* TLS HMAC version of mac_md5 */
118 ssl_hmac_sha = 4 /* TLS HMAC version of mac_sha */
119 } SSLMACAlgorithm;
121 typedef struct SSLChannelInfoStr {
122 PRUint32 length;
123 PRUint16 protocolVersion;
124 PRUint16 cipherSuite;
126 /* server authentication info */
127 PRUint32 authKeyBits;
129 /* key exchange algorithm info */
130 PRUint32 keaKeyBits;
132 /* session info */
133 PRUint32 creationTime; /* seconds since Jan 1, 1970 */
134 PRUint32 lastAccessTime; /* seconds since Jan 1, 1970 */
135 PRUint32 expirationTime; /* seconds since Jan 1, 1970 */
136 PRUint32 sessionIDLength; /* up to 32 */
137 PRUint8 sessionID [32];
138 } SSLChannelInfo;
140 typedef struct SSLCipherSuiteInfoStr {
141 PRUint16 length;
142 PRUint16 cipherSuite;
144 /* Cipher Suite Name */
145 const char * cipherSuiteName;
147 /* server authentication info */
148 const char * authAlgorithmName;
149 SSLAuthType authAlgorithm;
151 /* key exchange algorithm info */
152 const char * keaTypeName;
153 SSLKEAType keaType;
155 /* symmetric encryption info */
156 const char * symCipherName;
157 SSLCipherAlgorithm symCipher;
158 PRUint16 symKeyBits;
159 PRUint16 symKeySpace;
160 PRUint16 effectiveKeyBits;
162 /* MAC info */
163 const char * macAlgorithmName;
164 SSLMACAlgorithm macAlgorithm;
165 PRUint16 macBits;
167 PRUintn isFIPS : 1;
168 PRUintn isExportable : 1;
169 PRUintn nonStandard : 1;
170 PRUintn reservedBits :29;
172 } SSLCipherSuiteInfo;
174 #endif /* __sslt_h_ */