{-------------------------------------------------------------------------------
Translated form headers/ssl3.h

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
      THIS ISN'T COMPLETE TRANSLATION OF C++ HEADERS AND NEVER WILL BE.

  FOR COPYRIGHT OF ORIGINAL ERIC YOUNG SOFTWARE LOOK AT FILES IN HEADER FOLDER.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

      Copyright (C) 1998 by Jan Tomasek <xtomasej@fel.cvut.cz>
      All rights reserved.

      This library is free for commercial and non-commercial use as long as
      the following conditions are aheared to.  The following conditions
      apply to all code found in this distribution.  The documentation
      included with this distribution is covered by the same copyright terms.

      Copyright remains Jan Tomasek's, and as such any Copyright notices in
      the code are not to be removed.
      If this package is used in a product, Jan Tomasek should be given
      attribution as the author of the parts of the library used.
      This can be in the form of a textual message at program startup or
      in documentation (online or textual) provided with the package.

      Redistribution and use in source and binary forms, with or without
      modification, are permitted provided that the following conditions
      are met:
      1. Redistributions of source code must retain the copyright
         notice, this list of conditions and the following disclaimer.
      2. Redistributions in binary form must reproduce the above copyright
         notice, this list of conditions and the following disclaimer in the
         documentation and/or other materials provided with the distribution.
      3. All advertising materials mentioning features or use of this software
         must display the following acknowledgement:
             "This product includes software written by
              Jan Tomasek <xtomasej@fel.cvut.cz>"

      THIS SOFTWARE IS PROVIDED BY JAN TOMASEK ``AS IS'' AND
      ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
      IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
      ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
      FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
      DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
      OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
      HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
      LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
      OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
      SUCH DAMAGE.

      The licence and distribution terms for any publically available version or
      derivative of this code cannot be changed.  i.e. this code cannot simply
      be copied and put under another distribution licence
      [including the GNU Public Licence.]
-------------------------------------------------------------------------------}

Const SSL3_CK_RSA_NULL_MD5                                       = $03000001;
Const SSL3_CK_RSA_NULL_SHA                                       = $03000002;
Const SSL3_CK_RSA_RC4_40_MD5                                     = $03000003;
Const SSL3_CK_RSA_RC4_128_MD5                                    = $03000004;
Const SSL3_CK_RSA_RC4_128_SHA                                    = $03000005;
Const SSL3_CK_RSA_RC2_40_MD5                                     = $03000006;
Const SSL3_CK_RSA_IDEA_128_SHA                                   = $03000007;
Const SSL3_CK_RSA_DES_40_CBC_SHA                                 = $03000008;
Const SSL3_CK_RSA_DES_64_CBC_SHA                                 = $03000009;
Const SSL3_CK_RSA_DES_192_CBC3_SHA                               = $0300000A;

Const SSL3_CK_DH_DSS_DES_40_CBC_SHA                              = $0300000B;
Const SSL3_CK_DH_DSS_DES_64_CBC_SHA                              = $0300000C;
Const SSL3_CK_DH_DSS_DES_192_CBC3_SHA                            = $0300000D;
Const SSL3_CK_DH_RSA_DES_40_CBC_SHA                              = $0300000E;
Const SSL3_CK_DH_RSA_DES_64_CBC_SHA                              = $0300000F;
Const SSL3_CK_DH_RSA_DES_192_CBC3_SHA                            = $03000010;

Const SSL3_CK_EDH_DSS_DES_40_CBC_SHA                             = $03000011;
Const SSL3_CK_EDH_DSS_DES_64_CBC_SHA                             = $03000012;
Const SSL3_CK_EDH_DSS_DES_192_CBC3_SHA                           = $03000013;
Const SSL3_CK_EDH_RSA_DES_40_CBC_SHA                             = $03000014;
Const SSL3_CK_EDH_RSA_DES_64_CBC_SHA                             = $03000015;
Const SSL3_CK_EDH_RSA_DES_192_CBC3_SHA                           = $03000016;

Const SSL3_CK_ADH_RC4_40_MD5                                     = $03000017;
Const SSL3_CK_ADH_RC4_128_MD5                                    = $03000018;
Const SSL3_CK_ADH_DES_40_CBC_SHA                                 = $03000019;
Const SSL3_CK_ADH_DES_64_CBC_SHA                                 = $0300001A;
Const SSL3_CK_ADH_DES_196_CBC_SHA                                = $0300001B;

Const SSL3_CK_FZA_DMS_NULL_SHA                                   = $0300001C;
Const SSL3_CK_FZA_DMS_FZA_SHA                                    = $0300001D;
Const SSL3_CK_FZA_DMS_RC4_SHA                                    = $0300001E;

Const SSL3_TXT_RSA_NULL_MD5                                      = 'NULL-MD5';
Const SSL3_TXT_RSA_NULL_SHA                                      = 'NULL-SHA';
Const SSL3_TXT_RSA_RC4_40_MD5                                    = 'EXP-RC4-MD5';
Const SSL3_TXT_RSA_RC4_128_MD5                                   = 'RC4-MD5';
Const SSL3_TXT_RSA_RC4_128_SHA                                   = 'RC4-SHA';
Const SSL3_TXT_RSA_RC2_40_MD5                                    = 'EXP-RC2-CBC-MD5';
Const SSL3_TXT_RSA_IDEA_128_SHA                                  = 'IDEA-CBC-MD5';
Const SSL3_TXT_RSA_DES_40_CBC_SHA                                = 'EXP-DES-CBC-SHA';
Const SSL3_TXT_RSA_DES_64_CBC_SHA                                = 'DES-CBC-SHA';
Const SSL3_TXT_RSA_DES_192_CBC3_SHA                              = 'DES-CBC3-SHA';

Const SSL3_TXT_DH_DSS_DES_40_CBC_SHA                             = 'EXP-DH-DSS-DES-CBC-SHA';
Const SSL3_TXT_DH_DSS_DES_64_CBC_SHA                             = 'DH-DSS-DES-CBC-SHA';
Const SSL3_TXT_DH_DSS_DES_192_CBC3_SHA                           = 'DH-DSS-DES-CBC3-SHA';
Const SSL3_TXT_DH_RSA_DES_40_CBC_SHA                             = 'EXP-DH-RSA-DES-CBC-SHA';
Const SSL3_TXT_DH_RSA_DES_64_CBC_SHA                             = 'DH-RSA-DES-CBC-SHA';
Const SSL3_TXT_DH_RSA_DES_192_CBC3_SHA                           = 'DH-RSA-DES-CBC3-SHA';

Const SSL3_TXT_EDH_DSS_DES_40_CBC_SHA                            = 'EXP-EDH-DSS-DES-CBC-SHA';
Const SSL3_TXT_EDH_DSS_DES_64_CBC_SHA                            = 'EDH-DSS-DES-CBC-SHA';
Const SSL3_TXT_EDH_DSS_DES_192_CBC3_SHA                          = 'EDH-DSS-DES-CBC3-SHA';
Const SSL3_TXT_EDH_RSA_DES_40_CBC_SHA                            = 'EXP-EDH-RSA-DES-CBC';
Const SSL3_TXT_EDH_RSA_DES_64_CBC_SHA                            = 'EDH-RSA-DES-CBC-SHA';
Const SSL3_TXT_EDH_RSA_DES_192_CBC3_SHA                          = 'EDH-RSA-DES-CBC3-SHA';

Const SSL3_TXT_ADH_RC4_40_MD5                                    = 'EXP-ADH-RC4-MD5';
Const SSL3_TXT_ADH_RC4_128_MD5                                   = 'ADH-RC4-MD5';
Const SSL3_TXT_ADH_DES_40_CBC_SHA                                = 'EXP-ADH-DES-CBC-SHA';
Const SSL3_TXT_ADH_DES_64_CBC_SHA                                = 'ADH-DES-CBC-SHA';
Const SSL3_TXT_ADH_DES_196_CBC_SHA                               = 'ADH-DES-CBC3-SHA';

Const SSL3_TXT_FZA_DMS_NULL_SHA                                  = 'FZA-NULL-SHA';
Const SSL3_TXT_FZA_DMS_FZA_SHA                                   = 'FZA-FZA-CBC-SHA';
Const SSL3_TXT_FZA_DMS_RC4_SHA                                   = 'FZA-RC4-SHA';

Const SSL3_SSL_SESSION_ID_LENGTH                                 = 32;
Const SSL3_MAX_SSL_SESSION_ID_LENGTH                             = 32;

Const SSL3_MASTER_SECRET_SIZE                                    = 48;
Const SSL3_RANDOM_SIZE                                           = 32;
Const SSL3_SESSION_ID_SIZE                                       = 32;
Const SSL3_RT_HEADER_LENGTH                                      = 5 ;

Const SSL3_RT_MAX_PLAIN_LENGTH                                   = 16384;
Const SSL3_RT_MAX_COMPRESSED_LENGTH                              = (1024+SSL3_RT_MAX_PLAIN_LENGTH);
Const SSL3_RT_MAX_ENCRYPTED_LENGTH                               = (1024+SSL3_RT_MAX_COMPRESSED_LENGTH);
Const SSL3_RT_MAX_PACKET_SIZE                                    = (SSL3_RT_MAX_ENCRYPTED_LENGTH+SSL3_RT_HEADER_LENGTH);
Const SSL3_RT_MAX_DATA_SIZE                                      = (1024*1024);

Const SSL3_RS_BLANK                                              = 1;

Const SSL3_RS_ENCODED                                            = 2;
Const SSL3_RS_READ_MORE                                          = 3;
Const SSL3_RS_PLAIN                                              = 3;
Const SSL3_RS_PART_READ                                          = 4;
Const SSL3_RS_PART_WRITE                                         = 5;

Const SSL3_VERSION                                               = $0300;
Const SSL3_VERSION_MAJOR                                         = $03;
Const SSL3_VERSION_MINOR                                         = $00;

Const SSL3_RT_CHANGE_CIPHER_SPEC                                 = 20;
Const SSL3_RT_ALERT                                              = 21;
Const SSL3_RT_HANDSHAKE                                          = 22;
Const SSL3_RT_APPLICATION_DATA                                   = 23;

Const SSL3_AL_WARNING                                            = 1;
Const SSL3_AL_FATAL                                              = 2;

Const SSL3_AD_CLOSE_NOTIFY                                       = 0;
Const SSL3_AD_UNEXPECTED_MESSAGE                                 = 10;{fatal}
Const SSL3_AD_BAD_RECORD_MAC                                     = 20;{fatal}
Const SSL3_AD_DECOMPRESSION_FAILURE                              = 30;{fatal}
Const SSL3_AD_HANDSHAKE_FAILURE                                  = 40;{fatal}
Const SSL3_AD_NO_CERTIFICATE                                     = 41;
Const SSL3_AD_BAD_CERTIFICATE                                    = 42;
Const SSL3_AD_UNSUPPORTED_CERTIFICATE                            = 43;
Const SSL3_AD_CERTIFICATE_REVOKED                                = 44;
Const SSL3_AD_CERTIFICATE_EXPIRED                                = 45;
Const SSL3_AD_CERTIFICATE_UNKNOWN                                = 46;
Const SSL3_AD_ILLEGAL_PARAMETER                                  = 47;{fatal}

Const SSL3_CT_RSA_SIGN			                         = 1;
Const SSL3_CT_DSS_SIGN			                         = 2;
Const SSL3_CT_RSA_FIXED_DH			                 = 3;
Const SSL3_CT_DSS_FIXED_DH			                 = 4;
Const SSL3_CT_RSA_EPHEMERAL_DH		                         = 5;
Const SSL3_CT_DSS_EPHEMERAL_DH		                         = 6;
Const SSL3_CT_FORTEZZA_DMS			                 = 20;
Const SSL3_CT_NUMBER				                 = 7;

Const SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS	                         = $0001;
Const SSL3_FLAGS_DELAY_CLIENT_FINISHED	                         = $0002;
Const SSL3_FLAGS_POP_BUFFER			                 = $0004;

{ SSLv3 }
{client }
{ extra state }
Const SSL3_ST_CW_FLUSH                                           = ($100 or SSL_ST_CONNECT);
{ write to server }                                                         
Const SSL3_ST_CW_CLNT_HELLO_A                                    = ($110 or SSL_ST_CONNECT);
Const SSL3_ST_CW_CLNT_HELLO_B                                    = ($111 or SSL_ST_CONNECT);
{ read from server }                                                        
Const SSL3_ST_CR_SRVR_HELLO_A                                    = ($120 or SSL_ST_CONNECT);
Const SSL3_ST_CR_SRVR_HELLO_B                                    = ($121 or SSL_ST_CONNECT);
Const SSL3_ST_CR_CERT_A                                          = ($130 or SSL_ST_CONNECT);
Const SSL3_ST_CR_CERT_B                                          = ($131 or SSL_ST_CONNECT);
Const SSL3_ST_CR_KEY_EXCH_A                                      = ($140 or SSL_ST_CONNECT);
Const SSL3_ST_CR_KEY_EXCH_B                                      = ($141 or SSL_ST_CONNECT);
Const SSL3_ST_CR_CERT_REQ_A                                      = ($150 or SSL_ST_CONNECT);
Const SSL3_ST_CR_CERT_REQ_B                                      = ($151 or SSL_ST_CONNECT);
Const SSL3_ST_CR_SRVR_DONE_A                                     = ($160 or SSL_ST_CONNECT);
Const SSL3_ST_CR_SRVR_DONE_B                                     = ($161 or SSL_ST_CONNECT);
{ write to server }                                                         
Const SSL3_ST_CW_CERT_A                                          = ($170 or SSL_ST_CONNECT);
Const SSL3_ST_CW_CERT_B                                          = ($171 or SSL_ST_CONNECT);
Const SSL3_ST_CW_CERT_C                                          = ($172 or SSL_ST_CONNECT);
Const SSL3_ST_CW_CERT_D                                          = ($173 or SSL_ST_CONNECT);
Const SSL3_ST_CW_KEY_EXCH_A                                      = ($180 or SSL_ST_CONNECT);
Const SSL3_ST_CW_KEY_EXCH_B                                      = ($181 or SSL_ST_CONNECT);
Const SSL3_ST_CW_CERT_VRFY_A                                     = ($190 or SSL_ST_CONNECT);
Const SSL3_ST_CW_CERT_VRFY_B                                     = ($191 or SSL_ST_CONNECT);
Const SSL3_ST_CW_CHANGE_A                                        = ($1A0 or SSL_ST_CONNECT);
Const SSL3_ST_CW_CHANGE_B                                        = ($1A1 or SSL_ST_CONNECT);
Const SSL3_ST_CW_FINISHED_A                                      = ($1B0 or SSL_ST_CONNECT);
Const SSL3_ST_CW_FINISHED_B                                      = ($1B1 or SSL_ST_CONNECT);
{ read from server }                                                        
Const SSL3_ST_CR_CHANGE_A                                        = ($1C0 or SSL_ST_CONNECT);
Const SSL3_ST_CR_CHANGE_B                                        = ($1C1 or SSL_ST_CONNECT);
Const SSL3_ST_CR_FINISHED_A                                      = ($1D0 or SSL_ST_CONNECT);
Const SSL3_ST_CR_FINISHED_B                                      = ($1D1 or SSL_ST_CONNECT);
                                                                            
{ server }                                                                  
{ extra state }                                                             
Const SSL3_ST_SW_FLUSH                                           = ($100 or SSL_ST_ACCEPT);
{ read from client }                                                        
Const SSL3_ST_SR_CLNT_HELLO_A                                    = ($110 or SSL_ST_ACCEPT);
Const SSL3_ST_SR_CLNT_HELLO_B                                    = ($111 or SSL_ST_ACCEPT);
Const SSL3_ST_SR_CLNT_HELLO_C                                    = ($112 or SSL_ST_ACCEPT);
{ write to client }                                                         
Const SSL3_ST_SW_HELLO_REQ_A                                     = ($120 or SSL_ST_ACCEPT);
Const SSL3_ST_SW_HELLO_REQ_B                                     = ($121 or SSL_ST_ACCEPT);
Const SSL3_ST_SW_HELLO_REQ_C                                     = ($122 or SSL_ST_ACCEPT);
Const SSL3_ST_SW_SRVR_HELLO_A                                    = ($130 or SSL_ST_ACCEPT);
Const SSL3_ST_SW_SRVR_HELLO_B                                    = ($131 or SSL_ST_ACCEPT);
Const SSL3_ST_SW_CERT_A                                          = ($140 or SSL_ST_ACCEPT);
Const SSL3_ST_SW_CERT_B                                          = ($141 or SSL_ST_ACCEPT);
Const SSL3_ST_SW_KEY_EXCH_A                                      = ($150 or SSL_ST_ACCEPT);
Const SSL3_ST_SW_KEY_EXCH_B                                      = ($151 or SSL_ST_ACCEPT);
Const SSL3_ST_SW_CERT_REQ_A                                      = ($160 or SSL_ST_ACCEPT);
Const SSL3_ST_SW_CERT_REQ_B                                      = ($161 or SSL_ST_ACCEPT);
Const SSL3_ST_SW_SRVR_DONE_A                                     = ($170 or SSL_ST_ACCEPT);
Const SSL3_ST_SW_SRVR_DONE_B                                     = ($171 or SSL_ST_ACCEPT);
{ read from client }                                                        
Const SSL3_ST_SR_CERT_A                                          = ($180 or SSL_ST_ACCEPT);
Const SSL3_ST_SR_CERT_B                                          = ($181 or SSL_ST_ACCEPT);
Const SSL3_ST_SR_KEY_EXCH_A                                      = ($190 or SSL_ST_ACCEPT);
Const SSL3_ST_SR_KEY_EXCH_B                                      = ($191 or SSL_ST_ACCEPT);
Const SSL3_ST_SR_CERT_VRFY_A                                     = ($1A0 or SSL_ST_ACCEPT);
Const SSL3_ST_SR_CERT_VRFY_B                                     = ($1A1 or SSL_ST_ACCEPT);
Const SSL3_ST_SR_CHANGE_A                                        = ($1B0 or SSL_ST_ACCEPT);
Const SSL3_ST_SR_CHANGE_B                                        = ($1B1 or SSL_ST_ACCEPT);
Const SSL3_ST_SR_FINISHED_A                                      = ($1C0 or SSL_ST_ACCEPT);
Const SSL3_ST_SR_FINISHED_B                                      = ($1C1 or SSL_ST_ACCEPT);
{ write to client }                                                         
Const SSL3_ST_SW_CHANGE_A                                        = ($1D0 or SSL_ST_ACCEPT);
Const SSL3_ST_SW_CHANGE_B                                        = ($1D1 or SSL_ST_ACCEPT);
Const SSL3_ST_SW_FINISHED_A                                      = ($1E0 or SSL_ST_ACCEPT);
Const SSL3_ST_SW_FINISHED_B                                      = ($1E1 or SSL_ST_ACCEPT);
                                                                            
Const SSL3_MT_CLIENT_REQUEST                                     = 0;
Const SSL3_MT_CLIENT_HELLO                                       = 1;       
Const SSL3_MT_SERVER_HELLO                                       = 2;       
Const SSL3_MT_CERTIFICATE                                        = 11;      
Const SSL3_MT_SERVER_KEY_EXCHANGE                                = 12;
Const SSL3_MT_CERTIFICATE_REQUEST                                = 13;
Const SSL3_MT_SERVER_DONE                                        = 14;
Const SSL3_MT_CERTIFICATE_VERIFY                                 = 15;
Const SSL3_MT_CLIENT_KEY_EXCHANGE                                = 16;
Const SSL3_MT_FINISHED                                           = 20;

Const SSL3_MT_CCS                                                = 1;

{ These are used when changing over to a new cipher }              
Const SSL3_CC_READ                                               = $01;
Const SSL3_CC_WRITE                                              = $02;
Const SSL3_CC_CLIENT                                             = $10;
Const SSL3_CC_SERVER                                             = $20;
Const SSL3_CHANGE_CIPHER_CLIENT_WRITE                            = (SSL3_CC_CLIENT or SSL3_CC_WRITE);
Const SSL3_CHANGE_CIPHER_SERVER_READ                             = (SSL3_CC_SERVER or SSL3_CC_READ);
Const SSL3_CHANGE_CIPHER_CLIENT_READ                             = (SSL3_CC_CLIENT or SSL3_CC_READ);
Const SSL3_CHANGE_CIPHER_SERVER_WRITE                            = (SSL3_CC_SERVER or SSL3_CC_WRITE);
