2 * Copyright (c) 2000-2001 Apple Computer, Inc. All Rights Reserved.
4 * The contents of this file constitute Original Code as defined in and are
5 * subject to the Apple Public Source License Version 1.2 (the 'License').
6 * You may not use this file except in compliance with the License. Please obtain
7 * a copy of the License at http://www.apple.com/publicsource and read it before
10 * This Original Code and all software distributed under the License are
11 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS
12 * OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, INCLUDING WITHOUT
13 * LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
14 * PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. Please see the License for the
15 * specific language governing rights and limitations under the License.
22 Written by: Doug Mitchell, based on Netscape SSLRef 3.0
24 Copyright: (c) 1999 by Apple Computer, Inc., all rights reserved.
27 /* *********************************************************************
30 SSLRef 3.0 Final -- 11/19/96
32 Copyright (c)1996 by Netscape Communications Corp.
34 By retrieving this software you are bound by the licensing terms
35 disclosed in the file "LICENSE.txt". Please read it, and if you don't
36 accept the terms, delete this software.
38 SSLRef 3.0 was developed by Netscape Communications Corp. of Mountain
39 View, California <http://home.netscape.com/> and Consensus Development
40 Corporation of Berkeley, California <http://www.consensus.com/>.
42 *********************************************************************
44 File: ssl2.h SSL 2 functionality header
46 This file contains function prototypes and equate values for SSL2.
47 The relevant functions are contained in files whose names match
50 ****************************************************************** */
55 #ifndef _SECURE_TRANSPORT_H_
56 #include "SecureTransport.h"
69 ssl2_mt_client_hello
= 1,
70 ssl2_mt_client_master_key
= 2,
71 ssl2_mt_client_finished
= 3,
72 ssl2_mt_server_hello
= 4,
73 ssl2_mt_server_verify
= 5,
74 ssl2_mt_server_finished
= 6,
75 ssl2_mt_request_certificate
= 7,
76 ssl2_mt_client_certificate
= 8,
77 ssl2_mt_kickstart_handshake
= 99
81 { ssl2_pe_no_cipher
= 1,
82 ssl2_pe_no_certificate
= 2,
83 ssl2_pe_bad_certificate
= 4,
84 ssl2_pe_unsupported_certificate_type
= 6
88 { ssl2_ct_x509_certificate
= 1
91 #define SSL2_CONNECTION_ID_LENGTH 16
93 typedef SSLErr (*EncodeSSL2MessageFunc
)(SSLBuffer
*msg
, SSLContext
*ctx
);
94 SSLErr
SSL2ReadRecord(SSLRecord
*rec
, SSLContext
*ctx
);
95 SSLErr
SSL2WriteRecord(SSLRecord rec
, SSLContext
*ctx
);
96 SSLErr
SSL2ProcessMessage(SSLRecord rec
, SSLContext
*ctx
);
97 SSLErr
SSL2SendError(SSL2ErrorCode error
, SSLContext
*ctx
);
98 SSLErr
SSL2AdvanceHandshake(SSL2MessageType msg
, SSLContext
*ctx
);
99 SSLErr
SSL2PrepareAndQueueMessage(EncodeSSL2MessageFunc encodeFunc
, SSLContext
*ctx
);
100 SSLErr
SSL2CompareSessionIDs(SSLContext
*ctx
);
101 SSLErr
SSL2InstallSessionKey(SSLContext
*ctx
);
102 SSLErr
SSL2GenerateSessionID(SSLContext
*ctx
);
103 SSLErr
SSL2InitCiphers(SSLContext
*ctx
);
105 SSLErr
SSL2ProcessClientHello(SSLBuffer msgContents
, SSLContext
*ctx
);
106 SSLErr
SSL2EncodeClientHello(SSLBuffer
*msg
, SSLContext
*ctx
);
107 SSLErr
SSL2ProcessClientMasterKey(SSLBuffer msgContents
, SSLContext
*ctx
);
108 SSLErr
SSL2EncodeClientMasterKey(SSLBuffer
*msg
, SSLContext
*ctx
);
109 SSLErr
SSL2ProcessClientFinished(SSLBuffer msgContents
, SSLContext
*ctx
);
110 SSLErr
SSL2EncodeClientFinished(SSLBuffer
*msg
, SSLContext
*ctx
);
111 SSLErr
SSL2ProcessServerHello(SSLBuffer msgContents
, SSLContext
*ctx
);
112 SSLErr
SSL2EncodeServerHello(SSLBuffer
*msg
, SSLContext
*ctx
);
113 SSLErr
SSL2ProcessServerVerify(SSLBuffer msgContents
, SSLContext
*ctx
);
114 SSLErr
SSL2EncodeServerVerify(SSLBuffer
*msg
, SSLContext
*ctx
);
115 SSLErr
SSL2ProcessServerFinished(SSLBuffer msgContents
, SSLContext
*ctx
);
116 SSLErr
SSL2EncodeServerFinished(SSLBuffer
*msg
, SSLContext
*ctx
);