PageRenderTime 26ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/gecko_api/include/sslproto.h

http://firefox-mac-pdf.googlecode.com/
C Header | 220 lines | 136 code | 28 blank | 56 comment | 0 complexity | 2796bd06c767d60bbcda914ab490d499 MD5 | raw file
  1. /*
  2. * Various and sundry protocol constants. DON'T CHANGE THESE. These values
  3. * are mostly defined by the SSL2, SSL3, or TLS protocol specifications.
  4. * Cipher kinds and ciphersuites are part of the public API.
  5. *
  6. * ***** BEGIN LICENSE BLOCK *****
  7. * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  8. *
  9. * The contents of this file are subject to the Mozilla Public License Version
  10. * 1.1 (the "License"); you may not use this file except in compliance with
  11. * the License. You may obtain a copy of the License at
  12. * http://www.mozilla.org/MPL/
  13. *
  14. * Software distributed under the License is distributed on an "AS IS" basis,
  15. * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  16. * for the specific language governing rights and limitations under the
  17. * License.
  18. *
  19. * The Original Code is the Netscape security libraries.
  20. *
  21. * The Initial Developer of the Original Code is
  22. * Netscape Communications Corporation.
  23. * Portions created by the Initial Developer are Copyright (C) 1994-2000
  24. * the Initial Developer. All Rights Reserved.
  25. *
  26. * Contributor(s):
  27. * Dr Vipul Gupta <vipul.gupta@sun.com>, Sun Microsystems Laboratories
  28. *
  29. * Alternatively, the contents of this file may be used under the terms of
  30. * either the GNU General Public License Version 2 or later (the "GPL"), or
  31. * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  32. * in which case the provisions of the GPL or the LGPL are applicable instead
  33. * of those above. If you wish to allow use of your version of this file only
  34. * under the terms of either the GPL or the LGPL, and not to allow others to
  35. * use your version of this file under the terms of the MPL, indicate your
  36. * decision by deleting the provisions above and replace them with the notice
  37. * and other provisions required by the GPL or the LGPL. If you do not delete
  38. * the provisions above, a recipient may use your version of this file under
  39. * the terms of any one of the MPL, the GPL or the LGPL.
  40. *
  41. * ***** END LICENSE BLOCK ***** */
  42. /* $Id: sslproto.h,v 1.12 2007/02/28 19:47:38 rrelyea%redhat.com Exp $ */
  43. #ifndef __sslproto_h_
  44. #define __sslproto_h_
  45. /* All versions less than 3_0 are treated as SSL version 2 */
  46. #define SSL_LIBRARY_VERSION_2 0x0002
  47. #define SSL_LIBRARY_VERSION_3_0 0x0300
  48. #define SSL_LIBRARY_VERSION_3_1_TLS 0x0301
  49. /* Header lengths of some of the messages */
  50. #define SSL_HL_ERROR_HBYTES 3
  51. #define SSL_HL_CLIENT_HELLO_HBYTES 9
  52. #define SSL_HL_CLIENT_MASTER_KEY_HBYTES 10
  53. #define SSL_HL_CLIENT_FINISHED_HBYTES 1
  54. #define SSL_HL_SERVER_HELLO_HBYTES 11
  55. #define SSL_HL_SERVER_VERIFY_HBYTES 1
  56. #define SSL_HL_SERVER_FINISHED_HBYTES 1
  57. #define SSL_HL_REQUEST_CERTIFICATE_HBYTES 2
  58. #define SSL_HL_CLIENT_CERTIFICATE_HBYTES 6
  59. /* Security handshake protocol codes */
  60. #define SSL_MT_ERROR 0
  61. #define SSL_MT_CLIENT_HELLO 1
  62. #define SSL_MT_CLIENT_MASTER_KEY 2
  63. #define SSL_MT_CLIENT_FINISHED 3
  64. #define SSL_MT_SERVER_HELLO 4
  65. #define SSL_MT_SERVER_VERIFY 5
  66. #define SSL_MT_SERVER_FINISHED 6
  67. #define SSL_MT_REQUEST_CERTIFICATE 7
  68. #define SSL_MT_CLIENT_CERTIFICATE 8
  69. /* Certificate types */
  70. #define SSL_CT_X509_CERTIFICATE 0x01
  71. #if 0 /* XXX Not implemented yet */
  72. #define SSL_PKCS6_CERTIFICATE 0x02
  73. #endif
  74. #define SSL_AT_MD5_WITH_RSA_ENCRYPTION 0x01
  75. /* Error codes */
  76. #define SSL_PE_NO_CYPHERS 0x0001
  77. #define SSL_PE_NO_CERTIFICATE 0x0002
  78. #define SSL_PE_BAD_CERTIFICATE 0x0004
  79. #define SSL_PE_UNSUPPORTED_CERTIFICATE_TYPE 0x0006
  80. /* Cypher kinds (not the spec version!) */
  81. #define SSL_CK_RC4_128_WITH_MD5 0x01
  82. #define SSL_CK_RC4_128_EXPORT40_WITH_MD5 0x02
  83. #define SSL_CK_RC2_128_CBC_WITH_MD5 0x03
  84. #define SSL_CK_RC2_128_CBC_EXPORT40_WITH_MD5 0x04
  85. #define SSL_CK_IDEA_128_CBC_WITH_MD5 0x05
  86. #define SSL_CK_DES_64_CBC_WITH_MD5 0x06
  87. #define SSL_CK_DES_192_EDE3_CBC_WITH_MD5 0x07
  88. /* Cipher enables. These are used only for SSL_EnableCipher
  89. * These values define the SSL2 suites, and do not colide with the
  90. * SSL3 Cipher suites defined below.
  91. */
  92. #define SSL_EN_RC4_128_WITH_MD5 0xFF01
  93. #define SSL_EN_RC4_128_EXPORT40_WITH_MD5 0xFF02
  94. #define SSL_EN_RC2_128_CBC_WITH_MD5 0xFF03
  95. #define SSL_EN_RC2_128_CBC_EXPORT40_WITH_MD5 0xFF04
  96. #define SSL_EN_IDEA_128_CBC_WITH_MD5 0xFF05
  97. #define SSL_EN_DES_64_CBC_WITH_MD5 0xFF06
  98. #define SSL_EN_DES_192_EDE3_CBC_WITH_MD5 0xFF07
  99. /* SSL v3 Cipher Suites */
  100. #define SSL_NULL_WITH_NULL_NULL 0x0000
  101. #define SSL_RSA_WITH_NULL_MD5 0x0001
  102. #define SSL_RSA_WITH_NULL_SHA 0x0002
  103. #define SSL_RSA_EXPORT_WITH_RC4_40_MD5 0x0003
  104. #define SSL_RSA_WITH_RC4_128_MD5 0x0004
  105. #define SSL_RSA_WITH_RC4_128_SHA 0x0005
  106. #define SSL_RSA_EXPORT_WITH_RC2_CBC_40_MD5 0x0006
  107. #define SSL_RSA_WITH_IDEA_CBC_SHA 0x0007
  108. #define SSL_RSA_EXPORT_WITH_DES40_CBC_SHA 0x0008
  109. #define SSL_RSA_WITH_DES_CBC_SHA 0x0009
  110. #define SSL_RSA_WITH_3DES_EDE_CBC_SHA 0x000a
  111. #define SSL_DH_DSS_EXPORT_WITH_DES40_CBC_SHA 0x000b
  112. #define SSL_DH_DSS_WITH_DES_CBC_SHA 0x000c
  113. #define SSL_DH_DSS_WITH_3DES_EDE_CBC_SHA 0x000d
  114. #define SSL_DH_RSA_EXPORT_WITH_DES40_CBC_SHA 0x000e
  115. #define SSL_DH_RSA_WITH_DES_CBC_SHA 0x000f
  116. #define SSL_DH_RSA_WITH_3DES_EDE_CBC_SHA 0x0010
  117. #define SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA 0x0011
  118. #define SSL_DHE_DSS_WITH_DES_CBC_SHA 0x0012
  119. #define SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA 0x0013
  120. #define SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA 0x0014
  121. #define SSL_DHE_RSA_WITH_DES_CBC_SHA 0x0015
  122. #define SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA 0x0016
  123. #define SSL_DH_ANON_EXPORT_WITH_RC4_40_MD5 0x0017
  124. #define SSL_DH_ANON_WITH_RC4_128_MD5 0x0018
  125. #define SSL_DH_ANON_EXPORT_WITH_DES40_CBC_SHA 0x0019
  126. #define SSL_DH_ANON_WITH_DES_CBC_SHA 0x001a
  127. #define SSL_DH_ANON_WITH_3DES_EDE_CBC_SHA 0x001b
  128. #define SSL_FORTEZZA_DMS_WITH_NULL_SHA 0x001c /* deprecated */
  129. #define SSL_FORTEZZA_DMS_WITH_FORTEZZA_CBC_SHA 0x001d /* deprecated */
  130. #define SSL_FORTEZZA_DMS_WITH_RC4_128_SHA 0x001e /* deprecated */
  131. /* New TLS cipher suites */
  132. #define TLS_RSA_WITH_AES_128_CBC_SHA 0x002F
  133. #define TLS_DH_DSS_WITH_AES_128_CBC_SHA 0x0030
  134. #define TLS_DH_RSA_WITH_AES_128_CBC_SHA 0x0031
  135. #define TLS_DHE_DSS_WITH_AES_128_CBC_SHA 0x0032
  136. #define TLS_DHE_RSA_WITH_AES_128_CBC_SHA 0x0033
  137. #define TLS_DH_ANON_WITH_AES_128_CBC_SHA 0x0034
  138. #define TLS_RSA_WITH_AES_256_CBC_SHA 0x0035
  139. #define TLS_DH_DSS_WITH_AES_256_CBC_SHA 0x0036
  140. #define TLS_DH_RSA_WITH_AES_256_CBC_SHA 0x0037
  141. #define TLS_DHE_DSS_WITH_AES_256_CBC_SHA 0x0038
  142. #define TLS_DHE_RSA_WITH_AES_256_CBC_SHA 0x0039
  143. #define TLS_DH_ANON_WITH_AES_256_CBC_SHA 0x003A
  144. #define TLS_RSA_WITH_CAMELLIA_128_CBC_SHA 0x0041
  145. #define TLS_DH_DSS_WITH_CAMELLIA_128_CBC_SHA 0x0042
  146. #define TLS_DH_RSA_WITH_CAMELLIA_128_CBC_SHA 0x0043
  147. #define TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA 0x0044
  148. #define TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA 0x0045
  149. #define TLS_DH_ANON_WITH_CAMELLIA_128_CBC_SHA 0x0046
  150. #define TLS_RSA_EXPORT1024_WITH_DES_CBC_SHA 0x0062
  151. #define TLS_RSA_EXPORT1024_WITH_RC4_56_SHA 0x0064
  152. #define TLS_DHE_DSS_EXPORT1024_WITH_DES_CBC_SHA 0x0063
  153. #define TLS_DHE_DSS_EXPORT1024_WITH_RC4_56_SHA 0x0065
  154. #define TLS_DHE_DSS_WITH_RC4_128_SHA 0x0066
  155. #define TLS_RSA_WITH_CAMELLIA_256_CBC_SHA 0x0084
  156. #define TLS_DH_DSS_WITH_CAMELLIA_256_CBC_SHA 0x0085
  157. #define TLS_DH_RSA_WITH_CAMELLIA_256_CBC_SHA 0x0086
  158. #define TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA 0x0087
  159. #define TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA 0x0088
  160. #define TLS_DH_ANON_WITH_CAMELLIA_256_CBC_SHA 0x0089
  161. #define TLS_ECDH_ECDSA_WITH_NULL_SHA 0xC001
  162. #define TLS_ECDH_ECDSA_WITH_RC4_128_SHA 0xC002
  163. #define TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA 0xC003
  164. #define TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA 0xC004
  165. #define TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA 0xC005
  166. #define TLS_ECDHE_ECDSA_WITH_NULL_SHA 0xC006
  167. #define TLS_ECDHE_ECDSA_WITH_RC4_128_SHA 0xC007
  168. #define TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA 0xC008
  169. #define TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA 0xC009
  170. #define TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA 0xC00A
  171. #define TLS_ECDH_RSA_WITH_NULL_SHA 0xC00B
  172. #define TLS_ECDH_RSA_WITH_RC4_128_SHA 0xC00C
  173. #define TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA 0xC00D
  174. #define TLS_ECDH_RSA_WITH_AES_128_CBC_SHA 0xC00E
  175. #define TLS_ECDH_RSA_WITH_AES_256_CBC_SHA 0xC00F
  176. #define TLS_ECDHE_RSA_WITH_NULL_SHA 0xC010
  177. #define TLS_ECDHE_RSA_WITH_RC4_128_SHA 0xC011
  178. #define TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA 0xC012
  179. #define TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA 0xC013
  180. #define TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA 0xC014
  181. #define TLS_ECDH_anon_WITH_NULL_SHA 0xC015
  182. #define TLS_ECDH_anon_WITH_RC4_128_SHA 0xC016
  183. #define TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA 0xC017
  184. #define TLS_ECDH_anon_WITH_AES_128_CBC_SHA 0xC018
  185. #define TLS_ECDH_anon_WITH_AES_256_CBC_SHA 0xC019
  186. /* Netscape "experimental" cipher suites. */
  187. #define SSL_RSA_OLDFIPS_WITH_3DES_EDE_CBC_SHA 0xffe0
  188. #define SSL_RSA_OLDFIPS_WITH_DES_CBC_SHA 0xffe1
  189. /* New non-experimental openly spec'ed versions of those cipher suites. */
  190. #define SSL_RSA_FIPS_WITH_3DES_EDE_CBC_SHA 0xfeff
  191. #define SSL_RSA_FIPS_WITH_DES_CBC_SHA 0xfefe
  192. #endif /* __sslproto_h_ */