PageRenderTime 43ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 0ms

/cyassl/error.h

https://github.com/andersmalm/cyassl
C Header | 140 lines | 98 code | 17 blank | 25 comment | 0 complexity | 506c930a792a2642bb73bcab6f336088 MD5 | raw file
Possible License(s): GPL-2.0
  1. /* error.h
  2. *
  3. * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
  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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
  20. */
  21. #ifndef CYASSL_ERROR_H
  22. #define CYASSL_ERROR_H
  23. #include <cyassl/ctaocrypt/error.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. BAD_MUTEX_ERROR = -256, /* Bad mutex */
  85. NOT_CA_ERROR = -257, /* Not a CA cert error */
  86. BAD_PATH_ERROR = -258, /* Bad path for opendir */
  87. BAD_CERT_MANAGER_ERROR = -259, /* Bad Cert Manager */
  88. OCSP_CERT_REVOKED = -260, /* OCSP Certificate revoked */
  89. CRL_CERT_REVOKED = -261, /* CRL Certificate revoked */
  90. CRL_MISSING = -262, /* CRL Not loaded */
  91. MONITOR_RUNNING_E = -263, /* CRL Monitor already running */
  92. THREAD_CREATE_E = -264, /* Thread Create Error */
  93. OCSP_NEED_URL = -265, /* OCSP need an URL for lookup */
  94. OCSP_CERT_UNKNOWN = -266, /* OCSP responder doesn't know */
  95. OCSP_LOOKUP_FAIL = -267, /* OCSP lookup not successful */
  96. MAX_CHAIN_ERROR = -268, /* max chain depth exceeded */
  97. COOKIE_ERROR = -269, /* dtls cookie error */
  98. SEQUENCE_ERROR = -270, /* dtls sequence error */
  99. SUITES_ERROR = -271, /* suites pointer error */
  100. SSL_NO_PEM_HEADER = -272, /* no PEM header found */
  101. OUT_OF_ORDER_E = -273, /* out of order message */
  102. BAD_KEA_TYPE_E = -274, /* bad KEA type found */
  103. SANITY_CIPHER_E = -275, /* sanity check on cipher error */
  104. RECV_OVERFLOW_E = -276, /* RXCB returned more than rqed */
  105. /* add strings to SetErrorString !!!!! */
  106. /* begin negotiation parameter errors */
  107. UNSUPPORTED_SUITE = -290, /* unsupported cipher suite */
  108. MATCH_SUITE_ERROR = -291 /* can't match cipher suite */
  109. /* end negotiation parameter errors only 10 for now */
  110. /* add strings to SetErrorString !!!!! */
  111. };
  112. #ifdef CYASSL_CALLBACKS
  113. enum {
  114. MIN_PARAM_ERR = UNSUPPORTED_SUITE,
  115. MAX_PARAM_ERR = MIN_PARAM_ERR - 10
  116. };
  117. #endif
  118. CYASSL_LOCAL
  119. void SetErrorString(int error, char* buffer);
  120. #ifdef __cplusplus
  121. } /* extern "C" */
  122. #endif
  123. #endif /* CyaSSL_ERROR_H */