Back to index

lightning-sunbird  0.9+nobinonly
sslproto.h
Go to the documentation of this file.
00001 /*
00002  * Various and sundry protocol constants. DON'T CHANGE THESE. These values 
00003  * are mostly defined by the SSL2, SSL3, or TLS protocol specifications.
00004  * Cipher kinds and ciphersuites are part of the public API.
00005  *
00006  * ***** BEGIN LICENSE BLOCK *****
00007  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00008  *
00009  * The contents of this file are subject to the Mozilla Public License Version
00010  * 1.1 (the "License"); you may not use this file except in compliance with
00011  * the License. You may obtain a copy of the License at
00012  * http://www.mozilla.org/MPL/
00013  *
00014  * Software distributed under the License is distributed on an "AS IS" basis,
00015  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00016  * for the specific language governing rights and limitations under the
00017  * License.
00018  *
00019  * The Original Code is the Netscape security libraries.
00020  *
00021  * The Initial Developer of the Original Code is
00022  * Netscape Communications Corporation.
00023  * Portions created by the Initial Developer are Copyright (C) 1994-2000
00024  * the Initial Developer. All Rights Reserved.
00025  *
00026  * Contributor(s):
00027  *   Dr Vipul Gupta <vipul.gupta@sun.com>, Sun Microsystems Laboratories
00028  *
00029  * Alternatively, the contents of this file may be used under the terms of
00030  * either the GNU General Public License Version 2 or later (the "GPL"), or
00031  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00032  * in which case the provisions of the GPL or the LGPL are applicable instead
00033  * of those above. If you wish to allow use of your version of this file only
00034  * under the terms of either the GPL or the LGPL, and not to allow others to
00035  * use your version of this file under the terms of the MPL, indicate your
00036  * decision by deleting the provisions above and replace them with the notice
00037  * and other provisions required by the GPL or the LGPL. If you do not delete
00038  * the provisions above, a recipient may use your version of this file under
00039  * the terms of any one of the MPL, the GPL or the LGPL.
00040  *
00041  * ***** END LICENSE BLOCK ***** */
00042 /* $Id: sslproto.h,v 1.9.2.2 2006/05/15 21:55:47 rrelyea%redhat.com Exp $ */
00043 
00044 #ifndef __sslproto_h_
00045 #define __sslproto_h_
00046 
00047 /* All versions less than 3_0 are treated as SSL version 2 */
00048 #define SSL_LIBRARY_VERSION_2                    0x0002
00049 #define SSL_LIBRARY_VERSION_3_0                  0x0300
00050 #define SSL_LIBRARY_VERSION_3_1_TLS              0x0301
00051 
00052 /* Header lengths of some of the messages */
00053 #define SSL_HL_ERROR_HBYTES               3
00054 #define SSL_HL_CLIENT_HELLO_HBYTES        9
00055 #define SSL_HL_CLIENT_MASTER_KEY_HBYTES          10
00056 #define SSL_HL_CLIENT_FINISHED_HBYTES            1
00057 #define SSL_HL_SERVER_HELLO_HBYTES        11
00058 #define SSL_HL_SERVER_VERIFY_HBYTES              1
00059 #define SSL_HL_SERVER_FINISHED_HBYTES            1
00060 #define SSL_HL_REQUEST_CERTIFICATE_HBYTES 2
00061 #define SSL_HL_CLIENT_CERTIFICATE_HBYTES  6
00062 
00063 /* Security handshake protocol codes */
00064 #define SSL_MT_ERROR                      0
00065 #define SSL_MT_CLIENT_HELLO               1
00066 #define SSL_MT_CLIENT_MASTER_KEY          2
00067 #define SSL_MT_CLIENT_FINISHED                   3
00068 #define SSL_MT_SERVER_HELLO               4
00069 #define SSL_MT_SERVER_VERIFY                     5
00070 #define SSL_MT_SERVER_FINISHED                   6
00071 #define SSL_MT_REQUEST_CERTIFICATE        7
00072 #define SSL_MT_CLIENT_CERTIFICATE         8
00073 
00074 /* Certificate types */
00075 #define SSL_CT_X509_CERTIFICATE                  0x01
00076 #if 0 /* XXX Not implemented yet */
00077 #define SSL_PKCS6_CERTIFICATE                    0x02
00078 #endif
00079 #define SSL_AT_MD5_WITH_RSA_ENCRYPTION           0x01
00080 
00081 /* Error codes */
00082 #define SSL_PE_NO_CYPHERS                 0x0001
00083 #define SSL_PE_NO_CERTIFICATE                    0x0002
00084 #define SSL_PE_BAD_CERTIFICATE                   0x0004
00085 #define SSL_PE_UNSUPPORTED_CERTIFICATE_TYPE      0x0006
00086 
00087 /* Cypher kinds (not the spec version!) */
00088 #define SSL_CK_RC4_128_WITH_MD5                  0x01
00089 #define SSL_CK_RC4_128_EXPORT40_WITH_MD5  0x02
00090 #define SSL_CK_RC2_128_CBC_WITH_MD5              0x03
00091 #define SSL_CK_RC2_128_CBC_EXPORT40_WITH_MD5     0x04
00092 #define SSL_CK_IDEA_128_CBC_WITH_MD5             0x05
00093 #define SSL_CK_DES_64_CBC_WITH_MD5        0x06
00094 #define SSL_CK_DES_192_EDE3_CBC_WITH_MD5  0x07
00095 
00096 /* Cipher enables.  These are used only for SSL_EnableCipher 
00097  * These values define the SSL2 suites, and do not colide with the 
00098  * SSL3 Cipher suites defined below.
00099  */
00100 #define SSL_EN_RC4_128_WITH_MD5                  0xFF01
00101 #define SSL_EN_RC4_128_EXPORT40_WITH_MD5  0xFF02
00102 #define SSL_EN_RC2_128_CBC_WITH_MD5              0xFF03
00103 #define SSL_EN_RC2_128_CBC_EXPORT40_WITH_MD5     0xFF04
00104 #define SSL_EN_IDEA_128_CBC_WITH_MD5             0xFF05
00105 #define SSL_EN_DES_64_CBC_WITH_MD5        0xFF06
00106 #define SSL_EN_DES_192_EDE3_CBC_WITH_MD5  0xFF07
00107 
00108 /* SSL v3 Cipher Suites */
00109 #define SSL_NULL_WITH_NULL_NULL                  0x0000
00110 
00111 #define SSL_RSA_WITH_NULL_MD5                    0x0001
00112 #define SSL_RSA_WITH_NULL_SHA                    0x0002
00113 #define SSL_RSA_EXPORT_WITH_RC4_40_MD5           0x0003
00114 #define SSL_RSA_WITH_RC4_128_MD5          0x0004
00115 #define SSL_RSA_WITH_RC4_128_SHA          0x0005
00116 #define SSL_RSA_EXPORT_WITH_RC2_CBC_40_MD5       0x0006
00117 #define SSL_RSA_WITH_IDEA_CBC_SHA         0x0007
00118 #define SSL_RSA_EXPORT_WITH_DES40_CBC_SHA 0x0008
00119 #define SSL_RSA_WITH_DES_CBC_SHA          0x0009
00120 #define SSL_RSA_WITH_3DES_EDE_CBC_SHA            0x000a
00121                                                  
00122 #define SSL_DH_DSS_EXPORT_WITH_DES40_CBC_SHA     0x000b
00123 #define SSL_DH_DSS_WITH_DES_CBC_SHA              0x000c
00124 #define SSL_DH_DSS_WITH_3DES_EDE_CBC_SHA  0x000d
00125 #define SSL_DH_RSA_EXPORT_WITH_DES40_CBC_SHA     0x000e
00126 #define SSL_DH_RSA_WITH_DES_CBC_SHA              0x000f
00127 #define SSL_DH_RSA_WITH_3DES_EDE_CBC_SHA  0x0010
00128                                                  
00129 #define SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA    0x0011
00130 #define SSL_DHE_DSS_WITH_DES_CBC_SHA             0x0012
00131 #define SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA 0x0013
00132 #define SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA    0x0014
00133 #define SSL_DHE_RSA_WITH_DES_CBC_SHA             0x0015
00134 #define SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA 0x0016
00135                                                  
00136 #define SSL_DH_ANON_EXPORT_WITH_RC4_40_MD5       0x0017
00137 #define SSL_DH_ANON_WITH_RC4_128_MD5             0x0018
00138 #define SSL_DH_ANON_EXPORT_WITH_DES40_CBC_SHA    0x0019
00139 #define SSL_DH_ANON_WITH_DES_CBC_SHA             0x001a
00140 #define SSL_DH_ANON_WITH_3DES_EDE_CBC_SHA 0x001b
00141 
00142 #define SSL_FORTEZZA_DMS_WITH_NULL_SHA           0x001c /* deprecated */
00143 #define SSL_FORTEZZA_DMS_WITH_FORTEZZA_CBC_SHA   0x001d /* deprecated */
00144 #define SSL_FORTEZZA_DMS_WITH_RC4_128_SHA 0x001e /* deprecated */
00145 
00146 /* New TLS cipher suites */
00147 #define TLS_RSA_WITH_AES_128_CBC_SHA             0x002F
00148 #define TLS_DH_DSS_WITH_AES_128_CBC_SHA          0x0030
00149 #define TLS_DH_RSA_WITH_AES_128_CBC_SHA          0x0031
00150 #define TLS_DHE_DSS_WITH_AES_128_CBC_SHA         0x0032
00151 #define TLS_DHE_RSA_WITH_AES_128_CBC_SHA         0x0033
00152 #define TLS_DH_ANON_WITH_AES_128_CBC_SHA         0x0034
00153 
00154 #define TLS_RSA_WITH_AES_256_CBC_SHA             0x0035
00155 #define TLS_DH_DSS_WITH_AES_256_CBC_SHA          0x0036
00156 #define TLS_DH_RSA_WITH_AES_256_CBC_SHA          0x0037
00157 #define TLS_DHE_DSS_WITH_AES_256_CBC_SHA         0x0038
00158 #define TLS_DHE_RSA_WITH_AES_256_CBC_SHA         0x0039
00159 #define TLS_DH_ANON_WITH_AES_256_CBC_SHA         0x003A
00160 
00161 #define TLS_RSA_EXPORT1024_WITH_DES_CBC_SHA     0x0062
00162 #define TLS_RSA_EXPORT1024_WITH_RC4_56_SHA      0x0064
00163 
00164 #define TLS_DHE_DSS_EXPORT1024_WITH_DES_CBC_SHA 0x0063
00165 #define TLS_DHE_DSS_EXPORT1024_WITH_RC4_56_SHA  0x0065
00166 #define TLS_DHE_DSS_WITH_RC4_128_SHA            0x0066
00167 
00168 #define TLS_ECDH_ECDSA_WITH_NULL_SHA            0xC001
00169 #define TLS_ECDH_ECDSA_WITH_RC4_128_SHA         0xC002
00170 #define TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA    0xC003
00171 #define TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA     0xC004
00172 #define TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA     0xC005
00173 
00174 #define TLS_ECDHE_ECDSA_WITH_NULL_SHA           0xC006
00175 #define TLS_ECDHE_ECDSA_WITH_RC4_128_SHA        0xC007
00176 #define TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA   0xC008
00177 #define TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA    0xC009
00178 #define TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA    0xC00A
00179 
00180 #define TLS_ECDH_RSA_WITH_NULL_SHA              0xC00B
00181 #define TLS_ECDH_RSA_WITH_RC4_128_SHA           0xC00C
00182 #define TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA      0xC00D
00183 #define TLS_ECDH_RSA_WITH_AES_128_CBC_SHA       0xC00E
00184 #define TLS_ECDH_RSA_WITH_AES_256_CBC_SHA       0xC00F
00185 
00186 #define TLS_ECDHE_RSA_WITH_NULL_SHA             0xC010
00187 #define TLS_ECDHE_RSA_WITH_RC4_128_SHA          0xC011
00188 #define TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA     0xC012
00189 #define TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA      0xC013
00190 #define TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA      0xC014
00191 
00192 #define TLS_ECDH_anon_WITH_NULL_SHA             0xC015
00193 #define TLS_ECDH_anon_WITH_RC4_128_SHA          0xC016
00194 #define TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA     0xC017
00195 #define TLS_ECDH_anon_WITH_AES_128_CBC_SHA      0xC018
00196 #define TLS_ECDH_anon_WITH_AES_256_CBC_SHA      0xC019
00197 
00198 /* Netscape "experimental" cipher suites. */
00199 #define SSL_RSA_OLDFIPS_WITH_3DES_EDE_CBC_SHA    0xffe0
00200 #define SSL_RSA_OLDFIPS_WITH_DES_CBC_SHA  0xffe1
00201 
00202 /* New non-experimental openly spec'ed versions of those cipher suites. */
00203 #define SSL_RSA_FIPS_WITH_3DES_EDE_CBC_SHA       0xfeff
00204 #define SSL_RSA_FIPS_WITH_DES_CBC_SHA            0xfefe
00205 
00206 #endif /* __sslproto_h_ */