PageRenderTime 37ms CodeModel.GetById 28ms RepoModel.GetById 0ms 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. #ifndef __sslt_h_
  42. #define __sslt_h_
  43. #include "prtypes.h"
  44. typedef struct SSL3StatisticsStr {
  45. /* statistics from ssl3_SendClientHello (sch) */
  46. long sch_sid_cache_hits;
  47. long sch_sid_cache_misses;
  48. long sch_sid_cache_not_ok;
  49. /* statistics from ssl3_HandleServerHello (hsh) */
  50. long hsh_sid_cache_hits;
  51. long hsh_sid_cache_misses;
  52. long hsh_sid_cache_not_ok;
  53. /* statistics from ssl3_HandleClientHello (hch) */
  54. long hch_sid_cache_hits;
  55. long hch_sid_cache_misses;
  56. long hch_sid_cache_not_ok;
  57. /* statistics related to stateless resume */
  58. long sch_sid_stateless_resumes;
  59. long hsh_sid_stateless_resumes;
  60. long hch_sid_stateless_resumes;
  61. long hch_sid_ticket_parse_failures;
  62. } SSL3Statistics;
  63. /* Key Exchange algorithm values */
  64. typedef enum {
  65. ssl_kea_null = 0,
  66. ssl_kea_rsa = 1,
  67. ssl_kea_dh = 2,
  68. ssl_kea_fortezza = 3, /* deprecated, now unused */
  69. ssl_kea_ecdh = 4,
  70. ssl_kea_size /* number of ssl_kea_ algorithms */
  71. } SSLKEAType;
  72. /* The following defines are for backwards compatibility.
  73. ** They will be removed in a forthcoming release to reduce namespace pollution.
  74. ** programs that use the kt_ symbols should convert to the ssl_kt_ symbols
  75. ** soon.
  76. */
  77. #define kt_null ssl_kea_null
  78. #define kt_rsa ssl_kea_rsa
  79. #define kt_dh ssl_kea_dh
  80. #define kt_fortezza ssl_kea_fortezza /* deprecated, now unused */
  81. #define kt_ecdh ssl_kea_ecdh
  82. #define kt_kea_size ssl_kea_size
  83. typedef enum {
  84. ssl_sign_null = 0,
  85. ssl_sign_rsa = 1,
  86. ssl_sign_dsa = 2,
  87. ssl_sign_ecdsa = 3
  88. } SSLSignType;
  89. typedef enum {
  90. ssl_auth_null = 0,
  91. ssl_auth_rsa = 1,
  92. ssl_auth_dsa = 2,
  93. ssl_auth_kea = 3,
  94. ssl_auth_ecdsa = 4
  95. } SSLAuthType;
  96. typedef enum {
  97. ssl_calg_null = 0,
  98. ssl_calg_rc4 = 1,
  99. ssl_calg_rc2 = 2,
  100. ssl_calg_des = 3,
  101. ssl_calg_3des = 4,
  102. ssl_calg_idea = 5,
  103. ssl_calg_fortezza = 6, /* deprecated, now unused */
  104. ssl_calg_aes = 7, /* coming soon */
  105. ssl_calg_camellia = 8
  106. } SSLCipherAlgorithm;
  107. typedef enum {
  108. ssl_mac_null = 0,
  109. ssl_mac_md5 = 1,
  110. ssl_mac_sha = 2,
  111. ssl_hmac_md5 = 3, /* TLS HMAC version of mac_md5 */
  112. ssl_hmac_sha = 4 /* TLS HMAC version of mac_sha */
  113. } SSLMACAlgorithm;
  114. typedef struct SSLChannelInfoStr {
  115. PRUint32 length;
  116. PRUint16 protocolVersion;
  117. PRUint16 cipherSuite;
  118. /* server authentication info */
  119. PRUint32 authKeyBits;
  120. /* key exchange algorithm info */
  121. PRUint32 keaKeyBits;
  122. /* session info */
  123. PRUint32 creationTime; /* seconds since Jan 1, 1970 */
  124. PRUint32 lastAccessTime; /* seconds since Jan 1, 1970 */
  125. PRUint32 expirationTime; /* seconds since Jan 1, 1970 */
  126. PRUint32 sessionIDLength; /* up to 32 */
  127. PRUint8 sessionID [32];
  128. } SSLChannelInfo;
  129. typedef struct SSLCipherSuiteInfoStr {
  130. PRUint16 length;
  131. PRUint16 cipherSuite;
  132. /* Cipher Suite Name */
  133. const char * cipherSuiteName;
  134. /* server authentication info */
  135. const char * authAlgorithmName;
  136. SSLAuthType authAlgorithm;
  137. /* key exchange algorithm info */
  138. const char * keaTypeName;
  139. SSLKEAType keaType;
  140. /* symmetric encryption info */
  141. const char * symCipherName;
  142. SSLCipherAlgorithm symCipher;
  143. PRUint16 symKeyBits;
  144. PRUint16 symKeySpace;
  145. PRUint16 effectiveKeyBits;
  146. /* MAC info */
  147. const char * macAlgorithmName;
  148. SSLMACAlgorithm macAlgorithm;
  149. PRUint16 macBits;
  150. PRUintn isFIPS : 1;
  151. PRUintn isExportable : 1;
  152. PRUintn nonStandard : 1;
  153. PRUintn reservedBits :29;
  154. } SSLCipherSuiteInfo;
  155. #endif /* __sslt_h_ */