A library for setting up Secure Socket Layer (SSL) connections and verifying remote hosts using certificates. Contains only the source files for mbed platform implementation of the library.
Dependents: HTTPClient-SSL HTTPClient-SSL HTTPClient-SSL HTTPClient-SSL
cyassl/callbacks.h@6:cf58d49e1a86, 2015-03-23 (annotated)
- Committer:
- Mike Fiore
- Date:
- Mon Mar 23 16:51:07 2015 -0500
- Revision:
- 6:cf58d49e1a86
- Parent:
- 0:b86d15c6ba29
fix whitespace in sha512.c
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Vanger | 0:b86d15c6ba29 | 1 | /* callbacks.h |
Vanger | 0:b86d15c6ba29 | 2 | * |
Vanger | 0:b86d15c6ba29 | 3 | * Copyright (C) 2013 wolfSSL Inc. |
Vanger | 0:b86d15c6ba29 | 4 | * |
Vanger | 0:b86d15c6ba29 | 5 | * This file is part of CyaSSL. |
Vanger | 0:b86d15c6ba29 | 6 | * |
Vanger | 0:b86d15c6ba29 | 7 | * CyaSSL is free software; you can redistribute it and/or modify |
Vanger | 0:b86d15c6ba29 | 8 | * it under the terms of the GNU General Public License as published by |
Vanger | 0:b86d15c6ba29 | 9 | * the Free Software Foundation; either version 2 of the License, or |
Vanger | 0:b86d15c6ba29 | 10 | * (at your option) any later version. |
Vanger | 0:b86d15c6ba29 | 11 | * |
Vanger | 0:b86d15c6ba29 | 12 | * CyaSSL is distributed in the hope that it will be useful, |
Vanger | 0:b86d15c6ba29 | 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
Vanger | 0:b86d15c6ba29 | 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
Vanger | 0:b86d15c6ba29 | 15 | * GNU General Public License for more details. |
Vanger | 0:b86d15c6ba29 | 16 | * |
Vanger | 0:b86d15c6ba29 | 17 | * You should have received a copy of the GNU General Public License |
Vanger | 0:b86d15c6ba29 | 18 | * along with this program; if not, write to the Free Software |
Vanger | 0:b86d15c6ba29 | 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA |
Vanger | 0:b86d15c6ba29 | 20 | */ |
Vanger | 0:b86d15c6ba29 | 21 | |
Vanger | 0:b86d15c6ba29 | 22 | |
Vanger | 0:b86d15c6ba29 | 23 | #ifndef CYASSL_CALLBACKS_H |
Vanger | 0:b86d15c6ba29 | 24 | #define CYASSL_CALLBACKS_H |
Vanger | 0:b86d15c6ba29 | 25 | |
Vanger | 0:b86d15c6ba29 | 26 | #include <sys/time.h> |
Vanger | 0:b86d15c6ba29 | 27 | |
Vanger | 0:b86d15c6ba29 | 28 | #ifdef __cplusplus |
Vanger | 0:b86d15c6ba29 | 29 | extern "C" { |
Vanger | 0:b86d15c6ba29 | 30 | #endif |
Vanger | 0:b86d15c6ba29 | 31 | |
Vanger | 0:b86d15c6ba29 | 32 | |
Vanger | 0:b86d15c6ba29 | 33 | enum { /* CALLBACK CONTSTANTS */ |
Vanger | 0:b86d15c6ba29 | 34 | MAX_PACKETNAME_SZ = 24, |
Vanger | 0:b86d15c6ba29 | 35 | MAX_CIPHERNAME_SZ = 24, |
Vanger | 0:b86d15c6ba29 | 36 | MAX_TIMEOUT_NAME_SZ = 24, |
Vanger | 0:b86d15c6ba29 | 37 | MAX_PACKETS_HANDSHAKE = 14, /* 12 for client auth plus 2 alerts */ |
Vanger | 0:b86d15c6ba29 | 38 | MAX_VALUE_SZ = 128, /* all handshake packets but Cert should |
Vanger | 0:b86d15c6ba29 | 39 | fit here */ |
Vanger | 0:b86d15c6ba29 | 40 | }; |
Vanger | 0:b86d15c6ba29 | 41 | |
Vanger | 0:b86d15c6ba29 | 42 | |
Vanger | 0:b86d15c6ba29 | 43 | typedef struct handShakeInfo_st { |
Vanger | 0:b86d15c6ba29 | 44 | char cipherName[MAX_CIPHERNAME_SZ + 1]; /* negotiated cipher */ |
Vanger | 0:b86d15c6ba29 | 45 | char packetNames[MAX_PACKETS_HANDSHAKE][MAX_PACKETNAME_SZ + 1]; |
Vanger | 0:b86d15c6ba29 | 46 | /* SSL packet names */ |
Vanger | 0:b86d15c6ba29 | 47 | int numberPackets; /* actual # of packets */ |
Vanger | 0:b86d15c6ba29 | 48 | int negotiationError; /* cipher/parameter err */ |
Vanger | 0:b86d15c6ba29 | 49 | } HandShakeInfo; |
Vanger | 0:b86d15c6ba29 | 50 | |
Vanger | 0:b86d15c6ba29 | 51 | |
Vanger | 0:b86d15c6ba29 | 52 | typedef struct timeval Timeval; |
Vanger | 0:b86d15c6ba29 | 53 | |
Vanger | 0:b86d15c6ba29 | 54 | |
Vanger | 0:b86d15c6ba29 | 55 | typedef struct packetInfo_st { |
Vanger | 0:b86d15c6ba29 | 56 | char packetName[MAX_PACKETNAME_SZ + 1]; /* SSL packet name */ |
Vanger | 0:b86d15c6ba29 | 57 | Timeval timestamp; /* when it occured */ |
Vanger | 0:b86d15c6ba29 | 58 | unsigned char value[MAX_VALUE_SZ]; /* if fits, it's here */ |
Vanger | 0:b86d15c6ba29 | 59 | unsigned char* bufferValue; /* otherwise here (non 0) */ |
Vanger | 0:b86d15c6ba29 | 60 | int valueSz; /* sz of value or buffer */ |
Vanger | 0:b86d15c6ba29 | 61 | } PacketInfo; |
Vanger | 0:b86d15c6ba29 | 62 | |
Vanger | 0:b86d15c6ba29 | 63 | |
Vanger | 0:b86d15c6ba29 | 64 | typedef struct timeoutInfo_st { |
Vanger | 0:b86d15c6ba29 | 65 | char timeoutName[MAX_TIMEOUT_NAME_SZ + 1]; /* timeout Name */ |
Vanger | 0:b86d15c6ba29 | 66 | int flags; /* for future use */ |
Vanger | 0:b86d15c6ba29 | 67 | int numberPackets; /* actual # of packets */ |
Vanger | 0:b86d15c6ba29 | 68 | PacketInfo packets[MAX_PACKETS_HANDSHAKE]; /* list of all packets */ |
Vanger | 0:b86d15c6ba29 | 69 | Timeval timeoutValue; /* timer that caused it */ |
Vanger | 0:b86d15c6ba29 | 70 | } TimeoutInfo; |
Vanger | 0:b86d15c6ba29 | 71 | |
Vanger | 0:b86d15c6ba29 | 72 | |
Vanger | 0:b86d15c6ba29 | 73 | |
Vanger | 0:b86d15c6ba29 | 74 | #ifdef __cplusplus |
Vanger | 0:b86d15c6ba29 | 75 | } /* extern "C" */ |
Vanger | 0:b86d15c6ba29 | 76 | #endif |
Vanger | 0:b86d15c6ba29 | 77 | |
Vanger | 0:b86d15c6ba29 | 78 | |
Vanger | 0:b86d15c6ba29 | 79 | #endif /* CYASSL_CALLBACKS_H */ |
Vanger | 0:b86d15c6ba29 | 80 |