err.h (3438B)
1 /* err.h 2 * 3 * Copyright (C) 2006-2025 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 3 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 22 #ifndef WOLFSSL_OPENSSL_ERR_ 23 #define WOLFSSL_OPENSSL_ERR_ 24 25 #include <wolfssl/wolfcrypt/logging.h> 26 27 #if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL) 28 29 #define wolfSSL_RSAerr(f,r) wolfSSL_ERR_put_error(0,(f),(r),__FILE__,__LINE__) 30 #define wolfSSL_SSLerr(f,r) wolfSSL_ERR_put_error(0,(f),(r),__FILE__,__LINE__) 31 #define wolfSSL_ECerr(f,r) wolfSSL_ERR_put_error(0,(f),(r),__FILE__,__LINE__) 32 33 #define WOLFSSL_ERR_TXT_MALLOCED 1 34 35 /* SSL function codes */ 36 #define WOLFSSL_RSA_F_RSA_PADDING_ADD_SSLV23 0 37 #define WOLFSSL_RSA_F_RSA_OSSL_PRIVATE_ENCRYPT 1 38 #define WOLFSSL_SSL_F_SSL_CTX_USE_CERTIFICATE_FILE 2 39 #define WOLFSSL_SSL_F_SSL_USE_PRIVATEKEY 3 40 #define WOLFSSL_EC_F_EC_GFP_SIMPLE_POINT2OCT 4 41 42 /* reasons */ 43 #define WOLFSSL_ERR_R_SYS_LIB 1 44 #define WOLFSSL_PKCS12_R_MAC_VERIFY_FAILURE 2 45 46 #ifndef OPENSSL_COEXIST 47 48 /* err.h for openssl */ 49 #define ERR_load_ERR_strings wolfSSL_ERR_load_ERR_strings 50 #define ERR_load_crypto_strings wolfSSL_ERR_load_crypto_strings 51 #define ERR_load_CRYPTO_strings wolfSSL_ERR_load_crypto_strings 52 #define ERR_peek_last_error wolfSSL_ERR_peek_last_error 53 54 /* fatal error */ 55 #define ERR_R_MALLOC_FAILURE MEMORY_E 56 #define ERR_R_PASSED_NULL_PARAMETER BAD_FUNC_ARG 57 #define ERR_R_DISABLED NOT_COMPILED_IN 58 #define ERR_R_PASSED_INVALID_ARGUMENT BAD_FUNC_ARG 59 #define RSA_R_UNKNOWN_PADDING_TYPE RSA_PAD_E 60 #define RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE WC_KEY_SIZE_E 61 #define EC_R_BUFFER_TOO_SMALL BUFFER_E 62 63 #define ERR_TXT_MALLOCED WOLFSSL_ERR_TXT_MALLOCED 64 65 /* SSL function codes */ 66 #define RSA_F_RSA_PADDING_ADD_SSLV23 WOLFSSL_RSA_F_RSA_PADDING_ADD_SSLV23 67 #define RSA_F_RSA_OSSL_PRIVATE_ENCRYPT WOLFSSL_RSA_F_RSA_OSSL_PRIVATE_ENCRYPT 68 #define SSL_F_SSL_CTX_USE_CERTIFICATE_FILE WOLFSSL_SSL_F_SSL_CTX_USE_CERTIFICATE_FILE 69 #define SSL_F_SSL_USE_PRIVATEKEY WOLFSSL_SSL_F_SSL_USE_PRIVATEKEY 70 #define EC_F_EC_GFP_SIMPLE_POINT2OCT WOLFSSL_EC_F_EC_GFP_SIMPLE_POINT2OCT 71 72 /* reasons */ 73 #define ERR_R_SYS_LIB WOLFSSL_ERR_R_SYS_LIB 74 #define PKCS12_R_MAC_VERIFY_FAILURE WOLFSSL_PKCS12_R_MAC_VERIFY_FAILURE 75 76 #define RSAerr(f,r) wolfSSL_RSAerr(f,r) 77 #define SSLerr(f,r) wolfSSL_SSLerr(f,r) 78 #define ECerr(f,r) wolfSSL_ECerr(f,r) 79 80 #endif /* !OPENSSL_COEXIST */ 81 82 #endif /* OPENSSL_EXTRA || OPENSSL_EXTRA_X509_SMALL */ 83 84 #endif /* WOLFSSL_OPENSSL_ERR_ */