err.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /* err.h
  2. *
  3. * Copyright (C) 2006-2022 wolfSSL Inc.
  4. *
  5. * This file is part of wolfSSL.
  6. *
  7. * wolfSSL 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. * wolfSSL 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-1335, USA
  20. */
  21. #ifndef WOLFSSL_OPENSSL_ERR_
  22. #define WOLFSSL_OPENSSL_ERR_
  23. #include <wolfssl/wolfcrypt/logging.h>
  24. #if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)
  25. /* err.h for openssl */
  26. #define ERR_load_ERR_strings wolfSSL_ERR_load_ERR_strings
  27. #define ERR_load_crypto_strings wolfSSL_ERR_load_crypto_strings
  28. #define ERR_load_CRYPTO_strings wolfSSL_ERR_load_crypto_strings
  29. #define ERR_peek_last_error wolfSSL_ERR_peek_last_error
  30. /* fatal error */
  31. #define ERR_R_MALLOC_FAILURE MEMORY_E
  32. #define ERR_R_PASSED_NULL_PARAMETER BAD_FUNC_ARG
  33. #define ERR_R_DISABLED NOT_COMPILED_IN
  34. #define ERR_R_PASSED_INVALID_ARGUMENT BAD_FUNC_ARG
  35. #define RSA_R_UNKNOWN_PADDING_TYPE RSA_PAD_E
  36. #define EC_R_BUFFER_TOO_SMALL BUFFER_E
  37. #define ERR_TXT_MALLOCED 1
  38. /* SSL function codes */
  39. #define RSA_F_RSA_OSSL_PRIVATE_ENCRYPT 1
  40. #define SSL_F_SSL_CTX_USE_CERTIFICATE_FILE 2
  41. #define SSL_F_SSL_USE_PRIVATEKEY 3
  42. #define EC_F_EC_GFP_SIMPLE_POINT2OCT 4
  43. /* reasons */
  44. #define ERR_R_SYS_LIB 1
  45. #define PKCS12_R_MAC_VERIFY_FAILURE 2
  46. #define RSAerr(f,r) ERR_put_error(0,(f),(r),__FILE__,__LINE__)
  47. #define SSLerr(f,r) ERR_put_error(0,(f),(r),__FILE__,__LINE__)
  48. #define ECerr(f,r) ERR_put_error(0,(f),(r),__FILE__,__LINE__)
  49. #endif /* OPENSSL_EXTRA || OPENSSL_EXTRA_X509_SMALL */
  50. #endif /* WOLFSSL_OPENSSL_ERR_ */