#ifndef _SSL2_H_
#define _SSL2_H_
#ifndef _SECURE_TRANSPORT_H_
#include "SecureTransport.h"
#endif
#ifndef _SSL_PRIV_H_
#include "sslPriv.h"
#endif
#ifndef _SSLREC_H_
#include "sslrec.h"
#endif
typedef enum
{ ssl2_mt_error = 0,
ssl2_mt_client_hello = 1,
ssl2_mt_client_master_key = 2,
ssl2_mt_client_finished = 3,
ssl2_mt_server_hello = 4,
ssl2_mt_server_verify = 5,
ssl2_mt_server_finished = 6,
ssl2_mt_request_certificate = 7,
ssl2_mt_client_certificate = 8,
ssl2_mt_kickstart_handshake = 99
} SSL2MessageType;
typedef enum
{ ssl2_pe_no_cipher = 1,
ssl2_pe_no_certificate = 2,
ssl2_pe_bad_certificate = 4,
ssl2_pe_unsupported_certificate_type = 6
} SSL2ErrorCode;
typedef enum
{ ssl2_ct_x509_certificate = 1
} SSL2CertTypeCode;
#define SSL2_CONNECTION_ID_LENGTH 16
typedef SSLErr (*EncodeSSL2MessageFunc)(SSLBuffer *msg, SSLContext *ctx);
SSLErr SSL2ReadRecord(SSLRecord *rec, SSLContext *ctx);
SSLErr SSL2WriteRecord(SSLRecord rec, SSLContext *ctx);
SSLErr SSL2ProcessMessage(SSLRecord rec, SSLContext *ctx);
SSLErr SSL2SendError(SSL2ErrorCode error, SSLContext *ctx);
SSLErr SSL2AdvanceHandshake(SSL2MessageType msg, SSLContext *ctx);
SSLErr SSL2PrepareAndQueueMessage(EncodeSSL2MessageFunc encodeFunc, SSLContext *ctx);
SSLErr SSL2CompareSessionIDs(SSLContext *ctx);
SSLErr SSL2InstallSessionKey(SSLContext *ctx);
SSLErr SSL2GenerateSessionID(SSLContext *ctx);
SSLErr SSL2InitCiphers(SSLContext *ctx);
SSLErr SSL2ProcessClientHello(SSLBuffer msgContents, SSLContext *ctx);
SSLErr SSL2EncodeClientHello(SSLBuffer *msg, SSLContext *ctx);
SSLErr SSL2ProcessClientMasterKey(SSLBuffer msgContents, SSLContext *ctx);
SSLErr SSL2EncodeClientMasterKey(SSLBuffer *msg, SSLContext *ctx);
SSLErr SSL2ProcessClientFinished(SSLBuffer msgContents, SSLContext *ctx);
SSLErr SSL2EncodeClientFinished(SSLBuffer *msg, SSLContext *ctx);
SSLErr SSL2ProcessServerHello(SSLBuffer msgContents, SSLContext *ctx);
SSLErr SSL2EncodeServerHello(SSLBuffer *msg, SSLContext *ctx);
SSLErr SSL2ProcessServerVerify(SSLBuffer msgContents, SSLContext *ctx);
SSLErr SSL2EncodeServerVerify(SSLBuffer *msg, SSLContext *ctx);
SSLErr SSL2ProcessServerFinished(SSLBuffer msgContents, SSLContext *ctx);
SSLErr SSL2EncodeServerFinished(SSLBuffer *msg, SSLContext *ctx);
#endif