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

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

Committer:
wolfSSL
Date:
Sat Aug 18 22:20:43 2018 +0000
Revision:
15:117db924cf7c
Child:
16:8e0d178b1d1e
wolfSSL 3.15.3

Who changed what in which revision?

UserRevisionLine numberNew contents of line
wolfSSL 15:117db924cf7c 1 /* callbacks.h
wolfSSL 15:117db924cf7c 2 *
wolfSSL 15:117db924cf7c 3 * Copyright (C) 2006-2017 wolfSSL Inc.
wolfSSL 15:117db924cf7c 4 *
wolfSSL 15:117db924cf7c 5 * This file is part of wolfSSL.
wolfSSL 15:117db924cf7c 6 *
wolfSSL 15:117db924cf7c 7 * wolfSSL is free software; you can redistribute it and/or modify
wolfSSL 15:117db924cf7c 8 * it under the terms of the GNU General Public License as published by
wolfSSL 15:117db924cf7c 9 * the Free Software Foundation; either version 2 of the License, or
wolfSSL 15:117db924cf7c 10 * (at your option) any later version.
wolfSSL 15:117db924cf7c 11 *
wolfSSL 15:117db924cf7c 12 * wolfSSL is distributed in the hope that it will be useful,
wolfSSL 15:117db924cf7c 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
wolfSSL 15:117db924cf7c 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
wolfSSL 15:117db924cf7c 15 * GNU General Public License for more details.
wolfSSL 15:117db924cf7c 16 *
wolfSSL 15:117db924cf7c 17 * You should have received a copy of the GNU General Public License
wolfSSL 15:117db924cf7c 18 * along with this program; if not, write to the Free Software
wolfSSL 15:117db924cf7c 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
wolfSSL 15:117db924cf7c 20 */
wolfSSL 15:117db924cf7c 21
wolfSSL 15:117db924cf7c 22
wolfSSL 15:117db924cf7c 23
wolfSSL 15:117db924cf7c 24 #ifndef WOLFSSL_CALLBACKS_H
wolfSSL 15:117db924cf7c 25 #define WOLFSSL_CALLBACKS_H
wolfSSL 15:117db924cf7c 26
wolfSSL 15:117db924cf7c 27 #include <wolfssl/wolfcrypt/wc_port.h>
wolfSSL 15:117db924cf7c 28
wolfSSL 15:117db924cf7c 29 #ifdef __cplusplus
wolfSSL 15:117db924cf7c 30 extern "C" {
wolfSSL 15:117db924cf7c 31 #endif
wolfSSL 15:117db924cf7c 32
wolfSSL 15:117db924cf7c 33
wolfSSL 15:117db924cf7c 34 enum { /* CALLBACK CONTSTANTS */
wolfSSL 15:117db924cf7c 35 MAX_PACKETNAME_SZ = 24,
wolfSSL 15:117db924cf7c 36 MAX_CIPHERNAME_SZ = 24,
wolfSSL 15:117db924cf7c 37 MAX_TIMEOUT_NAME_SZ = 24,
wolfSSL 15:117db924cf7c 38 MAX_PACKETS_HANDSHAKE = 14, /* 12 for client auth plus 2 alerts */
wolfSSL 15:117db924cf7c 39 MAX_VALUE_SZ = 128, /* all handshake packets but Cert should
wolfSSL 15:117db924cf7c 40 fit here */
wolfSSL 15:117db924cf7c 41 };
wolfSSL 15:117db924cf7c 42
wolfSSL 15:117db924cf7c 43 struct WOLFSSL;
wolfSSL 15:117db924cf7c 44
wolfSSL 15:117db924cf7c 45 typedef struct handShakeInfo_st {
wolfSSL 15:117db924cf7c 46 struct WOLFSSL* ssl;
wolfSSL 15:117db924cf7c 47 char cipherName[MAX_CIPHERNAME_SZ + 1]; /* negotiated cipher */
wolfSSL 15:117db924cf7c 48 char packetNames[MAX_PACKETS_HANDSHAKE][MAX_PACKETNAME_SZ + 1];
wolfSSL 15:117db924cf7c 49 /* SSL packet names */
wolfSSL 15:117db924cf7c 50 int numberPackets; /* actual # of packets */
wolfSSL 15:117db924cf7c 51 int negotiationError; /* cipher/parameter err */
wolfSSL 15:117db924cf7c 52 } HandShakeInfo;
wolfSSL 15:117db924cf7c 53
wolfSSL 15:117db924cf7c 54
wolfSSL 15:117db924cf7c 55 typedef struct timeval Timeval;
wolfSSL 15:117db924cf7c 56
wolfSSL 15:117db924cf7c 57
wolfSSL 15:117db924cf7c 58 typedef struct packetInfo_st {
wolfSSL 15:117db924cf7c 59 char packetName[MAX_PACKETNAME_SZ + 1]; /* SSL packet name */
wolfSSL 15:117db924cf7c 60 Timeval timestamp; /* when it occurred */
wolfSSL 15:117db924cf7c 61 unsigned char value[MAX_VALUE_SZ]; /* if fits, it's here */
wolfSSL 15:117db924cf7c 62 unsigned char* bufferValue; /* otherwise here (non 0) */
wolfSSL 15:117db924cf7c 63 int valueSz; /* sz of value or buffer */
wolfSSL 15:117db924cf7c 64 } PacketInfo;
wolfSSL 15:117db924cf7c 65
wolfSSL 15:117db924cf7c 66
wolfSSL 15:117db924cf7c 67 typedef struct timeoutInfo_st {
wolfSSL 15:117db924cf7c 68 char timeoutName[MAX_TIMEOUT_NAME_SZ + 1]; /* timeout Name */
wolfSSL 15:117db924cf7c 69 int flags; /* for future use */
wolfSSL 15:117db924cf7c 70 int numberPackets; /* actual # of packets */
wolfSSL 15:117db924cf7c 71 PacketInfo packets[MAX_PACKETS_HANDSHAKE]; /* list of all packets */
wolfSSL 15:117db924cf7c 72 Timeval timeoutValue; /* timer that caused it */
wolfSSL 15:117db924cf7c 73 } TimeoutInfo;
wolfSSL 15:117db924cf7c 74
wolfSSL 15:117db924cf7c 75
wolfSSL 15:117db924cf7c 76
wolfSSL 15:117db924cf7c 77 #ifdef __cplusplus
wolfSSL 15:117db924cf7c 78 } /* extern "C" */
wolfSSL 15:117db924cf7c 79 #endif
wolfSSL 15:117db924cf7c 80
wolfSSL 15:117db924cf7c 81
wolfSSL 15:117db924cf7c 82 #endif /* WOLFSSL_CALLBACKS_H */
wolfSSL 15:117db924cf7c 83
wolfSSL 15:117db924cf7c 84