12 #if defined( INC_ALL )
33 #define VERSIONINFO_SIZE 2
34 #define ALERTINFO_SIZE 2
35 #define SSL_HEADER_SIZE 5
36 #define SSL_NONCE_SIZE 32
37 #define SSL_SECRET_SIZE 48
38 #define MD5MAC_SIZE 16
39 #define SHA1MAC_SIZE 20
40 #define SHA2MAC_SIZE 32
41 #define GCMICV_SIZE 16
42 #define GCM_SALT_SIZE 4
43 #define GCM_IV_SIZE 12
44 #define TLS_HASHEDMAC_SIZE 12
45 #define SESSIONID_SIZE 16
46 #define MAX_SESSIONID_SIZE 32
47 #define MAX_KEYBLOCK_SIZE ( ( 64 + 32 + 16 ) * 2 )
49 #define MIN_PACKET_SIZE 4
50 #define MAX_PACKET_SIZE 16384
51 #define MAX_CIPHERSUITES 200
58 #define EXTRA_PACKET_SIZE 512
76 #if defined( PREFER_RSA_TO_DH ) && defined( _MSC_VER )
77 #pragma message( " Building with RSA as preferred SSL/TLS cipher suite." )
111 #define SSL_PFLAG_NONE 0x00
112 #define SSL_PFLAG_ALERTSENT 0x01
113 #define SSL_PFLAG_CLIAUTHSKIPPED 0x02
114 #define SSL_PFLAG_GCM 0x04
115 #define SSL_PFLAG_SUITEB_128 0x08
116 #define SSL_PFLAG_SUITEB_256 0x10
117 #define SSL_PFLAG_CHECKREHANDSHAKE 0x20
118 #define SSL_PFLAG_MAX 0x2F
125 #define SSL_PFLAG_SUITEB ( SSL_PFLAG_SUITEB_128 | \
126 SSL_PFLAG_SUITEB_256 )
130 #define SSL_MSG_CHANGE_CIPHER_SPEC 20
131 #define SSL_MSG_ALERT 21
132 #define SSL_MSG_HANDSHAKE 22
133 #define SSL_MSG_APPLICATION_DATA 23
135 #define SSL_MSG_FIRST SSL_MSG_CHANGE_CIPHER_SPEC
136 #define SSL_MSG_LAST SSL_MSG_APPLICATION_DATA
147 #define SSL_MSG_FIRST_HANDSHAKE 0xFE
148 #define SSL_MSG_FIRST_ENCRHANDSHAKE 0xFF
149 #define SSL_MSG_LAST_SPECIAL SSL_MSG_FIRST_ENCRHANDSHAKE
150 #define SSL_MSG_V2HANDSHAKE 0x80
154 #define SSL_HAND_CLIENT_HELLO 1
155 #define SSL_HAND_SERVER_HELLO 2
156 #define SSL_HAND_CERTIFICATE 11
157 #define SSL_HAND_SERVER_KEYEXCHANGE 12
158 #define SSL_HAND_SERVER_CERTREQUEST 13
159 #define SSL_HAND_SERVER_HELLODONE 14
160 #define SSL_HAND_CLIENT_CERTVERIFY 15
161 #define SSL_HAND_CLIENT_KEYEXCHANGE 16
162 #define SSL_HAND_FINISHED 20
163 #define SSL_HAND_SUPPLEMENTAL_DATA 23
165 #define SSL_HAND_FIRST SSL_HAND_CLIENT_HELLO
166 #define SSL_HAND_LAST SSL_HAND_SUPPLEMENTAL_DATA
170 #define SSL_ALERTLEVEL_WARNING 1
171 #define SSL_ALERTLEVEL_FATAL 2
173 #define SSL_ALERT_CLOSE_NOTIFY 0
174 #define SSL_ALERT_UNEXPECTED_MESSAGE 10
175 #define SSL_ALERT_BAD_RECORD_MAC 20
176 #define TLS_ALERT_DECRYPTION_FAILED 21
177 #define TLS_ALERT_RECORD_OVERFLOW 22
178 #define SSL_ALERT_DECOMPRESSION_FAILURE 30
179 #define SSL_ALERT_HANDSHAKE_FAILURE 40
180 #define SSL_ALERT_NO_CERTIFICATE 41
181 #define SSL_ALERT_BAD_CERTIFICATE 42
182 #define SSL_ALERT_UNSUPPORTED_CERTIFICATE 43
183 #define SSL_ALERT_CERTIFICATE_REVOKED 44
184 #define SSL_ALERT_CERTIFICATE_EXPIRED 45
185 #define SSL_ALERT_CERTIFICATE_UNKNOWN 46
186 #define TLS_ALERT_ILLEGAL_PARAMETER 47
187 #define TLS_ALERT_UNKNOWN_CA 48
188 #define TLS_ALERT_ACCESS_DENIED 49
189 #define TLS_ALERT_DECODE_ERROR 50
190 #define TLS_ALERT_DECRYPT_ERROR 51
191 #define TLS_ALERT_EXPORT_RESTRICTION 60
192 #define TLS_ALERT_PROTOCOL_VERSION 70
193 #define TLS_ALERT_INSUFFICIENT_SECURITY 71
194 #define TLS_ALERT_INTERNAL_ERROR 80
195 #define TLS_ALERT_USER_CANCELLED 90
196 #define TLS_ALERT_NO_RENEGOTIATION 100
197 #define TLS_ALERT_UNSUPPORTED_EXTENSION 110
198 #define TLS_ALERT_CERTIFICATE_UNOBTAINABLE 111
199 #define TLS_ALERT_UNRECOGNIZED_NAME 112
200 #define TLS_ALERT_BAD_CERTIFICATE_STATUS_RESPONSE 113
201 #define TLS_ALERT_BAD_CERTIFICATE_HASH_VALUE 114
202 #define TLS_ALERT_UNKNOWN_PSK_IDENTITY 115
204 #define SSL_ALERT_FIRST SSL_ALERT_CLOSE_NOTIFY
205 #define SSL_ALERT_LAST TLS_ALERT_UNKNOWN_PSK_IDENTITY
209 #define TLS_SUPPDATA_USERMAPPING 0
421 #define SSL_MAJOR_VERSION 3
422 #define SSL_MINOR_VERSION_SSL 0
423 #define SSL_MINOR_VERSION_TLS 1
424 #define SSL_MINOR_VERSION_TLS11 2
425 #define SSL_MINOR_VERSION_TLS12 3
429 #define SSL_SENDER_CLIENTLABEL "CLNT"
430 #define SSL_SENDER_SERVERLABEL "SRVR"
431 #define SSL_SENDERLABEL_SIZE 4
448 #define CIPHERSUITE_FLAG_NONE 0x00
449 #define CIPHERSUITE_FLAG_PSK 0x01
450 #define CIPHERSUITE_FLAG_DH 0x02
451 #define CIPHERSUITE_FLAG_ECC 0x04
452 #define CIPHERSUITE_FLAG_TLS12 0x08
453 #define CIPHERSUITE_FLAG_GCM 0x10
454 #define CIPHERSUITE_FLAG_MAX 0x1F
476 #define DESCRIPTION( text ) text,
478 #define DESCRIPTION( text )
487 #if defined( _MSC_VER )
488 #pragma message( " Building with Suite B algorithms only." )
491 #define algoAvailable( algo ) \
492 ( ( ( algo ) == CRYPT_ALGO_AES || ( algo ) == CRYPT_ALGO_ECDSA || \
493 ( algo ) == CRYPT_ALGO_ECDH || ( algo ) == CRYPT_ALGO_SHA2 || \
494 ( algo ) == CRYPT_ALGO_HMAC_SHA2 ) ? TRUE : FALSE )
498 #ifdef CONFIG_SUITEB_TESTS
503 SUITEB_TEST_CLIINVALIDCURVE,
504 SUITEB_TEST_SVRINVALIDCURVE,
505 SUITEB_TEST_BOTHCURVES,
506 SUITEB_TEST_BOTHSIGALGOS,
511 extern SUITEB_TEST_VALUE suiteBTestValue;
512 extern BOOLEAN suiteBTestClientCert;
564 #ifdef ALLOW_SSLV2_HELLO
664 OUT_BUFFER( dataMaxLength, *dataLength )
void *data,
671 IN_BUFFER( dataLength )
const void *data,
678 IN_BUFFER( dataLength )
const void *data,
703 const int hashValuesMaxLen,
705 IN_BUFFER( labelLength )
const char *label,
706 IN_RANGE( 1, 64 )
const int labelLength,
712 OUT_BUFFER( hashValuesMaxLen, *hashValuesLen ) \
715 const int hashValuesMaxLen,
717 IN_BUFFER( labelLength )
const char *label,
718 IN_RANGE( 1, 64 )
const int labelLength,
723 OUT_BUFFER( hashValuesMaxLen, *hashValuesLen ) \
726 const int hashValuesMaxLen,
728 IN_BUFFER( labelLength )
const char *label,
729 IN_RANGE( 1, 64 )
const int labelLength,
733 int createCertVerifyHash(
const SESSION_INFO *sessionInfoPtr,
736 int createCertVerify(
const SESSION_INFO *sessionInfoPtr,
740 int checkCertVerify(
const SESSION_INFO *sessionInfoPtr,
744 const int sigLength );
812 const void *sharedSecret,
818 OUT_BUFFER( dataMaxLength, *dataLength )
void *data,
824 IN_BUFFER( dataLength )
const void *data,
862 *dataLength )
void *data,
879 #ifndef CONFIG_SUITEB
887 #define getCipherSuiteInfo( infoPtr, noEntries, isServer ) \
888 getSuiteBCipherSuiteInfo( infoPtr, noEntries, isServer, suiteBinfo )
908 int openPacketStreamSSL(
OUT STREAM *stream,