Back to index

lightning-sunbird  0.9+nobinonly
sslt.h
Go to the documentation of this file.
00001 /*
00002  * This file contains prototypes for the public SSL functions.
00003  *
00004  * ***** BEGIN LICENSE BLOCK *****
00005  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00006  *
00007  * The contents of this file are subject to the Mozilla Public License Version
00008  * 1.1 (the "License"); you may not use this file except in compliance with
00009  * the License. You may obtain a copy of the License at
00010  * http://www.mozilla.org/MPL/
00011  *
00012  * Software distributed under the License is distributed on an "AS IS" basis,
00013  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00014  * for the specific language governing rights and limitations under the
00015  * License.
00016  *
00017  * The Original Code is the Netscape security libraries.
00018  *
00019  * The Initial Developer of the Original Code is
00020  * Netscape Communications Corporation.
00021  * Portions created by the Initial Developer are Copyright (C) 1994-2000
00022  * the Initial Developer. All Rights Reserved.
00023  *
00024  * Contributor(s):
00025  *   Dr Vipul Gupta <vipul.gupta@sun.com>, Sun Microsystems Laboratories
00026  *
00027  * Alternatively, the contents of this file may be used under the terms of
00028  * either the GNU General Public License Version 2 or later (the "GPL"), or
00029  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00030  * in which case the provisions of the GPL or the LGPL are applicable instead
00031  * of those above. If you wish to allow use of your version of this file only
00032  * under the terms of either the GPL or the LGPL, and not to allow others to
00033  * use your version of this file under the terms of the MPL, indicate your
00034  * decision by deleting the provisions above and replace them with the notice
00035  * and other provisions required by the GPL or the LGPL. If you do not delete
00036  * the provisions above, a recipient may use your version of this file under
00037  * the terms of any one of the MPL, the GPL or the LGPL.
00038  *
00039  * ***** END LICENSE BLOCK ***** */
00040 /* $Id: sslt.h,v 1.9 2005/08/16 03:42:26 nelsonb%netscape.com Exp $ */
00041 
00042 #ifndef __sslt_h_
00043 #define __sslt_h_
00044 
00045 #include "prtypes.h"
00046 
00047 typedef struct SSL3StatisticsStr {
00048     /* statistics from ssl3_SendClientHello (sch) */
00049     long sch_sid_cache_hits;
00050     long sch_sid_cache_misses;
00051     long sch_sid_cache_not_ok;
00052 
00053     /* statistics from ssl3_HandleServerHello (hsh) */
00054     long hsh_sid_cache_hits;
00055     long hsh_sid_cache_misses;
00056     long hsh_sid_cache_not_ok;
00057 
00058     /* statistics from ssl3_HandleClientHello (hch) */
00059     long hch_sid_cache_hits;
00060     long hch_sid_cache_misses;
00061     long hch_sid_cache_not_ok;
00062 } SSL3Statistics;
00063 
00064 /* Key Exchange algorithm values */
00065 typedef enum {
00066     ssl_kea_null     = 0,
00067     ssl_kea_rsa      = 1,
00068     ssl_kea_dh       = 2,
00069     ssl_kea_fortezza = 3,       /* deprecated, now unused */
00070     ssl_kea_ecdh     = 4,
00071     ssl_kea_size            /* number of ssl_kea_ algorithms */
00072 } SSLKEAType;
00073 
00074 /* The following defines are for backwards compatibility.
00075 ** They will be removed in a forthcoming release to reduce namespace pollution.
00076 ** programs that use the kt_ symbols should convert to the ssl_kt_ symbols
00077 ** soon.
00078 */
00079 #define kt_null      ssl_kea_null
00080 #define kt_rsa       ssl_kea_rsa
00081 #define kt_dh        ssl_kea_dh
00082 #define kt_fortezza  ssl_kea_fortezza       /* deprecated, now unused */
00083 #define kt_ecdh      ssl_kea_ecdh
00084 #define kt_kea_size  ssl_kea_size
00085 
00086 typedef enum {
00087     ssl_sign_null   = 0, 
00088     ssl_sign_rsa    = 1,
00089     ssl_sign_dsa    = 2,
00090     ssl_sign_ecdsa  = 3
00091 } SSLSignType;
00092 
00093 typedef enum {
00094     ssl_auth_null   = 0, 
00095     ssl_auth_rsa    = 1,
00096     ssl_auth_dsa    = 2,
00097     ssl_auth_kea    = 3,
00098     ssl_auth_ecdsa  = 4
00099 } SSLAuthType;
00100 
00101 typedef enum {
00102     ssl_calg_null     = 0,
00103     ssl_calg_rc4      = 1,
00104     ssl_calg_rc2      = 2,
00105     ssl_calg_des      = 3,
00106     ssl_calg_3des     = 4,
00107     ssl_calg_idea     = 5,
00108     ssl_calg_fortezza = 6,      /* deprecated, now unused */
00109     ssl_calg_aes      = 7       /* coming soon */
00110 } SSLCipherAlgorithm;
00111 
00112 typedef enum { 
00113     ssl_mac_null      = 0, 
00114     ssl_mac_md5       = 1, 
00115     ssl_mac_sha       = 2, 
00116     ssl_hmac_md5      = 3,  /* TLS HMAC version of mac_md5 */
00117     ssl_hmac_sha      = 4   /* TLS HMAC version of mac_sha */
00118 } SSLMACAlgorithm;
00119 
00120 typedef struct SSLChannelInfoStr {
00121     PRUint32             length;
00122     PRUint16             protocolVersion;
00123     PRUint16             cipherSuite;
00124 
00125     /* server authentication info */
00126     PRUint32             authKeyBits;
00127 
00128     /* key exchange algorithm info */
00129     PRUint32             keaKeyBits;
00130 
00131     /* session info */
00132     PRUint32             creationTime;           /* seconds since Jan 1, 1970 */
00133     PRUint32             lastAccessTime;  /* seconds since Jan 1, 1970 */
00134     PRUint32             expirationTime;  /* seconds since Jan 1, 1970 */
00135     PRUint32             sessionIDLength; /* up to 32 */
00136     PRUint8              sessionID    [32];
00137 } SSLChannelInfo;
00138 
00139 typedef struct SSLCipherSuiteInfoStr {
00140     PRUint16             length;
00141     PRUint16             cipherSuite;
00142 
00143     /* Cipher Suite Name */
00144     const char *         cipherSuiteName;
00145 
00146     /* server authentication info */
00147     const char *         authAlgorithmName;
00148     SSLAuthType          authAlgorithm;
00149 
00150     /* key exchange algorithm info */
00151     const char *         keaTypeName;
00152     SSLKEAType           keaType;
00153 
00154     /* symmetric encryption info */
00155     const char *         symCipherName;
00156     SSLCipherAlgorithm   symCipher;
00157     PRUint16             symKeyBits;
00158     PRUint16             symKeySpace;
00159     PRUint16             effectiveKeyBits;
00160 
00161     /* MAC info */
00162     const char *         macAlgorithmName;
00163     SSLMACAlgorithm      macAlgorithm;
00164     PRUint16             macBits;
00165 
00166     PRUintn              isFIPS       : 1;
00167     PRUintn              isExportable : 1;
00168     PRUintn              nonStandard  : 1;
00169     PRUintn              reservedBits :29;
00170 
00171 } SSLCipherSuiteInfo;
00172 
00173 #endif /* __sslt_h_ */