wolfSSL SSL/TLS library, support up to TLS1.3

Dependents:   CyaSSL-Twitter-OAuth4Tw Example-client-tls-cert TwitterReader TweetTest ... more

Committer:
wolfSSL
Date:
Tue Aug 22 10:48:22 2017 +0000
Revision:
13:f67a6c6013ca
Parent:
11:cee25a834751
wolfSSL3.12.0 with TLS1.3

Who changed what in which revision?

UserRevisionLine numberNew contents of line
wolfSSL 11:cee25a834751 1 /* sniffer.h
wolfSSL 11:cee25a834751 2 *
wolfSSL 11:cee25a834751 3 * Copyright (C) 2006-2016 wolfSSL Inc.
wolfSSL 11:cee25a834751 4 *
wolfSSL 11:cee25a834751 5 * This file is part of wolfSSL.
wolfSSL 11:cee25a834751 6 *
wolfSSL 11:cee25a834751 7 * wolfSSL is free software; you can redistribute it and/or modify
wolfSSL 11:cee25a834751 8 * it under the terms of the GNU General Public License as published by
wolfSSL 11:cee25a834751 9 * the Free Software Foundation; either version 2 of the License, or
wolfSSL 11:cee25a834751 10 * (at your option) any later version.
wolfSSL 11:cee25a834751 11 *
wolfSSL 11:cee25a834751 12 * wolfSSL is distributed in the hope that it will be useful,
wolfSSL 11:cee25a834751 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
wolfSSL 11:cee25a834751 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
wolfSSL 11:cee25a834751 15 * GNU General Public License for more details.
wolfSSL 11:cee25a834751 16 *
wolfSSL 11:cee25a834751 17 * You should have received a copy of the GNU General Public License
wolfSSL 11:cee25a834751 18 * along with this program; if not, write to the Free Software
wolfSSL 11:cee25a834751 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
wolfSSL 11:cee25a834751 20 */
wolfSSL 11:cee25a834751 21
wolfSSL 11:cee25a834751 22
wolfSSL 11:cee25a834751 23
wolfSSL 11:cee25a834751 24 #ifndef WOLFSSL_SNIFFER_H
wolfSSL 11:cee25a834751 25 #define WOLFSSL_SNIFFER_H
wolfSSL 11:cee25a834751 26
wolfSSL 11:cee25a834751 27 #include <wolfssl/wolfcrypt/settings.h>
wolfSSL 11:cee25a834751 28
wolfSSL 11:cee25a834751 29 #ifdef _WIN32
wolfSSL 11:cee25a834751 30 #ifdef SSL_SNIFFER_EXPORTS
wolfSSL 11:cee25a834751 31 #define SSL_SNIFFER_API __declspec(dllexport)
wolfSSL 11:cee25a834751 32 #else
wolfSSL 11:cee25a834751 33 #define SSL_SNIFFER_API __declspec(dllimport)
wolfSSL 11:cee25a834751 34 #endif
wolfSSL 11:cee25a834751 35 #else
wolfSSL 11:cee25a834751 36 #define SSL_SNIFFER_API
wolfSSL 11:cee25a834751 37 #endif /* _WIN32 */
wolfSSL 11:cee25a834751 38
wolfSSL 11:cee25a834751 39
wolfSSL 11:cee25a834751 40 #ifdef __cplusplus
wolfSSL 11:cee25a834751 41 extern "C" {
wolfSSL 11:cee25a834751 42 #endif
wolfSSL 11:cee25a834751 43
wolfSSL 11:cee25a834751 44 /* @param typeK: (formerly keyType) was shadowing a global declaration in
wolfSSL 11:cee25a834751 45 * wolfssl/wolfcrypt/asn.h line 175
wolfSSL 11:cee25a834751 46 */
wolfSSL 11:cee25a834751 47 WOLFSSL_API
wolfSSL 11:cee25a834751 48 SSL_SNIFFER_API int ssl_SetPrivateKey(const char* address, int port,
wolfSSL 11:cee25a834751 49 const char* keyFile, int typeK,
wolfSSL 11:cee25a834751 50 const char* password, char* error);
wolfSSL 11:cee25a834751 51
wolfSSL 11:cee25a834751 52 WOLFSSL_API
wolfSSL 11:cee25a834751 53 SSL_SNIFFER_API int ssl_SetNamedPrivateKey(const char* name,
wolfSSL 11:cee25a834751 54 const char* address, int port,
wolfSSL 11:cee25a834751 55 const char* keyFile, int typeK,
wolfSSL 11:cee25a834751 56 const char* password, char* error);
wolfSSL 11:cee25a834751 57
wolfSSL 11:cee25a834751 58 WOLFSSL_API
wolfSSL 11:cee25a834751 59 SSL_SNIFFER_API int ssl_DecodePacket(const unsigned char* packet, int length,
wolfSSL 11:cee25a834751 60 unsigned char** data, char* error);
wolfSSL 11:cee25a834751 61
wolfSSL 11:cee25a834751 62 WOLFSSL_API
wolfSSL 11:cee25a834751 63 SSL_SNIFFER_API int ssl_FreeDecodeBuffer(unsigned char** data, char* error);
wolfSSL 11:cee25a834751 64
wolfSSL 11:cee25a834751 65 WOLFSSL_API
wolfSSL 11:cee25a834751 66 SSL_SNIFFER_API int ssl_FreeZeroDecodeBuffer(unsigned char** data, int sz,
wolfSSL 11:cee25a834751 67 char* error);
wolfSSL 11:cee25a834751 68
wolfSSL 11:cee25a834751 69 WOLFSSL_API
wolfSSL 11:cee25a834751 70 SSL_SNIFFER_API int ssl_Trace(const char* traceFile, char* error);
wolfSSL 11:cee25a834751 71
wolfSSL 11:cee25a834751 72 WOLFSSL_API
wolfSSL 11:cee25a834751 73 SSL_SNIFFER_API int ssl_EnableRecovery(int onOff, int maxMemory, char* error);
wolfSSL 11:cee25a834751 74
wolfSSL 11:cee25a834751 75 WOLFSSL_API
wolfSSL 11:cee25a834751 76 SSL_SNIFFER_API int ssl_GetSessionStats(unsigned int* active,
wolfSSL 11:cee25a834751 77 unsigned int* total,
wolfSSL 11:cee25a834751 78 unsigned int* peak,
wolfSSL 11:cee25a834751 79 unsigned int* maxSessions,
wolfSSL 11:cee25a834751 80 unsigned int* missedData,
wolfSSL 11:cee25a834751 81 unsigned int* reassemblyMemory,
wolfSSL 11:cee25a834751 82 char* error);
wolfSSL 11:cee25a834751 83
wolfSSL 11:cee25a834751 84 WOLFSSL_API void ssl_InitSniffer(void);
wolfSSL 11:cee25a834751 85
wolfSSL 11:cee25a834751 86 WOLFSSL_API void ssl_FreeSniffer(void);
wolfSSL 11:cee25a834751 87
wolfSSL 11:cee25a834751 88
wolfSSL 11:cee25a834751 89 /* ssl_SetPrivateKey typeKs */
wolfSSL 11:cee25a834751 90 enum {
wolfSSL 11:cee25a834751 91 FILETYPE_PEM = 1,
wolfSSL 11:cee25a834751 92 FILETYPE_DER = 2,
wolfSSL 11:cee25a834751 93 };
wolfSSL 11:cee25a834751 94
wolfSSL 11:cee25a834751 95
wolfSSL 11:cee25a834751 96 #ifdef __cplusplus
wolfSSL 11:cee25a834751 97 } /* extern "C" */
wolfSSL 11:cee25a834751 98 #endif
wolfSSL 11:cee25a834751 99
wolfSSL 11:cee25a834751 100 #endif /* wolfSSL_SNIFFER_H */
wolfSSL 11:cee25a834751 101
wolfSSL 11:cee25a834751 102