30 #pragma warning(disable:4786)
33 #include "yassl_types.hpp"
34 #include "factory.hpp"
35 #include STL_LIST_FILE
38 namespace STL = STL_NAMESPACE;
71 virtual ContentType get_type()
const =0;
72 virtual uint16 get_length()
const =0;
89 ContentType get_type()
const;
90 uint16 get_length()
const;
101 AlertDescription description_;
104 Alert(AlertLevel al, AlertDescription ad);
106 ContentType get_type()
const;
107 uint16 get_length()
const;
124 const opaque* write_buffer_;
127 Data(uint16 len, opaque* b);
134 ContentType get_type()
const;
135 uint16 get_length()
const;
136 void set_length(uint16 l);
137 opaque* set_buffer();
138 void SetData(uint16,
const opaque*);
146 uint32 c24to32(
const uint24);
147 void c32to24(uint32, uint24&);
157 ContentType get_type()
const;
158 uint16 get_length()
const;
159 HandShakeType get_handshakeType()
const;
162 void set_type(HandShakeType hst);
163 void set_length(uint32 u32);
180 int get_length()
const;
181 void set_length(
int);
184 virtual HandShakeType get_type()
const =0;
202 HandShakeType get_type()
const;
211 opaque session_id_[ID_LEN];
213 opaque cipher_suites_[MAX_SUITE_SZ];
215 CompressionMethod compression_methods_;
223 HandShakeType get_type()
const;
226 const opaque* get_random()
const;
244 opaque session_id_[ID_LEN];
245 opaque cipher_suite_[SUITE_LEN];
246 CompressionMethod compression_method_;
257 HandShakeType get_type()
const;
260 const opaque* get_random()
const;
278 const opaque* get_buffer()
const;
284 HandShakeType get_type()
const;
295 opaque* rsa_modulus_;
296 opaque* rsa_exponent_;
312 int get_pSize()
const;
313 int get_gSize()
const;
314 int get_pubSize()
const;
316 const opaque* get_p()
const;
317 const opaque* get_g()
const;
318 const opaque* get_pub()
const;
320 opaque* alloc_p(
int sz);
321 opaque* alloc_g(
int sz);
322 opaque* alloc_pub(
int sz);
331 virtual void build(
SSL&) {}
333 virtual int get_length()
const;
334 virtual opaque* get_serverKey()
const;
340 opaque r_s_[FORTEZZA_MAX];
380 int get_length()
const;
381 opaque* get_serverKey()
const;
402 void createKey(
SSL&);
403 void build(
SSL& ssl);
405 const opaque* getKey()
const;
406 int getKeyLength()
const;
414 HandShakeType get_type()
const;
423 ClientCertificateType certificate_types_[CERT_TYPES];
425 STL::list<DistinguishedName> certificate_authorities_;
438 HandShakeType get_type()
const;
454 HandShakeType get_type()
const;
459 opaque random_[SECRET_LEN];
465 virtual void build(
SSL&) {}
467 virtual int get_length()
const;
468 virtual opaque* get_clientKey()
const;
481 int get_length()
const;
482 opaque* get_clientKey()
const;
496 opaque y_signature_ [40];
497 opaque wrapped_client_write_key_ [12];
498 opaque wrapped_server_write_key_ [12];
499 opaque client_write_iv_ [24];
500 opaque server_write_iv_ [24];
501 opaque master_secret_iv_ [24];
502 opaque encrypted_preMasterSecret_[48];
509 PublicValueEncoding public_value_encoding_;
513 enum { KEY_OFFSET = 2 };
520 int get_length()
const;
521 opaque* get_clientKey()
const;
522 void alloc(
int sz,
bool offset =
false);
537 void createKey(
SSL&);
538 void build(
SSL& ssl);
540 const opaque* getKey()
const;
541 int getKeyLength()
const;
548 HandShakeType get_type()
const;
570 HandShakeType get_type()
const;
595 HandShakeType get_type()
const;
607 opaque *pre_master_secret_;
608 opaque master_secret_[SECRET_LEN];
609 opaque client_random_[RAN_LEN];
610 opaque server_random_[RAN_LEN];
611 opaque sessionID_[ID_LEN];
612 opaque client_write_MAC_secret_[SHA_LEN];
613 opaque server_write_MAC_secret_[SHA_LEN];
614 opaque client_write_key_[AES_256_KEY_SZ];
615 opaque server_write_key_[AES_256_KEY_SZ];
616 opaque client_write_IV_[AES_IV_SZ];
617 opaque server_write_IV_[AES_IV_SZ];
618 uint32 sequence_number_;
619 uint32 peer_sequence_number_;
620 uint32 pre_secret_len_;
621 bool send_server_key_;
634 void AllocPreSecret(uint sz);
635 void CleanPreMaster();
638 void TurnOffTLS1_1();
650 ConnectionEnd entity_;
651 BulkCipherAlgorithm bulk_cipher_algorithm_;
652 CipherType cipher_type_;
655 IsExportable is_exportable_;
656 MACAlgorithm mac_algorithm_;
658 CompressionMethod compression_algorithm_;
659 KeyExchangeAlgorithm kea_;
660 SignatureAlgorithm sig_algo_;
661 SignatureAlgorithm verify_algo_;
664 uint16 encrypt_size_;
665 Cipher suite_[SUITE_LEN];
667 Cipher suites_[MAX_SUITE_SZ];
668 char cipher_name_[MAX_SUITE_NAME];
669 char cipher_list_[MAX_CIPHERS][MAX_SUITE_NAME];
675 bool removeRSA =
false,
bool removeDSA =
false);
676 void SetCipherNames();
748 #endif // yaSSL_IMP_HPP