wolfSSL SSL/TLS library, support up to TLS1.3
Dependents: CyaSSL-Twitter-OAuth4Tw Example-client-tls-cert TwitterReader TweetTest ... more
wolfssl/callbacks.h@13:f67a6c6013ca, 2017-08-22 (annotated)
- 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?
User | Revision | Line number | New contents of line |
---|---|---|---|
wolfSSL | 11:cee25a834751 | 1 | /* callbacks.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_CALLBACKS_H |
wolfSSL | 11:cee25a834751 | 25 | #define WOLFSSL_CALLBACKS_H |
wolfSSL | 11:cee25a834751 | 26 | |
wolfSSL | 11:cee25a834751 | 27 | #include <sys/time.h> |
wolfSSL | 11:cee25a834751 | 28 | |
wolfSSL | 11:cee25a834751 | 29 | #ifdef __cplusplus |
wolfSSL | 11:cee25a834751 | 30 | extern "C" { |
wolfSSL | 11:cee25a834751 | 31 | #endif |
wolfSSL | 11:cee25a834751 | 32 | |
wolfSSL | 11:cee25a834751 | 33 | |
wolfSSL | 11:cee25a834751 | 34 | enum { /* CALLBACK CONTSTANTS */ |
wolfSSL | 11:cee25a834751 | 35 | MAX_PACKETNAME_SZ = 24, |
wolfSSL | 11:cee25a834751 | 36 | MAX_CIPHERNAME_SZ = 24, |
wolfSSL | 11:cee25a834751 | 37 | MAX_TIMEOUT_NAME_SZ = 24, |
wolfSSL | 11:cee25a834751 | 38 | MAX_PACKETS_HANDSHAKE = 14, /* 12 for client auth plus 2 alerts */ |
wolfSSL | 11:cee25a834751 | 39 | MAX_VALUE_SZ = 128, /* all handshake packets but Cert should |
wolfSSL | 11:cee25a834751 | 40 | fit here */ |
wolfSSL | 11:cee25a834751 | 41 | }; |
wolfSSL | 11:cee25a834751 | 42 | |
wolfSSL | 11:cee25a834751 | 43 | struct WOLFSSL; |
wolfSSL | 11:cee25a834751 | 44 | |
wolfSSL | 11:cee25a834751 | 45 | typedef struct handShakeInfo_st { |
wolfSSL | 11:cee25a834751 | 46 | struct WOLFSSL* ssl; |
wolfSSL | 11:cee25a834751 | 47 | char cipherName[MAX_CIPHERNAME_SZ + 1]; /* negotiated cipher */ |
wolfSSL | 11:cee25a834751 | 48 | char packetNames[MAX_PACKETS_HANDSHAKE][MAX_PACKETNAME_SZ + 1]; |
wolfSSL | 11:cee25a834751 | 49 | /* SSL packet names */ |
wolfSSL | 11:cee25a834751 | 50 | int numberPackets; /* actual # of packets */ |
wolfSSL | 11:cee25a834751 | 51 | int negotiationError; /* cipher/parameter err */ |
wolfSSL | 11:cee25a834751 | 52 | } HandShakeInfo; |
wolfSSL | 11:cee25a834751 | 53 | |
wolfSSL | 11:cee25a834751 | 54 | |
wolfSSL | 11:cee25a834751 | 55 | typedef struct timeval Timeval; |
wolfSSL | 11:cee25a834751 | 56 | |
wolfSSL | 11:cee25a834751 | 57 | |
wolfSSL | 11:cee25a834751 | 58 | typedef struct packetInfo_st { |
wolfSSL | 11:cee25a834751 | 59 | char packetName[MAX_PACKETNAME_SZ + 1]; /* SSL packet name */ |
wolfSSL | 11:cee25a834751 | 60 | Timeval timestamp; /* when it occurred */ |
wolfSSL | 11:cee25a834751 | 61 | unsigned char value[MAX_VALUE_SZ]; /* if fits, it's here */ |
wolfSSL | 11:cee25a834751 | 62 | unsigned char* bufferValue; /* otherwise here (non 0) */ |
wolfSSL | 11:cee25a834751 | 63 | int valueSz; /* sz of value or buffer */ |
wolfSSL | 11:cee25a834751 | 64 | } PacketInfo; |
wolfSSL | 11:cee25a834751 | 65 | |
wolfSSL | 11:cee25a834751 | 66 | |
wolfSSL | 11:cee25a834751 | 67 | typedef struct timeoutInfo_st { |
wolfSSL | 11:cee25a834751 | 68 | char timeoutName[MAX_TIMEOUT_NAME_SZ + 1]; /* timeout Name */ |
wolfSSL | 11:cee25a834751 | 69 | int flags; /* for future use */ |
wolfSSL | 11:cee25a834751 | 70 | int numberPackets; /* actual # of packets */ |
wolfSSL | 11:cee25a834751 | 71 | PacketInfo packets[MAX_PACKETS_HANDSHAKE]; /* list of all packets */ |
wolfSSL | 11:cee25a834751 | 72 | Timeval timeoutValue; /* timer that caused it */ |
wolfSSL | 11:cee25a834751 | 73 | } TimeoutInfo; |
wolfSSL | 11:cee25a834751 | 74 | |
wolfSSL | 11:cee25a834751 | 75 | |
wolfSSL | 11:cee25a834751 | 76 | |
wolfSSL | 11:cee25a834751 | 77 | #ifdef __cplusplus |
wolfSSL | 11:cee25a834751 | 78 | } /* extern "C" */ |
wolfSSL | 11:cee25a834751 | 79 | #endif |
wolfSSL | 11:cee25a834751 | 80 | |
wolfSSL | 11:cee25a834751 | 81 | |
wolfSSL | 11:cee25a834751 | 82 | #endif /* WOLFSSL_CALLBACKS_H */ |
wolfSSL | 11:cee25a834751 | 83 | |
wolfSSL | 11:cee25a834751 | 84 |