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

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

Committer:
wolfSSL
Date:
Tue May 02 08:44:47 2017 +0000
Revision:
7:481bce714567
wolfSSL3.10.2

Who changed what in which revision?

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