PageRenderTime 333ms CodeModel.GetById 110ms app.highlight 10ms RepoModel.GetById 136ms app.codeStats 0ms

/gecko_api/include/sslt.h

http://firefox-mac-pdf.googlecode.com/
C++ Header | 180 lines | 97 code | 25 blank | 58 comment | 0 complexity | 74b67d2dd1e767d2bebb0d60474645a2 MD5 | raw file
  1/*
  2 * This file contains prototypes for the public SSL functions.
  3 *
  4 * ***** BEGIN LICENSE BLOCK *****
  5 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  6 *
  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/
 11 *
 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.
 16 *
 17 * The Original Code is the Netscape security libraries.
 18 *
 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.
 23 *
 24 * Contributor(s):
 25 *   Dr Vipul Gupta <vipul.gupta@sun.com>, Sun Microsystems Laboratories
 26 *
 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.
 38 *
 39 * ***** END LICENSE BLOCK ***** */
 40/* $Id: sslt.h,v 1.11 2008/03/06 20:16:22 wtc%google.com Exp $ */
 41
 42#ifndef __sslt_h_
 43#define __sslt_h_
 44
 45#include "prtypes.h"
 46
 47typedef 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;
 52
 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;
 57
 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
 63    /* statistics related to stateless resume */
 64    long sch_sid_stateless_resumes;
 65    long hsh_sid_stateless_resumes;
 66    long hch_sid_stateless_resumes;
 67    long hch_sid_ticket_parse_failures;
 68} SSL3Statistics;
 69
 70/* Key Exchange algorithm values */
 71typedef enum {
 72    ssl_kea_null     = 0,
 73    ssl_kea_rsa      = 1,
 74    ssl_kea_dh       = 2,
 75    ssl_kea_fortezza = 3,       /* deprecated, now unused */
 76    ssl_kea_ecdh     = 4,
 77    ssl_kea_size		/* number of ssl_kea_ algorithms */
 78} SSLKEAType;
 79
 80/* The following defines are for backwards compatibility.
 81** They will be removed in a forthcoming release to reduce namespace pollution.
 82** programs that use the kt_ symbols should convert to the ssl_kt_ symbols
 83** soon.
 84*/
 85#define kt_null   	ssl_kea_null
 86#define kt_rsa   	ssl_kea_rsa
 87#define kt_dh   	ssl_kea_dh
 88#define kt_fortezza	ssl_kea_fortezza       /* deprecated, now unused */
 89#define kt_ecdh   	ssl_kea_ecdh
 90#define kt_kea_size	ssl_kea_size
 91
 92typedef enum {
 93    ssl_sign_null   = 0, 
 94    ssl_sign_rsa    = 1,
 95    ssl_sign_dsa    = 2,
 96    ssl_sign_ecdsa  = 3
 97} SSLSignType;
 98
 99typedef enum {
100    ssl_auth_null   = 0, 
101    ssl_auth_rsa    = 1,
102    ssl_auth_dsa    = 2,
103    ssl_auth_kea    = 3,
104    ssl_auth_ecdsa  = 4
105} SSLAuthType;
106
107typedef enum {
108    ssl_calg_null     = 0,
109    ssl_calg_rc4      = 1,
110    ssl_calg_rc2      = 2,
111    ssl_calg_des      = 3,
112    ssl_calg_3des     = 4,
113    ssl_calg_idea     = 5,
114    ssl_calg_fortezza = 6,      /* deprecated, now unused */
115    ssl_calg_aes      = 7,      /* coming soon */
116    ssl_calg_camellia = 8
117} SSLCipherAlgorithm;
118
119typedef enum { 
120    ssl_mac_null      = 0, 
121    ssl_mac_md5       = 1, 
122    ssl_mac_sha       = 2, 
123    ssl_hmac_md5      = 3, 	/* TLS HMAC version of mac_md5 */
124    ssl_hmac_sha      = 4 	/* TLS HMAC version of mac_sha */
125} SSLMACAlgorithm;
126
127typedef struct SSLChannelInfoStr {
128    PRUint32             length;
129    PRUint16             protocolVersion;
130    PRUint16             cipherSuite;
131
132    /* server authentication info */
133    PRUint32             authKeyBits;
134
135    /* key exchange algorithm info */
136    PRUint32             keaKeyBits;
137
138    /* session info */
139    PRUint32             creationTime;		/* seconds since Jan 1, 1970 */
140    PRUint32             lastAccessTime;	/* seconds since Jan 1, 1970 */
141    PRUint32             expirationTime;	/* seconds since Jan 1, 1970 */
142    PRUint32             sessionIDLength;	/* up to 32 */
143    PRUint8              sessionID    [32];
144} SSLChannelInfo;
145
146typedef struct SSLCipherSuiteInfoStr {
147    PRUint16             length;
148    PRUint16             cipherSuite;
149
150    /* Cipher Suite Name */
151    const char *         cipherSuiteName;
152
153    /* server authentication info */
154    const char *         authAlgorithmName;
155    SSLAuthType          authAlgorithm;
156
157    /* key exchange algorithm info */
158    const char *         keaTypeName;
159    SSLKEAType           keaType;
160
161    /* symmetric encryption info */
162    const char *         symCipherName;
163    SSLCipherAlgorithm   symCipher;
164    PRUint16             symKeyBits;
165    PRUint16             symKeySpace;
166    PRUint16             effectiveKeyBits;
167
168    /* MAC info */
169    const char *         macAlgorithmName;
170    SSLMACAlgorithm      macAlgorithm;
171    PRUint16             macBits;
172
173    PRUintn              isFIPS       : 1;
174    PRUintn              isExportable : 1;
175    PRUintn              nonStandard  : 1;
176    PRUintn              reservedBits :29;
177
178} SSLCipherSuiteInfo;
179
180#endif /* __sslt_h_ */