Ignore:
Timestamp:
Feb 7, 2019, 8:36:33 AM (5 years ago)
Author:
coas-nagasima
Message:

wolfsslを3.15.7にバージョンアップ

File:
1 edited

Legend:

Unmodified
Added
Removed
  • asp3_tinet_ecnl_arm/trunk/wolfssl-3.12.2/wolfssl/wolfcrypt/logging.h

    r352 r372  
    2020 */
    2121
     22/*!
     23    \file wolfssl/wolfcrypt/logging.h
     24*/
     25
    2226
    2327/* submitted by eof */
     
    3438
    3539
    36 enum  CYA_Log_Levels {
     40enum wc_LogLevels {
    3741    ERROR_LOG = 0,
    3842    INFO_LOG,
     
    4246};
    4347
     48#ifdef WOLFSSL_FUNC_TIME
     49/* WARNING: This code is only to be used for debugging performance.
     50 *          The code is not thread-safe.
     51 *          Do not use WOLFSSL_FUNC_TIME in production code.
     52 */
     53enum wc_FuncNum {
     54    WC_FUNC_HELLO_REQUEST_SEND = 0,
     55    WC_FUNC_HELLO_REQUEST_DO,
     56    WC_FUNC_CLIENT_HELLO_SEND,
     57    WC_FUNC_CLIENT_HELLO_DO,
     58    WC_FUNC_SERVER_HELLO_SEND,
     59    WC_FUNC_SERVER_HELLO_DO,
     60    WC_FUNC_ENCRYPTED_EXTENSIONS_SEND,
     61    WC_FUNC_ENCRYPTED_EXTENSIONS_DO,
     62    WC_FUNC_CERTIFICATE_REQUEST_SEND,
     63    WC_FUNC_CERTIFICATE_REQUEST_DO,
     64    WC_FUNC_CERTIFICATE_SEND,
     65    WC_FUNC_CERTIFICATE_DO,
     66    WC_FUNC_CERTIFICATE_VERIFY_SEND,
     67    WC_FUNC_CERTIFICATE_VERIFY_DO,
     68    WC_FUNC_FINISHED_SEND,
     69    WC_FUNC_FINISHED_DO,
     70    WC_FUNC_KEY_UPDATE_SEND,
     71    WC_FUNC_KEY_UPDATE_DO,
     72    WC_FUNC_EARLY_DATA_SEND,
     73    WC_FUNC_EARLY_DATA_DO,
     74    WC_FUNC_NEW_SESSION_TICKET_SEND,
     75    WC_FUNC_NEW_SESSION_TICKET_DO,
     76    WC_FUNC_SERVER_HELLO_DONE_SEND,
     77    WC_FUNC_SERVER_HELLO_DONE_DO,
     78    WC_FUNC_TICKET_SEND,
     79    WC_FUNC_TICKET_DO,
     80    WC_FUNC_CLIENT_KEY_EXCHANGE_SEND,
     81    WC_FUNC_CLIENT_KEY_EXCHANGE_DO,
     82    WC_FUNC_CERTIFICATE_STATUS_SEND,
     83    WC_FUNC_CERTIFICATE_STATUS_DO,
     84    WC_FUNC_SERVER_KEY_EXCHANGE_SEND,
     85    WC_FUNC_SERVER_KEY_EXCHANGE_DO,
     86    WC_FUNC_END_OF_EARLY_DATA_SEND,
     87    WC_FUNC_END_OF_EARLY_DATA_DO,
     88    WC_FUNC_COUNT
     89};
     90#endif
     91
    4492typedef void (*wolfSSL_Logging_cb)(const int logLevel,
    4593                                  const char *const logMessage);
    4694
    4795WOLFSSL_API int wolfSSL_SetLoggingCb(wolfSSL_Logging_cb log_function);
     96
     97/* turn logging on, only if compiled in */
     98WOLFSSL_API int  wolfSSL_Debugging_ON(void);
     99/* turn logging off */
     100WOLFSSL_API void wolfSSL_Debugging_OFF(void);
     101
    48102
    49103#if defined(OPENSSL_EXTRA) || defined(DEBUG_WOLFSSL_VERBOSE)
     
    56110    WOLFSSL_LOCAL void wc_RemoveErrorNode(int index);
    57111    WOLFSSL_LOCAL void wc_ClearErrorNodes(void);
     112    WOLFSSL_LOCAL int wc_PullErrorNode(const char **file, const char **reason,
     113                            int *line);
    58114    WOLFSSL_API   int wc_SetLoggingHeap(void* h);
     115    WOLFSSL_API   int wc_ERR_remove_state(void);
    59116    #if !defined(NO_FILESYSTEM) && !defined(NO_STDIO_FILESYSTEM)
    60         WOLFSSL_API   void wc_ERR_print_errors_fp(FILE* fp);
     117        WOLFSSL_API   void wc_ERR_print_errors_fp(XFILE fp);
    61118    #endif
    62 #endif /* defined(OPENSSL_EXTRA) || defined(DEBUG_WOLFSSL_VERBOSE) */
     119#endif /* OPENSSL_EXTRA || DEBUG_WOLFSSL_VERBOSE */
    63120
    64 #ifdef DEBUG_WOLFSSL
     121#ifdef WOLFSSL_FUNC_TIME
     122    /* WARNING: This code is only to be used for debugging performance.
     123     *          The code is not thread-safe.
     124     *          Do not use WOLFSSL_FUNC_TIME in production code.
     125     */
     126    WOLFSSL_API void WOLFSSL_START(int funcNum);
     127    WOLFSSL_API void WOLFSSL_END(int funcNum);
     128    WOLFSSL_API void WOLFSSL_TIME(int count);
     129#else
     130    #define WOLFSSL_START(n)
     131    #define WOLFSSL_END(n)
     132    #define WOLFSSL_TIME(n)
     133#endif
     134
     135#if defined(DEBUG_WOLFSSL) && !defined(WOLFSSL_DEBUG_ERRORS_ONLY)
    65136    #if defined(_WIN32)
    66137        #if defined(INTIME_RTOS)
     
    74145    #define WOLFSSL_LOG_CAT(a, m, b) #a " " m " "  #b
    75146
    76     void WOLFSSL_ENTER(const char* msg);
    77     void WOLFSSL_LEAVE(const char* msg, int ret);
     147    WOLFSSL_API void WOLFSSL_ENTER(const char* msg);
     148    WOLFSSL_API void WOLFSSL_LEAVE(const char* msg, int ret);
    78149    #define WOLFSSL_STUB(m) \
    79150        WOLFSSL_MSG(WOLFSSL_LOG_CAT(wolfSSL Stub, m, not implemented))
    80151
    81     void WOLFSSL_MSG(const char* msg);
    82     void WOLFSSL_BUFFER(const byte* buffer, word32 length);
     152    WOLFSSL_API void WOLFSSL_MSG(const char* msg);
     153    WOLFSSL_API void WOLFSSL_BUFFER(const byte* buffer, word32 length);
    83154
    84 #else /* DEBUG_WOLFSSL   */
     155#else
    85156
    86157    #define WOLFSSL_ENTER(m)
     
    91162    #define WOLFSSL_BUFFER(b, l)
    92163
    93 #endif /* DEBUG_WOLFSSL */
     164#endif /* DEBUG_WOLFSSL && !WOLFSSL_DEBUG_ERRORS_ONLY */
    94165
    95 #if (defined(DEBUG_WOLFSSL) || defined(WOLFSSL_NGINX)) || defined(WOLFSSL_HAPROXY)
    96     #if (defined(OPENSSL_EXTRA) || defined(DEBUG_WOLFSSL_VERBOSE))
    97     void WOLFSSL_ERROR_LINE(int err, const char* func, unsigned int line,
     166#if defined(DEBUG_WOLFSSL) || defined(OPENSSL_ALL) || defined(WOLFSSL_NGINX) || defined(WOLFSSL_HAPROXY)
     167
     168    #if defined(OPENSSL_EXTRA) || defined(DEBUG_WOLFSSL_VERBOSE)
     169        WOLFSSL_API void WOLFSSL_ERROR_LINE(int err, const char* func, unsigned int line,
    98170            const char* file, void* ctx);
    99     #define WOLFSSL_ERROR(x) WOLFSSL_ERROR_LINE((x), __func__, __LINE__, __FILE__,NULL)
     171        #define WOLFSSL_ERROR(x) \
     172            WOLFSSL_ERROR_LINE((x), __func__, __LINE__, __FILE__, NULL)
    100173    #else
    101     void WOLFSSL_ERROR(int);
     174        WOLFSSL_API void WOLFSSL_ERROR(int err);
    102175    #endif
     176    WOLFSSL_API void WOLFSSL_ERROR_MSG(const char* msg);
     177
    103178#else
    104179    #define WOLFSSL_ERROR(e)
     180    #define WOLFSSL_ERROR_MSG(m)
    105181#endif
    106182
Note: See TracChangeset for help on using the changeset viewer.