cyassl re-port with cellular comms, PSK test

Dependencies:   VodafoneUSBModem_bleedingedge2 mbed-rtos mbed-src

Committer:
ashleymills
Date:
Fri Apr 26 16:59:36 2013 +0000
Revision:
1:b211d97b0068
Parent:
0:e979170e02e7
nothing

Who changed what in which revision?

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