{-------------------------------------------------------------------------------
Translated form headers/ssl2.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.]
-------------------------------------------------------------------------------}

{ Protocol Version Codes }
Const SSL2_CLIENT_VERSION                                        = $0002;
Const SSL2_SERVER_VERSION                                        = $0002;

{ Protocol Message Codes }
Const SSL2_MT_ERROR                                              = 0;
Const SSL2_MT_CLIENT_HELLO                                       = 1;
Const SSL2_MT_CLIENT_MASTER_KEY                                  = 2;
Const SSL2_MT_CLIENT_FINISHED                                    = 3;
Const SSL2_MT_SERVER_HELLO                                       = 4;
Const SSL2_MT_SERVER_VERIFY                                      = 5;
Const SSL2_MT_SERVER_FINISHED                                    = 6;
Const SSL2_MT_REQUEST_CERTIFICATE                                = 7;
Const SSL2_MT_CLIENT_CERTIFICATE                                 = 8;

{ Error Message Codes }
Const SSL2_PE_UNDEFINED_ERROR                                    = $0000;
Const SSL2_PE_NO_CIPHER                                          = $0001;
Const SSL2_PE_NO_CERTIFICATE                                     = $0002;
Const SSL2_PE_BAD_CERTIFICATE                                    = $0004;
Const SSL2_PE_UNSUPPORTED_CERTIFICATE_TYPE                       = $0006;

{ Cipher Kind Values }
Const SSL2_CK_NULL_WITH_MD5                                      = $02000000;{v3}
Const SSL2_CK_RC4_128_WITH_MD5                                   = $02010080;
Const SSL2_CK_RC4_128_EXPORT40_WITH_MD5                          = $02020080;
Const SSL2_CK_RC2_128_CBC_WITH_MD5                               = $02030080;
Const SSL2_CK_RC2_128_CBC_EXPORT40_WITH_MD5                      = $02040080;
Const SSL2_CK_IDEA_128_CBC_WITH_MD5                              = $02050080;
Const SSL2_CK_DES_64_CBC_WITH_MD5                                = $02060040;
Const SSL2_CK_DES_64_CBC_WITH_SHA                                = $02060140;{v3}
Const SSL2_CK_DES_192_EDE3_CBC_WITH_MD5                          = $020700c0;
Const SSL2_CK_DES_192_EDE3_CBC_WITH_SHA                          = $020701c0;{v3}
Const SSL2_CK_RC4_64_WITH_MD5                                    = $02080080;{MShack}

Const SSL2_CK_DES_64_CFB64_WITH_MD5_1                            = $02ff0800;{SSLeay}
Const SSL2_CK_NULL                                               = $02ff0810;{SSLeay}

Const SSL2_TXT_DES_64_CFB64_WITH_MD5_1                           = 'DES-CFB-M1';
Const SSL2_TXT_NULL_WITH_MD5                                     = 'NULL-MD5';
Const SSL2_TXT_RC4_128_WITH_MD5                                  = 'RC4-MD5';
Const SSL2_TXT_RC4_128_EXPORT40_WITH_MD5                         = 'EXP-RC4-MD5';
Const SSL2_TXT_RC2_128_CBC_WITH_MD5                              = 'RC2-CBC-MD5';
Const SSL2_TXT_RC2_128_CBC_EXPORT40_WITH_MD5                     = 'EXP-RC2-CBC-MD5';
Const SSL2_TXT_IDEA_128_CBC_WITH_MD5                             = 'IDEA-CBC-MD5';
Const SSL2_TXT_DES_64_CBC_WITH_MD5                               = 'DES-CBC-MD5';
Const SSL2_TXT_DES_64_CBC_WITH_SHA                               = 'DES-CBC-SHA';
Const SSL2_TXT_DES_192_EDE3_CBC_WITH_MD5                         = 'DES-CBC3-MD5';
Const SSL2_TXT_DES_192_EDE3_CBC_WITH_SHA                         = 'DES-CBC3-SHA';
Const SSL2_TXT_RC4_64_WITH_MD5                                   = 'RC4-64-MD5';

Const SSL2_TXT_NULL                                              = 'NULL';

{ Flags for the SSL_CIPHER.algorithm2 field }
Const SSL2_CF_5_BYTE_ENC                                         = $01;
Const SSL2_CF_8_BYTE_ENC                                         = $02;

{ Certificate Type Codes }
Const SSL2_CT_X509_CERTIFICATE                                   = $01;

{ Authentication Type Code }
Const SSL2_AT_MD5_WITH_RSA_ENCRYPTION                            = $01;

Const SSL2_MAX_SSL_SESSION_ID_LENGTH                             = 32;

{ Upper/Lower Bounds }
Const SSL2_MAX_MASTER_KEY_LENGTH_IN_BITS                         = 256;
Const SSL2_MAX_RECORD_LENGTH_2_BYTE_HEADER                       = 32767;
Const SSL2_MAX_RECORD_LENGTH_3_BYTE_HEADER                       = 16383{};

Const SSL2_CHALLENGE_LENGTH                                      = 16;
{Const SSL2_CHALLENGE_LENGTH                                     = 32}
Const SSL2_MIN_CHALLENGE_LENGTH                                  = 16;
Const SSL2_MAX_CHALLENGE_LENGTH                                  = 32;
Const SSL2_CONNECTION_ID_LENGTH                                  = 16;
Const SSL2_MAX_CONNECTION_ID_LENGTH                              = 16;
Const SSL2_SSL_SESSION_ID_LENGTH                                 = 16;
Const SSL2_MAX_CERT_CHALLENGE_LENGTH                             = 32;
Const SSL2_MIN_CERT_CHALLENGE_LENGTH                             = 16;
Const SSL2_MAX_KEY_MATERIAL_LENGTH                               = 24;

{ SSLv2 }
{ client }
Const SSL2_ST_SEND_CLIENT_HELLO_A                                = ($10 or SSL_ST_CONNECT);
Const SSL2_ST_SEND_CLIENT_HELLO_B                                = ($11 or SSL_ST_CONNECT);
Const SSL2_ST_GET_SERVER_HELLO_A                                 = ($20 or SSL_ST_CONNECT);
Const SSL2_ST_GET_SERVER_HELLO_B                                 = ($21 or SSL_ST_CONNECT);
Const SSL2_ST_SEND_CLIENT_MASTER_KEY_A                           = ($30 or SSL_ST_CONNECT);
Const SSL2_ST_SEND_CLIENT_MASTER_KEY_B                           = ($31 or SSL_ST_CONNECT);
Const SSL2_ST_SEND_CLIENT_FINISHED_A                             = ($40 or SSL_ST_CONNECT);
Const SSL2_ST_SEND_CLIENT_FINISHED_B                             = ($41 or SSL_ST_CONNECT);
Const SSL2_ST_SEND_CLIENT_CERTIFICATE_A                          = ($50 or SSL_ST_CONNECT);
Const SSL2_ST_SEND_CLIENT_CERTIFICATE_B                          = ($51 or SSL_ST_CONNECT);
Const SSL2_ST_SEND_CLIENT_CERTIFICATE_C                          = ($52 or SSL_ST_CONNECT);
Const SSL2_ST_SEND_CLIENT_CERTIFICATE_D                          = ($53 or SSL_ST_CONNECT);
Const SSL2_ST_GET_SERVER_VERIFY_A                                = ($60 or SSL_ST_CONNECT);
Const SSL2_ST_GET_SERVER_VERIFY_B                                = ($61 or SSL_ST_CONNECT);
Const SSL2_ST_GET_SERVER_FINISHED_A                              = ($70 or SSL_ST_CONNECT);
Const SSL2_ST_GET_SERVER_FINISHED_B                              = ($71 or SSL_ST_CONNECT);
Const SSL2_ST_CLIENT_START_ENCRYPTION                            = ($80 or SSL_ST_CONNECT);
Const SSL2_ST_X509_GET_CLIENT_CERTIFICATE                        = ($90 or SSL_ST_CONNECT);
{ server }
Const SSL2_ST_GET_CLIENT_HELLO_A                                 = ($10 or SSL_ST_ACCEPT);
Const SSL2_ST_GET_CLIENT_HELLO_B                                 = ($11 or SSL_ST_ACCEPT);
Const SSL2_ST_GET_CLIENT_HELLO_C                                 = ($12 or SSL_ST_ACCEPT);
Const SSL2_ST_SEND_SERVER_HELLO_A                                = ($20 or SSL_ST_ACCEPT);
Const SSL2_ST_SEND_SERVER_HELLO_B                                = ($21 or SSL_ST_ACCEPT);
Const SSL2_ST_GET_CLIENT_MASTER_KEY_A                            = ($30 or SSL_ST_ACCEPT);
Const SSL2_ST_GET_CLIENT_MASTER_KEY_B                            = ($31 or SSL_ST_ACCEPT);
Const SSL2_ST_SEND_SERVER_VERIFY_A                               = ($40 or SSL_ST_ACCEPT);
Const SSL2_ST_SEND_SERVER_VERIFY_B                               = ($41 or SSL_ST_ACCEPT);
Const SSL2_ST_SEND_SERVER_VERIFY_C                               = ($42 or SSL_ST_ACCEPT);
Const SSL2_ST_GET_CLIENT_FINISHED_A                              = ($50 or SSL_ST_ACCEPT);
Const SSL2_ST_GET_CLIENT_FINISHED_B                              = ($51 or SSL_ST_ACCEPT);
Const SSL2_ST_SEND_SERVER_FINISHED_A                             = ($60 or SSL_ST_ACCEPT);
Const SSL2_ST_SEND_SERVER_FINISHED_B                             = ($61 or SSL_ST_ACCEPT);
Const SSL2_ST_SEND_REQUEST_CERTIFICATE_A                         = ($70 or SSL_ST_ACCEPT);
Const SSL2_ST_SEND_REQUEST_CERTIFICATE_B                         = ($71 or SSL_ST_ACCEPT);
Const SSL2_ST_SEND_REQUEST_CERTIFICATE_C                         = ($72 or SSL_ST_ACCEPT);
Const SSL2_ST_SEND_REQUEST_CERTIFICATE_D                         = ($73 or SSL_ST_ACCEPT);
Const SSL2_ST_SERVER_START_ENCRYPTION                            = ($80 or SSL_ST_ACCEPT);
Const SSL2_ST_X509_GET_SERVER_CERTIFICATE                        = ($90 or SSL_ST_ACCEPT);

