sslerrstrs.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387
  1. /** BEGIN COPYRIGHT BLOCK
  2. * This Program is free software; you can redistribute it and/or modify it under
  3. * the terms of the GNU General Public License as published by the Free Software
  4. * Foundation; version 2 of the License.
  5. *
  6. * This Program is distributed in the hope that it will be useful, but WITHOUT
  7. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  8. * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  9. *
  10. * You should have received a copy of the GNU General Public License along with
  11. * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple
  12. * Place, Suite 330, Boston, MA 02111-1307 USA.
  13. *
  14. * In addition, as a special exception, Red Hat, Inc. gives You the additional
  15. * right to link the code of this Program with code not covered under the GNU
  16. * General Public License ("Non-GPL Code") and to distribute linked combinations
  17. * including the two, subject to the limitations in this paragraph. Non-GPL Code
  18. * permitted under this exception must only link to the code of this Program
  19. * through those well defined interfaces identified in the file named EXCEPTION
  20. * found in the source code files (the "Approved Interfaces"). The files of
  21. * Non-GPL Code may instantiate templates or use macros or inline functions from
  22. * the Approved Interfaces without causing the resulting work to be covered by
  23. * the GNU General Public License. Only Red Hat, Inc. may make changes or
  24. * additions to the list of Approved Interfaces. You must obey the GNU General
  25. * Public License in all respects for all of the Program code and other code used
  26. * in conjunction with the Program except the Non-GPL Code covered by this
  27. * exception. If you modify this file, you may extend this exception to your
  28. * version of the file, but you are not obligated to do so. If you do not wish to
  29. * provide this exception without modification, you must delete this exception
  30. * statement from your version and license this file solely under the GPL without
  31. * exception.
  32. *
  33. *
  34. * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
  35. * Copyright (C) 2005 Red Hat, Inc.
  36. * All rights reserved.
  37. * END COPYRIGHT BLOCK **/
  38. /*
  39. * sslerrstrs.h - map SSL errors to strings (used by errormap.c)
  40. *
  41. */
  42. /*
  43. ****************************************************************************
  44. * The code below this point was provided by Nelson Bolyard <nelsonb> of the
  45. * Netscape Certificate Server team on 27-March-1998.
  46. * Taken from the file ns/security/cmd/lib/SSLerrs.h on NSS_1_BRANCH.
  47. * Last updated from there: 24-July-1998 by Mark Smith <mcs>
  48. *
  49. * All of the Directory Server specific changes are enclosed inside
  50. * #ifdef NS_DS.
  51. ****************************************************************************
  52. */
  53. /* SSL-specific security error codes */
  54. /* caller must include "sslerr.h" */
  55. ER3(SSL_ERROR_EXPORT_ONLY_SERVER, SSL_ERROR_BASE + 0,
  56. "Unable to communicate securely. Peer does not support high-grade encryption.")
  57. ER3(SSL_ERROR_US_ONLY_SERVER, SSL_ERROR_BASE + 1,
  58. "Unable to communicate securely. Peer requires high-grade encryption which is not supported.")
  59. ER3(SSL_ERROR_NO_CYPHER_OVERLAP, SSL_ERROR_BASE + 2,
  60. "Cannot communicate securely with peer: no common encryption algorithm(s).")
  61. ER3(SSL_ERROR_NO_CERTIFICATE, SSL_ERROR_BASE + 3,
  62. "Unable to find the certificate or key necessary for authentication.")
  63. ER3(SSL_ERROR_BAD_CERTIFICATE, SSL_ERROR_BASE + 4,
  64. "Unable to communicate securely with peer: peers's certificate was rejected.")
  65. /* unused (SSL_ERROR_BASE + 5),*/
  66. ER3(SSL_ERROR_BAD_CLIENT, SSL_ERROR_BASE + 6,
  67. "The server has encountered bad data from the client.")
  68. ER3(SSL_ERROR_BAD_SERVER, SSL_ERROR_BASE + 7,
  69. "The client has encountered bad data from the server.")
  70. ER3(SSL_ERROR_UNSUPPORTED_CERTIFICATE_TYPE, SSL_ERROR_BASE + 8,
  71. "Unsupported certificate type.")
  72. ER3(SSL_ERROR_UNSUPPORTED_VERSION, SSL_ERROR_BASE + 9,
  73. "Peer using unsupported version of security protocol.")
  74. /* unused (SSL_ERROR_BASE + 10),*/
  75. ER3(SSL_ERROR_WRONG_CERTIFICATE, SSL_ERROR_BASE + 11,
  76. "Client authentication failed: private key in key database does not match public key in certificate database.")
  77. ER3(SSL_ERROR_BAD_CERT_DOMAIN, SSL_ERROR_BASE + 12,
  78. "Unable to communicate securely with peer: requested domain name does not match the server's certificate.")
  79. /* SSL_ERROR_POST_WARNING (SSL_ERROR_BASE + 13),
  80. defined in sslerr.h
  81. */
  82. ER3(SSL_ERROR_SSL2_DISABLED, (SSL_ERROR_BASE + 14),
  83. "Peer only supports SSL version 2, which is locally disabled.")
  84. ER3(SSL_ERROR_BAD_MAC_READ, (SSL_ERROR_BASE + 15),
  85. "SSL received a record with an incorrect Message Authentication Code.")
  86. ER3(SSL_ERROR_BAD_MAC_ALERT, (SSL_ERROR_BASE + 16),
  87. "SSL peer reports incorrect Message Authentication Code.")
  88. ER3(SSL_ERROR_BAD_CERT_ALERT, (SSL_ERROR_BASE + 17),
  89. "SSL peer cannot verify your certificate.")
  90. ER3(SSL_ERROR_REVOKED_CERT_ALERT, (SSL_ERROR_BASE + 18),
  91. "SSL peer rejected your certificate as revoked.")
  92. ER3(SSL_ERROR_EXPIRED_CERT_ALERT, (SSL_ERROR_BASE + 19),
  93. "SSL peer rejected your certificate as expired.")
  94. ER3(SSL_ERROR_SSL_DISABLED, (SSL_ERROR_BASE + 20),
  95. "Cannot connect: SSL is disabled.")
  96. ER3(SSL_ERROR_FORTEZZA_PQG, (SSL_ERROR_BASE + 21),
  97. "Cannot connect: SSL peer is in another FORTEZZA domain.")
  98. ER3(SSL_ERROR_UNKNOWN_CIPHER_SUITE , (SSL_ERROR_BASE + 22),
  99. "An unknown SSL cipher suite has been requested.")
  100. ER3(SSL_ERROR_NO_CIPHERS_SUPPORTED , (SSL_ERROR_BASE + 23),
  101. "No cipher suites are present and enabled in this program.")
  102. ER3(SSL_ERROR_BAD_BLOCK_PADDING , (SSL_ERROR_BASE + 24),
  103. "SSL received a record with bad block padding.")
  104. ER3(SSL_ERROR_RX_RECORD_TOO_LONG , (SSL_ERROR_BASE + 25),
  105. "SSL received a record that exceeded the maximum permissible length.")
  106. ER3(SSL_ERROR_TX_RECORD_TOO_LONG , (SSL_ERROR_BASE + 26),
  107. "SSL attempted to send a record that exceeded the maximum permissible length.")
  108. /*
  109. * Received a malformed (too long or short or invalid content) SSL handshake.
  110. */
  111. ER3(SSL_ERROR_RX_MALFORMED_HELLO_REQUEST , (SSL_ERROR_BASE + 27),
  112. "SSL received a malformed Hello Request handshake message.")
  113. ER3(SSL_ERROR_RX_MALFORMED_CLIENT_HELLO , (SSL_ERROR_BASE + 28),
  114. "SSL received a malformed Client Hello handshake message.")
  115. ER3(SSL_ERROR_RX_MALFORMED_SERVER_HELLO , (SSL_ERROR_BASE + 29),
  116. "SSL received a malformed Server Hello handshake message.")
  117. ER3(SSL_ERROR_RX_MALFORMED_CERTIFICATE , (SSL_ERROR_BASE + 30),
  118. "SSL received a malformed Certificate handshake message.")
  119. ER3(SSL_ERROR_RX_MALFORMED_SERVER_KEY_EXCH , (SSL_ERROR_BASE + 31),
  120. "SSL received a malformed Server Key Exchange handshake message.")
  121. ER3(SSL_ERROR_RX_MALFORMED_CERT_REQUEST , (SSL_ERROR_BASE + 32),
  122. "SSL received a malformed Certificate Request handshake message.")
  123. ER3(SSL_ERROR_RX_MALFORMED_HELLO_DONE , (SSL_ERROR_BASE + 33),
  124. "SSL received a malformed Server Hello Done handshake message.")
  125. ER3(SSL_ERROR_RX_MALFORMED_CERT_VERIFY , (SSL_ERROR_BASE + 34),
  126. "SSL received a malformed Certificate Verify handshake message.")
  127. ER3(SSL_ERROR_RX_MALFORMED_CLIENT_KEY_EXCH , (SSL_ERROR_BASE + 35),
  128. "SSL received a malformed Client Key Exchange handshake message.")
  129. ER3(SSL_ERROR_RX_MALFORMED_FINISHED , (SSL_ERROR_BASE + 36),
  130. "SSL received a malformed Finished handshake message.")
  131. /*
  132. * Received a malformed (too long or short) SSL record.
  133. */
  134. ER3(SSL_ERROR_RX_MALFORMED_CHANGE_CIPHER , (SSL_ERROR_BASE + 37),
  135. "SSL received a malformed Change Cipher Spec record.")
  136. ER3(SSL_ERROR_RX_MALFORMED_ALERT , (SSL_ERROR_BASE + 38),
  137. "SSL received a malformed Alert record.")
  138. ER3(SSL_ERROR_RX_MALFORMED_HANDSHAKE , (SSL_ERROR_BASE + 39),
  139. "SSL received a malformed Handshake record.")
  140. ER3(SSL_ERROR_RX_MALFORMED_APPLICATION_DATA , (SSL_ERROR_BASE + 40),
  141. "SSL received a malformed Application Data record.")
  142. /*
  143. * Received an SSL handshake that was inappropriate for the state we're in.
  144. * E.g. Server received message from server, or wrong state in state machine.
  145. */
  146. ER3(SSL_ERROR_RX_UNEXPECTED_HELLO_REQUEST , (SSL_ERROR_BASE + 41),
  147. "SSL received an unexpected Hello Request handshake message.")
  148. ER3(SSL_ERROR_RX_UNEXPECTED_CLIENT_HELLO , (SSL_ERROR_BASE + 42),
  149. "SSL received an unexpected Client Hello handshake message.")
  150. ER3(SSL_ERROR_RX_UNEXPECTED_SERVER_HELLO , (SSL_ERROR_BASE + 43),
  151. "SSL received an unexpected Server Hello handshake message.")
  152. ER3(SSL_ERROR_RX_UNEXPECTED_CERTIFICATE , (SSL_ERROR_BASE + 44),
  153. "SSL received an unexpected Certificate handshake message.")
  154. ER3(SSL_ERROR_RX_UNEXPECTED_SERVER_KEY_EXCH , (SSL_ERROR_BASE + 45),
  155. "SSL received an unexpected Server Key Exchange handshake message.")
  156. ER3(SSL_ERROR_RX_UNEXPECTED_CERT_REQUEST , (SSL_ERROR_BASE + 46),
  157. "SSL received an unexpected Certificate Request handshake message.")
  158. ER3(SSL_ERROR_RX_UNEXPECTED_HELLO_DONE , (SSL_ERROR_BASE + 47),
  159. "SSL received an unexpected Server Hello Done handshake message.")
  160. ER3(SSL_ERROR_RX_UNEXPECTED_CERT_VERIFY , (SSL_ERROR_BASE + 48),
  161. "SSL received an unexpected Certificate Verify handshake message.")
  162. ER3(SSL_ERROR_RX_UNEXPECTED_CLIENT_KEY_EXCH , (SSL_ERROR_BASE + 49),
  163. "SSL received an unexpected Cllient Key Exchange handshake message.")
  164. ER3(SSL_ERROR_RX_UNEXPECTED_FINISHED , (SSL_ERROR_BASE + 50),
  165. "SSL received an unexpected Finished handshake message.")
  166. /*
  167. * Received an SSL record that was inappropriate for the state we're in.
  168. */
  169. ER3(SSL_ERROR_RX_UNEXPECTED_CHANGE_CIPHER , (SSL_ERROR_BASE + 51),
  170. "SSL received an unexpected Change Cipher Spec record.")
  171. ER3(SSL_ERROR_RX_UNEXPECTED_ALERT , (SSL_ERROR_BASE + 52),
  172. "SSL received an unexpected Alert record.")
  173. ER3(SSL_ERROR_RX_UNEXPECTED_HANDSHAKE , (SSL_ERROR_BASE + 53),
  174. "SSL received an unexpected Handshake record.")
  175. ER3(SSL_ERROR_RX_UNEXPECTED_APPLICATION_DATA, (SSL_ERROR_BASE + 54),
  176. "SSL received an unexpected Application Data record.")
  177. /*
  178. * Received record/message with unknown discriminant.
  179. */
  180. ER3(SSL_ERROR_RX_UNKNOWN_RECORD_TYPE , (SSL_ERROR_BASE + 55),
  181. "SSL received a record with an unknown content type.")
  182. ER3(SSL_ERROR_RX_UNKNOWN_HANDSHAKE , (SSL_ERROR_BASE + 56),
  183. "SSL received a handshake message with an unknown message type.")
  184. ER3(SSL_ERROR_RX_UNKNOWN_ALERT , (SSL_ERROR_BASE + 57),
  185. "SSL received an alert record with an unknown alert description.")
  186. /*
  187. * Received an alert reporting what we did wrong. (more alerts above)
  188. */
  189. ER3(SSL_ERROR_CLOSE_NOTIFY_ALERT , (SSL_ERROR_BASE + 58),
  190. "SSL peer has closed this connection.")
  191. ER3(SSL_ERROR_HANDSHAKE_UNEXPECTED_ALERT , (SSL_ERROR_BASE + 59),
  192. "SSL peer was not expecting a handshake message it received.")
  193. ER3(SSL_ERROR_DECOMPRESSION_FAILURE_ALERT , (SSL_ERROR_BASE + 60),
  194. "SSL peer was unable to succesfully decompress an SSL record it received.")
  195. ER3(SSL_ERROR_HANDSHAKE_FAILURE_ALERT , (SSL_ERROR_BASE + 61),
  196. "SSL peer was unable to negotiate an acceptable set of security parameters.")
  197. ER3(SSL_ERROR_ILLEGAL_PARAMETER_ALERT , (SSL_ERROR_BASE + 62),
  198. "SSL peer rejected a handshake message for unacceptable content.")
  199. ER3(SSL_ERROR_UNSUPPORTED_CERT_ALERT , (SSL_ERROR_BASE + 63),
  200. "SSL peer does not support certificates of the type it received.")
  201. ER3(SSL_ERROR_CERTIFICATE_UNKNOWN_ALERT , (SSL_ERROR_BASE + 64),
  202. "SSL peer had some unspecified issue with the certificate it received.")
  203. ER3(SSL_ERROR_GENERATE_RANDOM_FAILURE , (SSL_ERROR_BASE + 65),
  204. "SSL experienced a failure of its random number generator.")
  205. ER3(SSL_ERROR_SIGN_HASHES_FAILURE , (SSL_ERROR_BASE + 66),
  206. "Unable to digitally sign data required to verify your certificate.")
  207. ER3(SSL_ERROR_EXTRACT_PUBLIC_KEY_FAILURE , (SSL_ERROR_BASE + 67),
  208. "SSL was unable to extract the public key from the peer's certificate.")
  209. ER3(SSL_ERROR_SERVER_KEY_EXCHANGE_FAILURE , (SSL_ERROR_BASE + 68),
  210. "Unspecified failure while processing SSL Server Key Exchange handshake.")
  211. ER3(SSL_ERROR_CLIENT_KEY_EXCHANGE_FAILURE , (SSL_ERROR_BASE + 69),
  212. "Unspecified failure while processing SSL Client Key Exchange handshake.")
  213. ER3(SSL_ERROR_ENCRYPTION_FAILURE , (SSL_ERROR_BASE + 70),
  214. "Bulk data encryption algorithm failed in selected cipher suite.")
  215. ER3(SSL_ERROR_DECRYPTION_FAILURE , (SSL_ERROR_BASE + 71),
  216. "Bulk data decryption algorithm failed in selected cipher suite.")
  217. ER3(SSL_ERROR_SOCKET_WRITE_FAILURE , (SSL_ERROR_BASE + 72),
  218. "Attempt to write encrypted data to underlying socket failed.")
  219. ER3(SSL_ERROR_MD5_DIGEST_FAILURE , (SSL_ERROR_BASE + 73),
  220. "MD5 digest function failed.")
  221. ER3(SSL_ERROR_SHA_DIGEST_FAILURE , (SSL_ERROR_BASE + 74),
  222. "SHA-1 digest function failed.")
  223. ER3(SSL_ERROR_MAC_COMPUTATION_FAILURE , (SSL_ERROR_BASE + 75),
  224. "MAC computation failed.")
  225. ER3(SSL_ERROR_SYM_KEY_CONTEXT_FAILURE , (SSL_ERROR_BASE + 76),
  226. "Failure to create Symmetric Key context.")
  227. ER3(SSL_ERROR_SYM_KEY_UNWRAP_FAILURE , (SSL_ERROR_BASE + 77),
  228. "Failure to unwrap the Symmetric key in Client Key Exchange message.")
  229. ER3(SSL_ERROR_PUB_KEY_SIZE_LIMIT_EXCEEDED , (SSL_ERROR_BASE + 78),
  230. "SSL Server attempted to use domestic-grade public key with export cipher suite.")
  231. ER3(SSL_ERROR_IV_PARAM_FAILURE , (SSL_ERROR_BASE + 79),
  232. "PKCS11 code failed to translate an IV into a param.")
  233. ER3(SSL_ERROR_INIT_CIPHER_SUITE_FAILURE , (SSL_ERROR_BASE + 80),
  234. "Failed to initialize the selected cipher suite.")
  235. ER3(SSL_ERROR_SESSION_KEY_GEN_FAILURE , (SSL_ERROR_BASE + 81),
  236. "Client failed to generate session keys for SSL session.")
  237. ER3(SSL_ERROR_NO_SERVER_KEY_FOR_ALG , (SSL_ERROR_BASE + 82),
  238. "Server has no key for the attempted key exchange algorithm.")
  239. ER3(SSL_ERROR_TOKEN_INSERTION_REMOVAL , (SSL_ERROR_BASE + 83),
  240. "PKCS#11 token was inserted or removed while operation was in progress.")
  241. ER3(SSL_ERROR_TOKEN_SLOT_NOT_FOUND , (SSL_ERROR_BASE + 84),
  242. "No PKCS#11 token could be found to do a required operation.")
  243. ER3(SSL_ERROR_NO_COMPRESSION_OVERLAP , (SSL_ERROR_BASE + 85),
  244. "Cannot communicate securely with peer: no common compression algorithm(s).")
  245. ER3(SSL_ERROR_HANDSHAKE_NOT_COMPLETED , (SSL_ERROR_BASE + 86),
  246. "Cannot initiate another SSL handshake until current handshake is complete.")
  247. ER3(SSL_ERROR_BAD_HANDSHAKE_HASH_VALUE , (SSL_ERROR_BASE + 87),
  248. "Received incorrect handshakes hash values from peer.")
  249. ER3(SSL_ERROR_CERT_KEA_MISMATCH , (SSL_ERROR_BASE + 88),
  250. "The certificate provided cannot be used with the selected key exchange algorithm.")
  251. ER3(SSL_ERROR_NO_TRUSTED_SSL_CLIENT_CA , (SSL_ERROR_BASE + 89),
  252. "No certificate authority is trusted for SSL client authentication.")
  253. ER3(SSL_ERROR_SESSION_NOT_FOUND , (SSL_ERROR_BASE + 90),
  254. "Client's SSL session ID not found in server's session cache.")
  255. ER3(SSL_ERROR_DECRYPTION_FAILED_ALERT , (SSL_ERROR_BASE + 91),
  256. "Peer was unable to decrypt an SSL record it received.")
  257. ER3(SSL_ERROR_RECORD_OVERFLOW_ALERT , (SSL_ERROR_BASE + 92),
  258. "Peer received an SSL record that was longer than is permitted.")
  259. ER3(SSL_ERROR_UNKNOWN_CA_ALERT , (SSL_ERROR_BASE + 93),
  260. "Peer does not recognize and trust the CA that issued your certificate.")
  261. ER3(SSL_ERROR_ACCESS_DENIED_ALERT , (SSL_ERROR_BASE + 94),
  262. "Peer received a valid certificate, but access was denied.")
  263. ER3(SSL_ERROR_DECODE_ERROR_ALERT , (SSL_ERROR_BASE + 95),
  264. "Peer could not decode an SSL handshake message.")
  265. ER3(SSL_ERROR_DECRYPT_ERROR_ALERT , (SSL_ERROR_BASE + 96),
  266. "Peer reports failure of signature verification or key exchange.")
  267. ER3(SSL_ERROR_EXPORT_RESTRICTION_ALERT , (SSL_ERROR_BASE + 97),
  268. "Peer reports negotiation not in compliance with export regulations.")
  269. ER3(SSL_ERROR_PROTOCOL_VERSION_ALERT , (SSL_ERROR_BASE + 98),
  270. "Peer reports incompatible or unsupported protocol version.")
  271. ER3(SSL_ERROR_INSUFFICIENT_SECURITY_ALERT , (SSL_ERROR_BASE + 99),
  272. "Server requires ciphers more secure than those supported by client.")
  273. ER3(SSL_ERROR_INTERNAL_ERROR_ALERT , (SSL_ERROR_BASE + 100),
  274. "Peer reports it experienced an internal error.")
  275. ER3(SSL_ERROR_USER_CANCELED_ALERT , (SSL_ERROR_BASE + 101),
  276. "Peer user canceled handshake.")
  277. ER3(SSL_ERROR_NO_RENEGOTIATION_ALERT , (SSL_ERROR_BASE + 102),
  278. "Peer does not permit renegotiation of SSL security parameters.")