MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
yassl_types.hpp
1 /*
2  Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
3 
4  This program is free software; you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation; version 2 of the License.
7 
8  This program is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  GNU General Public License for more details.
12 
13  You should have received a copy of the GNU General Public License
14  along with this program; see the file COPYING. If not, write to the
15  Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
16  MA 02110-1301 USA.
17 */
18 
19 /* yaSSL types header defines all constants, enums, and typedefs
20  * from the SSL.v3 specification "draft-freier-ssl-version3-02.txt"
21  */
22 
23 
24 #ifndef yaSSL_TYPES_HPP
25 #define yaSSL_TYPES_HPP
26 
27 #include <stddef.h>
28 #include "type_traits.hpp"
29 
30 
31 #ifdef _MSC_VER
32  // disable conversion warning
33  // 4996 warning to use MS extensions e.g., strcpy_s instead of strncpy
34  #pragma warning(disable:4244 4996)
35 #endif
36 
37 
38 #ifdef _MSC_VER
39  // disable conversion warning
40  // 4996 warning to use MS extensions e.g., strcpy_s instead of strncpy
41  #pragma warning(disable:4244 4996)
42 #endif
43 
44 
45 namespace yaSSL {
46 
47 #define YASSL_LIB
48 
49 
50 #ifdef YASSL_PURE_C
51 
52  // library allocation
53  struct new_t {}; // yaSSL New type
54  extern new_t ys; // pass in parameter
55 
56  } // namespace yaSSL
57 
58  void* operator new (size_t, yaSSL::new_t);
59  void* operator new[](size_t, yaSSL::new_t);
60 
61  void operator delete (void*, yaSSL::new_t);
62  void operator delete[](void*, yaSSL::new_t);
63 
64 
65  namespace yaSSL {
66 
67 
68  template<typename T>
69  void ysDelete(T* ptr)
70  {
71  if (ptr) ptr->~T();
72  ::operator delete(ptr, yaSSL::ys);
73  }
74 
75  template<typename T>
76  void ysArrayDelete(T* ptr)
77  {
78  // can't do array placement destruction since not tracking size in
79  // allocation, only allow builtins to use array placement since they
80  // don't need destructors called
81  typedef char builtin[TaoCrypt::IsFundamentalType<T>::Yes ? 1 : -1];
82  (void)sizeof(builtin);
83 
84  ::operator delete[](ptr, yaSSL::ys);
85  }
86 
87  #define NEW_YS new (yaSSL::ys)
88 
89  // to resolve compiler generated operator delete on base classes with
90  // virtual destructors (when on stack)
91  class virtual_base {
92  public:
93  static void operator delete(void*) { }
94  };
95 
96 
97 #else // YASSL_PURE_C
98 
99 
100  template<typename T>
101  void ysDelete(T* ptr)
102  {
103  delete ptr;
104  }
105 
106  template<typename T>
107  void ysArrayDelete(T* ptr)
108  {
109  delete[] ptr;
110  }
111 
112  #define NEW_YS new
113 
114  class virtual_base {};
115 
116 
117 
118 #endif // YASSL_PURE_C
119 
120 
121 typedef unsigned char uint8;
122 typedef unsigned short uint16;
123 typedef unsigned int uint32;
124 typedef uint8 uint24[3];
125 typedef uint32 uint64[2];
126 
127 typedef uint8 opaque;
128 typedef opaque byte;
129 
130 typedef unsigned int uint;
131 
132 
133 #ifdef USE_SYS_STL
134  // use system STL
135  #define STL_VECTOR_FILE <vector>
136  #define STL_LIST_FILE <list>
137  #define STL_ALGORITHM_FILE <algorithm>
138  #define STL_MEMORY_FILE <memory>
139  #define STL_PAIR_FILE <utility>
140 
141  #define STL_NAMESPACE std
142 #else
143  // use mySTL
144  #define STL_VECTOR_FILE "vector.hpp"
145  #define STL_LIST_FILE "list.hpp"
146  #define STL_ALGORITHM_FILE "algorithm.hpp"
147  #define STL_MEMORY_FILE "memory.hpp"
148  #define STL_PAIR_FILE "pair.hpp"
149 
150  #define STL_NAMESPACE mySTL
151 #endif
152 
153 
154 #ifdef min
155  #undef min
156 #endif
157 
158 template <typename T>
159 T min(T a, T b)
160 {
161  return a < b ? a : b;
162 }
163 
164 
165 
166 // all length constants in bytes
167 const int ID_LEN = 32; // session id length
168 const int SUITE_LEN = 2; // cipher suite length
169 const int SECRET_LEN = 48; // pre RSA and all master secret length
170 const int MASTER_ROUNDS = 3; // master secret derivation rounds
171 const int RAN_LEN = 32; // client and server random length
172 const int MAC_BLOCK_SZ = 64; // MAC block size, & padding
173 const int MD5_LEN = 16; // MD5 digest length
174 const int SHA_LEN = 20; // SHA digest length
175 const int RMD_LEN = 20; // RIPEMD-160 digest length
176 const int PREFIX = 3; // up to 3 prefix letters for secret rounds
177 const int KEY_PREFIX = 7; // up to 7 prefix letters for key rounds
178 const int FORTEZZA_MAX = 128; // Maximum Fortezza Key length
179 const int MAX_SUITE_SZ = 128; // 64 max suites * sizeof(suite)
180 const int MAX_SUITE_NAME = 48; // max length of suite name
181 const int MAX_CIPHERS = 32; // max supported ciphers for cipher list
182 const int SIZEOF_ENUM = 1; // SSL considers an enum 1 byte, not 4
183 const int SIZEOF_SENDER = 4; // Sender constant, for finished generation
184 const int PAD_MD5 = 48; // pad length 1 and 2 for md5 finished
185 const int PAD_SHA = 40; // should be 44, specd wrong by netscape
186 const int PAD_RMD = 44; // pad length for RIPEMD-160, some use 40??
187 const int CERT_HEADER = 3; // always use 3 bytes for certificate
188 const int CERT_TYPES = 7; // certificate request types
189 const int REQUEST_HEADER = 2; // request uses 2 bytes
190 const int VERIFY_HEADER = 2; // verify length field
191 const int MIN_CERT_TYPES = 1; // minimum certificate request types
192 const int MIN_DIS_NAMES = 3; // minimum distinguished names
193 const int MIN_DIS_SIZE = 1; // minimum distinguished name size
194 const int RECORD_HEADER = 5; // type + version + length(2)
195 const int HANDSHAKE_HEADER = 4; // type + length(3)
196 const int FINISHED_SZ = MD5_LEN + SHA_LEN; // sizeof finished data
197 const int TLS_FINISHED_SZ = 12; // TLS verify data size
198 const int SEQ_SZ = 8; // 64 bit sequence number
199 const int LENGTH_SZ = 2; // length field for HMAC, data only
200 const int VERSION_SZ = SIZEOF_ENUM * 2; // SSL/TLS length of version
201 const int DES_KEY_SZ = 8; // DES Key length
202 const int DES_EDE_KEY_SZ = 24; // DES EDE Key length
203 const int DES_BLOCK = 8; // DES is always fixed block size 8
204 const int DES_IV_SZ = DES_BLOCK; // Init Vector length for DES
205 const int RC4_KEY_SZ = 16; // RC4 Key length
206 const int AES_128_KEY_SZ = 16; // AES 128bit Key length
207 const int AES_192_KEY_SZ = 24; // AES 192bit Key length
208 const int AES_256_KEY_SZ = 32; // AES 256bit Key length
209 const int AES_BLOCK_SZ = 16; // AES 128bit block size, rfc 3268
210 const int AES_IV_SZ = AES_BLOCK_SZ; // AES Init Vector length
211 const int DSS_SIG_SZ = 40; // two 20 byte high byte first Integers
212 const int DSS_ENCODED_EXTRA = 6; // seqID + len(1) + (intID + len(1)) * 2
213 const int EVP_SALT_SZ = 8;
214 const int MASTER_LABEL_SZ = 13; // TLS master secret label size
215 const int KEY_LABEL_SZ = 13; // TLS key block expansion size
216 const int FINISHED_LABEL_SZ = 15; // TLS finished lable length
217 const int SEED_LEN = RAN_LEN * 2; // TLS seed, client + server random
218 const int DEFAULT_TIMEOUT = 500; // Default Session timeout in seconds
219 const int MAX_RECORD_SIZE = 16384; // 2^14, max size by standard
220 const int COMPRESS_EXTRA = 1024; // extra compression possible addition
221 const int SESSION_FLUSH_COUNT = 256; // when to flush session cache
222 const int MAX_PAD_SIZE = 256; // max TLS padding size
223 const int COMPRESS_CONSTANT = 13; // compression calculation constant
224 const int COMPRESS_UPPER = 55; // compression calculation numerator
225 const int COMPRESS_LOWER = 64; // compression calculation denominator
226 const int COMPRESS_DUMMY_SIZE = 64; // compression dummy round size
227 
228 typedef uint8 Cipher; // first byte is always 0x00 for SSLv3 & TLS
229 
230 typedef opaque Random[RAN_LEN];
231 
232 typedef opaque* DistinguishedName;
233 
234 typedef bool IsExportable;
235 
236 
237 enum CompressionMethod { no_compression = 0, zlib = 221 };
238 
239 enum CipherType { stream, block };
240 
241 enum CipherChoice { change_cipher_spec_choice = 1 };
242 
243 enum PublicValueEncoding { implicit_encoding, explicit_encoding };
244 
245 enum ConnectionEnd { server_end, client_end };
246 
247 enum AlertLevel { warning = 1, fatal = 2 };
248 
249 
250 
251 // Record Layer Header identifier from page 12
252 enum ContentType {
253  no_type = 0,
254  change_cipher_spec = 20,
255  alert = 21,
256  handshake = 22,
257  application_data = 23
258 };
259 
260 
261 // HandShake Layer Header identifier from page 20
262 enum HandShakeType {
263  no_shake = -1,
264  hello_request = 0,
265  client_hello = 1,
266  server_hello = 2,
267  certificate = 11,
268  server_key_exchange = 12,
269  certificate_request = 13,
270  server_hello_done = 14,
271  certificate_verify = 15,
272  client_key_exchange = 16,
273  finished = 20
274 };
275 
276 
277 // Valid Alert types from page 16/17
278 enum AlertDescription {
279  close_notify = 0,
280  unexpected_message = 10,
281  bad_record_mac = 20,
282  decompression_failure = 30,
283  handshake_failure = 40,
284  no_certificate = 41,
285  bad_certificate = 42,
286  unsupported_certificate = 43,
287  certificate_revoked = 44,
288  certificate_expired = 45,
289  certificate_unknown = 46,
290  illegal_parameter = 47
291 };
292 
293 
294 // Supported Key Exchange Protocols
295 enum KeyExchangeAlgorithm {
296  no_kea = 0,
297  rsa_kea,
298  diffie_hellman_kea,
299  fortezza_kea
300 };
301 
302 
303 // Supported Authentication Schemes
304 enum SignatureAlgorithm {
305  anonymous_sa_algo = 0,
306  rsa_sa_algo,
307  dsa_sa_algo
308 };
309 
310 
311 // Valid client certificate request types from page 27
312 enum ClientCertificateType {
313  rsa_sign = 1,
314  dss_sign = 2,
315  rsa_fixed_dh = 3,
316  dss_fixed_dh = 4,
317  rsa_ephemeral_dh = 5,
318  dss_ephemeral_dh = 6,
319  fortezza_kea_cert = 20
320 };
321 
322 
323 // Supported Ciphers from page 43
324 enum BulkCipherAlgorithm {
325  cipher_null,
326  rc4,
327  rc2,
328  des,
329  triple_des, // leading 3 (3des) not valid identifier
330  des40,
331  idea,
332  aes
333 };
334 
335 
336 // Supported Message Authentication Codes from page 43
337 enum MACAlgorithm {
338  no_mac,
339  md5,
340  sha,
341  rmd
342 };
343 
344 
345 // Certificate file Type
346 enum CertType { Cert = 0, PrivateKey, CA };
347 
348 
349 // all Cipher Suites from pages 41/42
350 const Cipher SSL_NULL_WITH_NULL_NULL = 0; // { 0x00, 0x00 }
351 const Cipher SSL_RSA_WITH_NULL_MD5 = 1; // { 0x00, 0x01 }
352 const Cipher SSL_RSA_WITH_NULL_SHA = 2; // { 0x00, 0x02 }
353 const Cipher SSL_RSA_EXPORT_WITH_RC4_40_MD5 = 3; // { 0x00, 0x03 }
354 const Cipher SSL_RSA_WITH_RC4_128_MD5 = 4; // { 0x00, 0x04 }
355 const Cipher SSL_RSA_WITH_RC4_128_SHA = 5; // { 0x00, 0x05 }
356 const Cipher SSL_RSA_EXPORT_WITH_RC2_CBC_40_MD5 = 6; // { 0x00, 0x06 }
357 const Cipher SSL_RSA_WITH_IDEA_CBC_SHA = 7; // { 0x00, 0x07 }
358 const Cipher SSL_RSA_EXPORT_WITH_DES40_CBC_SHA = 8; // { 0x00, 0x08 }
359 const Cipher SSL_RSA_WITH_DES_CBC_SHA = 9; // { 0x00, 0x09 }
360 const Cipher SSL_RSA_WITH_3DES_EDE_CBC_SHA = 10; // { 0x00, 0x0A }
361 const Cipher SSL_DH_DSS_EXPORT_WITH_DES40_CBC_SHA = 11; // { 0x00, 0x0B }
362 const Cipher SSL_DH_DSS_WITH_DES_CBC_SHA = 12; // { 0x00, 0x0C }
363 const Cipher SSL_DH_DSS_WITH_3DES_EDE_CBC_SHA = 13; // { 0x00, 0x0D }
364 const Cipher SSL_DH_RSA_EXPORT_WITH_DES40_CBC_SHA = 14; // { 0x00, 0x0E }
365 const Cipher SSL_DH_RSA_WITH_DES_CBC_SHA = 15; // { 0x00, 0x0F }
366 const Cipher SSL_DH_RSA_WITH_3DES_EDE_CBC_SHA = 16; // { 0x00, 0x10 }
367 const Cipher SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA = 17; // { 0x00, 0x11 }
368 const Cipher SSL_DHE_DSS_WITH_DES_CBC_SHA = 18; // { 0x00, 0x12 }
369 const Cipher SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA = 19; // { 0x00, 0x13 }
370 const Cipher SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA = 20; // { 0x00, 0x14 }
371 const Cipher SSL_DHE_RSA_WITH_DES_CBC_SHA = 21; // { 0x00, 0x15 }
372 const Cipher SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA = 22; // { 0x00, 0x16 }
373 const Cipher SSL_DH_anon_EXPORT_WITH_RC4_40_MD5 = 23; // { 0x00, 0x17 }
374 const Cipher SSL_DH_anon_WITH_RC4_128_MD5 = 24; // { 0x00, 0x18 }
375 const Cipher SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA = 25; // { 0x00, 0x19 }
376 const Cipher SSL_DH_anon_WITH_DES_CBC_SHA = 26; // { 0x00, 0x1A }
377 const Cipher SSL_DH_anon_WITH_3DES_EDE_CBC_SHA = 27; // { 0x00, 0x1B }
378 const Cipher SSL_FORTEZZA_KEA_WITH_NULL_SHA = 28; // { 0x00, 0x1C }
379 const Cipher SSL_FORTEZZA_KEA_WITH_FORTEZZA_CBC_SHA = 29; // { 0x00, 0x1D }
380 const Cipher SSL_FORTEZZA_KEA_WITH_RC4_128_SHA = 30; // { 0x00, 0x1E }
381 
382 // .. to 0x2B uses Kerberos Authentication
383 
384 
385 // TLS AES extensions
386 const Cipher TLS_RSA_WITH_AES_128_CBC_SHA = 47; // { 0x00, 0x2F }
387 const Cipher TLS_DH_DSS_WITH_AES_128_CBC_SHA = 48; // { 0x00, 0x30 }
388 const Cipher TLS_DH_RSA_WITH_AES_128_CBC_SHA = 49; // { 0x00, 0x31 }
389 const Cipher TLS_DHE_DSS_WITH_AES_128_CBC_SHA = 50; // { 0x00, 0x32 }
390 const Cipher TLS_DHE_RSA_WITH_AES_128_CBC_SHA = 51; // { 0x00, 0x33 }
391 const Cipher TLS_DH_anon_WITH_AES_128_CBC_SHA = 52; // { 0x00, 0x34 }
392 
393 const Cipher TLS_RSA_WITH_AES_256_CBC_SHA = 53; // { 0x00, 0x35 }
394 const Cipher TLS_DH_DSS_WITH_AES_256_CBC_SHA = 54; // { 0x00, 0x36 }
395 const Cipher TLS_DH_RSA_WITH_AES_256_CBC_SHA = 55; // { 0x00, 0x37 }
396 const Cipher TLS_DHE_DSS_WITH_AES_256_CBC_SHA = 56; // { 0x00, 0x38 }
397 const Cipher TLS_DHE_RSA_WITH_AES_256_CBC_SHA = 57; // { 0x00, 0x39 }
398 const Cipher TLS_DH_anon_WITH_AES_256_CBC_SHA = 58; // { 0x00, 0x3A }
399 
400 
401 // OpenPGP extensions
402 
403 const Cipher TLS_DHE_DSS_WITH_3DES_EDE_CBC_RMD160 = 114; // { 0x00, 0x72 };
404 const Cipher TLS_DHE_DSS_WITH_AES_128_CBC_RMD160 = 115; // { 0x00, 0x73 };
405 const Cipher TLS_DHE_DSS_WITH_AES_256_CBC_RMD160 = 116; // { 0x00, 0x74 };
406 const Cipher TLS_DHE_RSA_WITH_3DES_EDE_CBC_RMD160 = 119; // { 0x00, 0x77 };
407 const Cipher TLS_DHE_RSA_WITH_AES_128_CBC_RMD160 = 120; // { 0x00, 0x78 };
408 const Cipher TLS_DHE_RSA_WITH_AES_256_CBC_RMD160 = 121; // { 0x00, 0x79 };
409 const Cipher TLS_RSA_WITH_3DES_EDE_CBC_RMD160 = 124; // { 0x00, 0x7C };
410 const Cipher TLS_RSA_WITH_AES_128_CBC_RMD160 = 125; // { 0x00, 0x7D };
411 const Cipher TLS_RSA_WITH_AES_256_CBC_RMD160 = 126; // { 0x00, 0x7E };
412 
413 
414 const char* const null_str = "";
415 
416 const char* const cipher_names[128] =
417 {
418  null_str, // SSL_NULL_WITH_NULL_NULL = 0
419  null_str, // SSL_RSA_WITH_NULL_MD5 = 1
420  null_str, // SSL_RSA_WITH_NULL_SHA = 2
421  null_str, // SSL_RSA_EXPORT_WITH_RC4_40_MD5 = 3
422  "RC4-MD5", // SSL_RSA_WITH_RC4_128_MD5 = 4
423  "RC4-SHA", // SSL_RSA_WITH_RC4_128_SHA = 5
424  null_str, // SSL_RSA_EXPORT_WITH_RC2_CBC_40_MD5 = 6
425  null_str, // SSL_RSA_WITH_IDEA_CBC_SHA = 7
426  null_str, // SSL_RSA_EXPORT_WITH_DES40_CBC_SHA = 8
427  "DES-CBC-SHA", // SSL_RSA_WITH_DES_CBC_SHA = 9
428  "DES-CBC3-SHA", // SSL_RSA_WITH_3DES_EDE_CBC_SHA = 10
429 
430  null_str, // SSL_DH_DSS_EXPORT_WITH_DES40_CBC_SHA = 11
431  null_str, // SSL_DH_DSS_WITH_DES_CBC_SHA = 12
432  null_str, // SSL_DH_DSS_WITH_3DES_EDE_CBC_SHA = 13
433  null_str, // SSL_DH_RSA_EXPORT_WITH_DES40_CBC_SHA = 14
434  null_str, // SSL_DH_RSA_WITH_DES_CBC_SHA = 15
435  null_str, // SSL_DH_RSA_WITH_3DES_EDE_CBC_SHA = 16
436  null_str, // SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA = 17
437  "EDH-DSS-DES-CBC-SHA", // SSL_DHE_DSS_WITH_DES_CBC_SHA = 18
438  "EDH-DSS-DES-CBC3-SHA", // SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA = 19
439  null_str, // SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA = 20
440 
441  "EDH-RSA-DES-CBC-SHA", // SSL_DHE_RSA_WITH_DES_CBC_SHA = 21
442  "EDH-RSA-DES-CBC3-SHA", // SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA = 22
443  null_str, // SSL_DH_anon_EXPORT_WITH_RC4_40_MD5 = 23
444  null_str, // SSL_DH_anon_WITH_RC4_128_MD5 = 24
445  null_str, // SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA = 25
446  null_str, // SSL_DH_anon_WITH_DES_CBC_SHA = 26
447  null_str, // SSL_DH_anon_WITH_3DES_EDE_CBC_SHA = 27
448  null_str, // SSL_FORTEZZA_KEA_WITH_NULL_SHA = 28
449  null_str, // SSL_FORTEZZA_KEA_WITH_FORTEZZA_CBC_SHA = 29
450  null_str, // SSL_FORTEZZA_KEA_WITH_RC4_128_SHA = 30
451 
452  null_str, null_str, null_str, null_str, null_str, // 31 - 35
453  null_str, null_str, null_str, null_str, null_str, // 36 - 40
454  null_str, null_str, null_str, null_str, null_str, // 41 - 45
455  null_str, // 46
456 
457  // TLS AES extensions
458  "AES128-SHA", // TLS_RSA_WITH_AES_128_CBC_SHA = 47
459  null_str, // TLS_DH_DSS_WITH_AES_128_CBC_SHA = 48
460  null_str, // TLS_DH_RSA_WITH_AES_128_CBC_SHA = 49
461  "DHE-DSS-AES128-SHA", // TLS_DHE_DSS_WITH_AES_128_CBC_SHA = 50
462  "DHE-RSA-AES128-SHA", // TLS_DHE_RSA_WITH_AES_128_CBC_SHA = 51
463  null_str, // TLS_DH_anon_WITH_AES_128_CBC_SHA = 52
464 
465  "AES256-SHA", // TLS_RSA_WITH_AES_256_CBC_SHA = 53
466  null_str, // TLS_DH_DSS_WITH_AES_256_CBC_SHA = 54
467  null_str, // TLS_DH_RSA_WITH_AES_256_CBC_SHA = 55
468  "DHE-DSS-AES256-SHA", // TLS_DHE_DSS_WITH_AES_256_CBC_SHA = 56
469  "DHE-RSA-AES256-SHA", // TLS_DHE_RSA_WITH_AES_256_CBC_SHA = 57
470  null_str, // TLS_DH_anon_WITH_AES_256_CBC_SHA = 58
471 
472  null_str, // 59
473  null_str, // 60
474  null_str, null_str, null_str, null_str, null_str, // 61 - 65
475  null_str, null_str, null_str, null_str, null_str, // 66 - 70
476  null_str, null_str, null_str, null_str, null_str, // 71 - 75
477  null_str, null_str, null_str, null_str, null_str, // 76 - 80
478  null_str, null_str, null_str, null_str, null_str, // 81 - 85
479  null_str, null_str, null_str, null_str, null_str, // 86 - 90
480  null_str, null_str, null_str, null_str, null_str, // 91 - 95
481  null_str, null_str, null_str, null_str, null_str, // 96 - 100
482  null_str, null_str, null_str, null_str, null_str, // 101 - 105
483  null_str, null_str, null_str, null_str, null_str, // 106 - 110
484  null_str, null_str, null_str, // 111 - 113
485 
486  "DHE-DSS-DES-CBC3-RMD", // TLS_DHE_DSS_WITH_3DES_EDE_CBC_RMD160 = 114
487  "DHE-DSS-AES128-RMD", // TLS_DHE_DSS_WITH_AES_128_CBC_RMD160 = 115
488  "DHE-DSS-AES256-RMD", // TLS_DHE_DSS_WITH_AES_256_CBC_RMD160 = 116
489  null_str, // 117
490  null_str, // 118
491  "DHE-RSA-DES-CBC3-RMD", // TLS_DHE_RSA_WITH_3DES_EDE_CBC_RMD160 = 119
492  "DHE-RSA-AES128-RMD", // TLS_DHE_RSA_WITH_AES_128_CBC_RMD160 = 120
493  "DHE-RSA-AES256-RMD", // TLS_DHE_RSA_WITH_AES_256_CBC_RMD160 = 121
494  null_str, // 122
495  null_str, // 123
496  "DES-CBC3-RMD", // TLS_RSA_WITH_3DES_EDE_CBC_RMD160 = 124
497  "AES128-RMD", // TLS_RSA_WITH_AES_128_CBC_RMD160 = 125
498  "AES256-RMD", // TLS_RSA_WITH_AES_256_CBC_RMD160 = 126
499  null_str // 127
500 };
501 
502 // fill with MD5 pad size since biggest required
503 const opaque PAD1[PAD_MD5] = { 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
504  0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
505  0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
506  0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
507  0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
508  0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36
509  };
510 const opaque PAD2[PAD_MD5] = { 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c,
511  0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c,
512  0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c,
513  0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c,
514  0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c,
515  0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c
516  };
517 
518 const opaque client[SIZEOF_SENDER] = { 0x43, 0x4C, 0x4E, 0x54 };
519 const opaque server[SIZEOF_SENDER] = { 0x53, 0x52, 0x56, 0x52 };
520 
521 const opaque tls_client[FINISHED_LABEL_SZ + 1] = "client finished";
522 const opaque tls_server[FINISHED_LABEL_SZ + 1] = "server finished";
523 
524 const opaque master_label[MASTER_LABEL_SZ + 1] = "master secret";
525 const opaque key_label [KEY_LABEL_SZ + 1] = "key expansion";
526 
527 
528 } // naemspace
529 
530 #if __GNUC__ == 2 && __GNUC_MINOR__ <= 96
531 /*
532  gcc 2.96 bails out because of two declarations of byte: yaSSL::byte and
533  TaoCrypt::byte. TODO: define global types.hpp and move the declaration of
534  'byte' there.
535 */
536 using yaSSL::byte;
537 #endif
538 
539 
540 #endif // yaSSL_TYPES_HPP