Back to index

lightning-sunbird  0.9+nobinonly
sslt.h
Go to the documentation of this file.
00001 /* ***** BEGIN LICENSE BLOCK *****
00002  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00003  *
00004  * The contents of this file are subject to the Mozilla Public License Version
00005  * 1.1 (the "License"); you may not use this file except in compliance with
00006  * the License. You may obtain a copy of the License at
00007  * http://www.mozilla.org/MPL/
00008  *
00009  * Software distributed under the License is distributed on an "AS IS" basis,
00010  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00011  * for the specific language governing rights and limitations under the
00012  * License.
00013  *
00014  * The Original Code is the Netscape security libraries.
00015  *
00016  * The Initial Developer of the Original Code is
00017  * Netscape Communications Corporation.
00018  * Portions created by the Initial Developer are Copyright (C) 1994-2000
00019  * the Initial Developer. All Rights Reserved.
00020  *
00021  * Contributor(s):
00022  *
00023  * Alternatively, the contents of this file may be used under the terms of
00024  * either the GNU General Public License Version 2 or later (the "GPL"), or
00025  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00026  * in which case the provisions of the GPL or the LGPL are applicable instead
00027  * of those above. If you wish to allow use of your version of this file only
00028  * under the terms of either the GPL or the LGPL, and not to allow others to
00029  * use your version of this file under the terms of the MPL, indicate your
00030  * decision by deleting the provisions above and replace them with the notice
00031  * and other provisions required by the GPL or the LGPL. If you do not delete
00032  * the provisions above, a recipient may use your version of this file under
00033  * the terms of any one of the MPL, the GPL or the LGPL.
00034  *
00035  * ***** END LICENSE BLOCK ***** */
00036 #ifndef SSLT_H
00037 #define SSLT_H
00038 
00039 
00040 extern int Error(int);
00041 #ifndef DEBUG_stevep
00042 #define dbmsg(x) if (debug) PR_fprintf x ;
00043 #else
00044 #define dbmsg(x) ;
00045 #endif
00046 extern PRInt32 debug;
00047 
00048 #ifdef INSERT_TABLES
00049 int testId = 0;
00050 
00051 int ClientCert[] = {
00052        NO_CERT,
00053        CLIENT_CERT_HARDCOREII_1024
00054 };
00055 
00056 int ServerCert[] = {
00057        SERVER_CERT_HARDCOREII_512
00058 };
00059 
00060 int Policy[] = {
00061        POLICY_EXPORT,
00062        POLICY_DOMESTIC
00063 };
00064 
00065 int SSLVersion2[] = {
00066        PR_TRUE,
00067        PR_FALSE
00068 };
00069 
00070 int SSLVersion3[] = {
00071        PR_TRUE,
00072        PR_FALSE
00073 };
00074 
00075 int ClientIOSessionLength[] = {
00076        0,
00077        1024
00078 };
00079 
00080 int ServerIOSessionLength[] = {
00081        0,
00082        1024
00083 };
00084 
00085 int ServerDoClientAuth[] = {
00086        SSLT_CLIENTAUTH_OFF
00087 };
00088 
00089 PRBool ClientForceHandshake[] = {
00090        PR_FALSE
00091 };
00092 
00093 PRBool ServerForceHandshake[] = {
00094        PR_TRUE
00095 };
00096 
00097 PRBool ClientRedoHandshake[] = {
00098        PR_FALSE
00099 };
00100 
00101 PRBool ServerRedoHandshake[] = {
00102        PR_FALSE
00103 };
00104 
00105 PRBool Cipher_EN_RC4_128_WITH_MD5[] = {
00106        PR_TRUE,
00107        PR_FALSE
00108 };
00109 
00110 PRBool Cipher_EN_RC4_128_EXPORT40_WITH_MD5[] = {
00111        PR_TRUE,
00112        PR_FALSE
00113 };
00114 
00115 PRBool Cipher_EN_RC2_128_CBC_WITH_MD5[] = {
00116        PR_TRUE,
00117        PR_FALSE
00118 };
00119 
00120 PRBool Cipher_EN_DES_192_EDE3_CBC_WITH_MD5[] = {
00121        PR_TRUE,
00122        PR_FALSE
00123 };
00124 
00125 PRBool Cipher_RSA_EXPORT_WITH_RC4_40_MD5[] = {
00126        PR_TRUE,
00127        PR_FALSE
00128 };
00129 
00130 PRBool Cipher_RSA_WITH_RC4_128_MD5[] = {
00131        PR_TRUE,
00132        PR_FALSE
00133 };
00134 
00135 PRBool Cipher_RSA_EXPORT_WITH_RC2_CBC_40_MD5[] = {
00136        PR_TRUE,
00137        PR_FALSE
00138 };
00139 
00140 PRBool Cipher_RSA_WITH_DES_CBC_SHA[] = {
00141        PR_TRUE,
00142        PR_FALSE
00143 };
00144 
00145 PRBool Cipher_RSA_WITH_3DES_EDE_CBC_SHA[] = {
00146        PR_TRUE,
00147        PR_FALSE
00148 };
00149 
00150 
00151 #else
00152 extern int ClientCert[];
00153 extern int ServerCert[];
00154 extern int Policy[];
00155 extern int SSLVersion2[];
00156 extern int SSLVersion3[];
00157 extern int ClientIOSessionLength[];
00158 extern int ServerIOSessionLength[];
00159 extern int ServerDoClientAuth[];
00160 extern PRBool ClientForceHandshake[];
00161 extern PRBool ServerForceHandshake[];
00162 extern PRBool ClientRedoHandshake[];
00163 extern PRBool ServerRedoHandshake[];
00164 extern PRBool Cipher_EN_RC4_128_WITH_MD5[];
00165 extern PRBool Cipher_EN_RC4_128_EXPORT40_WITH_MD5[];
00166 extern PRBool Cipher_EN_RC2_128_CBC_WITH_MD5[];
00167 extern PRBool Cipher_EN_DES_192_EDE3_CBC_WITH_MD5[];
00168 extern PRBool Cipher_RSA_EXPORT_WITH_RC4_40_MD5[];
00169 extern PRBool Cipher_RSA_WITH_RC4_128_MD5[];
00170 extern PRBool Cipher_RSA_EXPORT_WITH_RC2_CBC_40_MD5[];
00171 extern PRBool Cipher_RSA_WITH_DES_CBC_SHA[];
00172 extern PRBool Cipher_RSA_WITH_3DES_EDE_CBC_SHA[];
00173 extern int testId;
00174 #endif
00175 
00176 
00177 #define REP_ClientCert            ClientCert[testId%2]
00178 #define REP_ServerCert            ServerCert[testId/2%1]
00179 #define REP_Policy                Policy[testId/2/1%2]
00180 #define REP_SSLVersion2           SSLVersion2[testId/2/1/2%2]
00181 #define REP_SSLVersion3           SSLVersion3[testId/2/1/2/2%2]
00182 #define REP_ClientIOSessionLength ClientIOSessionLength[testId/2/1/2/2/2%2]
00183 #define REP_ServerIOSessionLength ServerIOSessionLength[testId/2/1/2/2/2/2%2]
00184 #define REP_ServerDoClientAuth    ServerDoClientAuth[testId/2/1/2/2/2/2/2%1]
00185 #define REP_ClientForceHandshake  ClientForceHandshake[testId/2/1/2/2/2/2/2/1%1]
00186 #define REP_ServerForceHandshake  ServerForceHandshake[testId/2/1/2/2/2/2/2/1/1%1]
00187 #define REP_ClientRedoHandshake   ClientRedoHandshake[testId/2/1/2/2/2/2/2/1/1/1%1]
00188 #define REP_ServerRedoHandshake   ServerRedoHandshake[testId/2/1/2/2/2/2/2/1/1/1/1%1]
00189 
00190 
00191 #define REP_Cipher_EN_RC4_128_WITH_MD5                    Cipher_EN_RC4_128_WITH_MD5[testId/2/1/2/2/2/2/2/1/1/1/1/1%2]
00192 #define REP_Cipher_EN_RC4_128_EXPORT40_WITH_MD5           Cipher_EN_RC4_128_EXPORT40_WITH_MD5[testId/2/1/2/2/2/2/2/1/1/1/1/1/2%2]
00193 #define REP_Cipher_EN_RC2_128_CBC_WITH_MD5                Cipher_EN_RC2_128_CBC_WITH_MD5[testId/2/1/2/2/2/2/2/1/1/1/1/1/2/2%2]
00194 #ifdef undef
00195 #define REP_Cipher_EN_RC2_128_CBC_EXPORT40_WITH_MD5       $[Cipher_EN_RC2_128_CBC_EXPORT40_WITH_MD5]
00196 #define REP_Cipher_EN_IDEA_128_CBC_WITH_MD5               $[Cipher_EN_IDEA_128_CBC_WITH_MD5]
00197 #define REP_Cipher_EN_DES_64_CBC_WITH_MD5                 $[Cipher_EN_DES_64_CBC_WITH_MD5
00198 #define REP_Cipher_RSA_WITH_NULL_SHA                      $[Cipher_RSA_WITH_NULL_SHA]
00199 #define REP_Cipher_RSA_WITH_RC4_128_SHA                   $[Cipher_RSA_WITH_RC4_128_SHA]
00200 #define REP_Cipher_RSA_WITH_IDEA_CBC_SHA                  $[Cipher_RSA_WITH_IDEA_CBC_SHA]
00201 #define REP_Cipher_NULL_WITH_NULL_NULL                    $[Cipher_NULL_WITH_NULL_NULL]
00202 #define REP_Cipher_RSA_WITH_NULL_MD5                      $[Cipher_RSA_WITH_NULL_MD5]
00203 #endif
00204 #define REP_Cipher_EN_DES_192_EDE3_CBC_WITH_MD5           Cipher_EN_DES_192_EDE3_CBC_WITH_MD5[testId/2/1/2/2/2/2/2/1/1/1/1/1/2/2/2%2]
00205 #define REP_Cipher_RSA_EXPORT_WITH_RC4_40_MD5             Cipher_RSA_EXPORT_WITH_RC4_40_MD5[testId/2/1/2/2/2/2/2/1/1/1/1/1/2/2/2/2%2]
00206 #define REP_Cipher_RSA_WITH_RC4_128_MD5                   Cipher_RSA_WITH_RC4_128_MD5[testId/2/1/2/2/2/2/2/1/1/1/1/1/2/2/2/2/2%2]
00207 #define REP_Cipher_RSA_EXPORT_WITH_RC2_CBC_40_MD5         Cipher_RSA_EXPORT_WITH_RC2_CBC_40_MD5[testId/2/1/2/2/2/2/2/1/1/1/1/1/2/2/2/2/2/2%2]
00208 #define REP_Cipher_RSA_WITH_DES_CBC_SHA                   Cipher_RSA_WITH_DES_CBC_SHA[testId/2/1/2/2/2/2/2/1/1/1/1/1/2/2/2/2/2/2/2%2]
00209 #define REP_Cipher_RSA_WITH_3DES_EDE_CBC_SHA              Cipher_RSA_WITH_3DES_EDE_CBC_SHA[testId/2/1/2/2/2/2/2/1/1/1/1/1/2/2/2/2/2/2/2/2%2]
00210 
00211 #ifdef undef
00212 #define REP_Cipher_RSA_EXPORT_WITH_DES40_CBC_SHA          $[Cipher_RSA_EXPORT_WITH_DES40_CBC_SHA]
00213 
00214 #define REP_Cipher_DH_DSS_EXPORT_WITH_DES40_CBC_SHA       [Cipher_DH_DSS_EXPORT_WITH_DES40_CBC_SHA]
00215 #define REP_Cipher_DH_DSS_WITH_DES_CBC_SHA                [Cipher_DH_DSS_WITH_DES_CBC_SHA]
00216 #define REP_Cipher_DH_DSS_WITH_3DES_EDE_CBC_SHA           [Cipher_DH_DSS_WITH_3DES_EDE_CBC_SHA]
00217 #define REP_Cipher_DH_RSA_EXPORT_WITH_DES40_CBC_SHA       [Cipher_DH_RSA_EXPORT_WITH_DES40_CBC_SHA]
00218 #define REP_Cipher_DH_RSA_WITH_DES_CBC_SHA                [Cipher_DH_RSA_WITH_DES_CBC_SHA]
00219 #define REP_Cipher_DH_RSA_WITH_3DES_EDE_CBC_SHA           [Cipher_DH_RSA_WITH_3DES_EDE_CBC_SHA]
00220 #define REP_Cipher_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA      [Cipher_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA]
00221 #define REP_Cipher_DHE_DSS_WITH_DES_CBC_SHA               [Cipher_DHE_DSS_WITH_DES_CBC_SHA]
00222 #define REP_Cipher_DHE_DSS_WITH_3DES_EDE_CBC_SHA          [Cipher_DHE_DSS_WITH_3DES_EDE_CBC_SHA]
00223 #define REP_Cipher_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA      [Cipher_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA]
00224 #define REP_Cipher_DHE_RSA_WITH_DES_CBC_SHA               [Cipher_DHE_RSA_WITH_DES_CBC_SHA]
00225 #define REP_Cipher_DHE_RSA_WITH_3DES_EDE_CBC_SHA          [Cipher_DHE_RSA_WITH_3DES_EDE_CBC_SHA]
00226 #define REP_Cipher_DH_ANON_EXPORT_WITH_RC4_40_MD5         [Cipher_DH_ANON_EXPORT_WITH_RC4_40_MD5]
00227 #define REP_Cipher_DH_ANON_WITH_RC4_128_MD5               [Cipher_DH_ANON_WITH_RC4_128_MD5]
00228 #define REP_Cipher_DH_ANON_WITH_DES_CBC_SHA               [Cipher_DH_ANON_WITH_DES_CBC_SHA]
00229 #define REP_Cipher_DH_ANON_WITH_3DES_EDE_CBC_SHA          [Cipher_DH_ANON_WITH_3DES_EDE_CBC_SHA]
00230 #define REP_Cipher_FORTEZZA_DMS_WITH_FORTEZZA_CBC_SHA     $[Cipher_FORTEZZA_DMS_WITH_FORTEZZA_CBC_SHA]
00231 #define REP_Cipher_FORTEZZA_DMS_WITH_RC4_128_SHA          $[Cipher_FORTEZZA_DMS_WITH_RC4_128_SHA]
00232 #endif
00233 #define REP_Cipher_RSA_FIPS_WITH_3DES_EDE_CBC_SHA         $[Cipher_RSA_FIPS_WITH_3DES_EDE_CBC_SHA]
00234 #define REP_Cipher_RSA_FIPS_WITH_DES_CBC_SHA              $[Cipher_RSA_FIPS_WITH_DES_CBC_SHA]
00235 
00236 
00237 #endif
00238 
00239 
00240 
00241