error-ssl.h 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. /* error-ssl.h
  2. *
  3. * Copyright (C) 2006-2014 wolfSSL Inc.
  4. *
  5. * This file is part of CyaSSL.
  6. *
  7. * CyaSSL is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * CyaSSL is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
  20. */
  21. #ifndef CYASSL_ERROR_H
  22. #define CYASSL_ERROR_H
  23. #include <cyassl/ctaocrypt/error-crypt.h> /* pull in CTaoCrypt errors */
  24. #ifdef __cplusplus
  25. extern "C" {
  26. #endif
  27. enum CyaSSL_ErrorCodes {
  28. INPUT_CASE_ERROR = -201, /* process input state error */
  29. PREFIX_ERROR = -202, /* bad index to key rounds */
  30. MEMORY_ERROR = -203, /* out of memory */
  31. VERIFY_FINISHED_ERROR = -204, /* verify problem on finished */
  32. VERIFY_MAC_ERROR = -205, /* verify mac problem */
  33. PARSE_ERROR = -206, /* parse error on header */
  34. UNKNOWN_HANDSHAKE_TYPE = -207, /* weird handshake type */
  35. SOCKET_ERROR_E = -208, /* error state on socket */
  36. SOCKET_NODATA = -209, /* expected data, not there */
  37. INCOMPLETE_DATA = -210, /* don't have enough data to
  38. complete task */
  39. UNKNOWN_RECORD_TYPE = -211, /* unknown type in record hdr */
  40. DECRYPT_ERROR = -212, /* error during decryption */
  41. FATAL_ERROR = -213, /* recvd alert fatal error */
  42. ENCRYPT_ERROR = -214, /* error during encryption */
  43. FREAD_ERROR = -215, /* fread problem */
  44. NO_PEER_KEY = -216, /* need peer's key */
  45. NO_PRIVATE_KEY = -217, /* need the private key */
  46. RSA_PRIVATE_ERROR = -218, /* error during rsa priv op */
  47. NO_DH_PARAMS = -219, /* server missing DH params */
  48. BUILD_MSG_ERROR = -220, /* build message failure */
  49. BAD_HELLO = -221, /* client hello malformed */
  50. DOMAIN_NAME_MISMATCH = -222, /* peer subject name mismatch */
  51. WANT_READ = -223, /* want read, call again */
  52. NOT_READY_ERROR = -224, /* handshake layer not ready */
  53. PMS_VERSION_ERROR = -225, /* pre m secret version error */
  54. VERSION_ERROR = -226, /* record layer version error */
  55. WANT_WRITE = -227, /* want write, call again */
  56. BUFFER_ERROR = -228, /* malformed buffer input */
  57. VERIFY_CERT_ERROR = -229, /* verify cert error */
  58. VERIFY_SIGN_ERROR = -230, /* verify sign error */
  59. CLIENT_ID_ERROR = -231, /* psk client identity error */
  60. SERVER_HINT_ERROR = -232, /* psk server hint error */
  61. PSK_KEY_ERROR = -233, /* psk key error */
  62. ZLIB_INIT_ERROR = -234, /* zlib init error */
  63. ZLIB_COMPRESS_ERROR = -235, /* zlib compression error */
  64. ZLIB_DECOMPRESS_ERROR = -236, /* zlib decompression error */
  65. GETTIME_ERROR = -237, /* gettimeofday failed ??? */
  66. GETITIMER_ERROR = -238, /* getitimer failed ??? */
  67. SIGACT_ERROR = -239, /* sigaction failed ??? */
  68. SETITIMER_ERROR = -240, /* setitimer failed ??? */
  69. LENGTH_ERROR = -241, /* record layer length error */
  70. PEER_KEY_ERROR = -242, /* can't decode peer key */
  71. ZERO_RETURN = -243, /* peer sent close notify */
  72. SIDE_ERROR = -244, /* wrong client/server type */
  73. NO_PEER_CERT = -245, /* peer didn't send key */
  74. NTRU_KEY_ERROR = -246, /* NTRU key error */
  75. NTRU_DRBG_ERROR = -247, /* NTRU drbg error */
  76. NTRU_ENCRYPT_ERROR = -248, /* NTRU encrypt error */
  77. NTRU_DECRYPT_ERROR = -249, /* NTRU decrypt error */
  78. ECC_CURVETYPE_ERROR = -250, /* Bad ECC Curve Type */
  79. ECC_CURVE_ERROR = -251, /* Bad ECC Curve */
  80. ECC_PEERKEY_ERROR = -252, /* Bad Peer ECC Key */
  81. ECC_MAKEKEY_ERROR = -253, /* Bad Make ECC Key */
  82. ECC_EXPORT_ERROR = -254, /* Bad ECC Export Key */
  83. ECC_SHARED_ERROR = -255, /* Bad ECC Shared Secret */
  84. NOT_CA_ERROR = -257, /* Not a CA cert error */
  85. BAD_PATH_ERROR = -258, /* Bad path for opendir */
  86. BAD_CERT_MANAGER_ERROR = -259, /* Bad Cert Manager */
  87. OCSP_CERT_REVOKED = -260, /* OCSP Certificate revoked */
  88. CRL_CERT_REVOKED = -261, /* CRL Certificate revoked */
  89. CRL_MISSING = -262, /* CRL Not loaded */
  90. MONITOR_RUNNING_E = -263, /* CRL Monitor already running */
  91. THREAD_CREATE_E = -264, /* Thread Create Error */
  92. OCSP_NEED_URL = -265, /* OCSP need an URL for lookup */
  93. OCSP_CERT_UNKNOWN = -266, /* OCSP responder doesn't know */
  94. OCSP_LOOKUP_FAIL = -267, /* OCSP lookup not successful */
  95. MAX_CHAIN_ERROR = -268, /* max chain depth exceeded */
  96. COOKIE_ERROR = -269, /* dtls cookie error */
  97. SEQUENCE_ERROR = -270, /* dtls sequence error */
  98. SUITES_ERROR = -271, /* suites pointer error */
  99. SSL_NO_PEM_HEADER = -272, /* no PEM header found */
  100. OUT_OF_ORDER_E = -273, /* out of order message */
  101. BAD_KEA_TYPE_E = -274, /* bad KEA type found */
  102. SANITY_CIPHER_E = -275, /* sanity check on cipher error */
  103. RECV_OVERFLOW_E = -276, /* RXCB returned more than rqed */
  104. GEN_COOKIE_E = -277, /* Generate Cookie Error */
  105. NO_PEER_VERIFY = -278, /* Need peer cert verify Error */
  106. FWRITE_ERROR = -279, /* fwrite problem */
  107. CACHE_MATCH_ERROR = -280, /* chache hdr match error */
  108. UNKNOWN_SNI_HOST_NAME_E = -281, /* Unrecognized host name Error */
  109. UNKNOWN_MAX_FRAG_LEN_E = -282, /* Unrecognized max frag len Error */
  110. /* add strings to SetErrorString !!!!! */
  111. KEYUSE_SIGNATURE_E = -283, /* KeyUse digSignature error */
  112. KEYUSE_ENCIPHER_E = -285, /* KeyUse keyEncipher error */
  113. EXTKEYUSE_AUTH_E = -286, /* ExtKeyUse server|client_auth */
  114. /* begin negotiation parameter errors */
  115. UNSUPPORTED_SUITE = -290, /* unsupported cipher suite */
  116. MATCH_SUITE_ERROR = -291 /* can't match cipher suite */
  117. /* end negotiation parameter errors only 10 for now */
  118. /* add strings to SetErrorString !!!!! */
  119. };
  120. #ifdef CYASSL_CALLBACKS
  121. enum {
  122. MIN_PARAM_ERR = UNSUPPORTED_SUITE,
  123. MAX_PARAM_ERR = MIN_PARAM_ERR - 10
  124. };
  125. #endif
  126. CYASSL_LOCAL
  127. void SetErrorString(int err, char* buff);
  128. #ifdef __cplusplus
  129. } /* extern "C" */
  130. #endif
  131. #endif /* CyaSSL_ERROR_H */