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
24 Copyright: (c) 1999 by Apple Computer, Inc., all rights reserved.
31 #include "SecureTransport.h"
33 #include "sslRecord.h"
41 SSL2_MsgClientHello
= 1,
42 SSL2_MsgClientMasterKey
= 2,
43 SSL2_MsgClientFinished
= 3,
44 SSL2_MsgServerHello
= 4,
45 SSL2_MsgServerVerify
= 5,
46 SSL2_MsgServerFinished
= 6,
47 SSL2_MsgRequestCert
= 7,
48 SSL2_MsgClientCert
= 8,
49 SSL2_MsgKickstart
= 99
56 SSL2_ErrUnsupportedCert
= 6
63 #define SSL2_CONNECTION_ID_LENGTH 16
65 typedef OSStatus (*EncodeSSL2MessageFunc
)(SSLBuffer
&msg
, SSLContext
*ctx
);
66 OSStatus
SSL2ReadRecord(SSLRecord
&rec
, SSLContext
*ctx
);
67 OSStatus
SSL2WriteRecord(SSLRecord
&rec
, SSLContext
*ctx
);
68 OSStatus
SSL2ProcessMessage(SSLRecord
&rec
, SSLContext
*ctx
);
69 OSStatus
SSL2SendError(SSL2ErrorCode error
, SSLContext
*ctx
);
70 OSStatus
SSL2AdvanceHandshake(SSL2MessageType msg
, SSLContext
*ctx
);
71 OSStatus
SSL2PrepareAndQueueMessage(EncodeSSL2MessageFunc encodeFunc
, SSLContext
*ctx
);
72 OSStatus
SSL2CompareSessionIDs(SSLContext
*ctx
);
73 OSStatus
SSL2InstallSessionKey(SSLContext
*ctx
);
74 OSStatus
SSL2GenerateSessionID(SSLContext
*ctx
);
75 OSStatus
SSL2InitCiphers(SSLContext
*ctx
);
77 OSStatus
SSL2ProcessClientHello(SSLBuffer msgContents
, SSLContext
*ctx
);
78 OSStatus
SSL2EncodeClientHello(SSLBuffer
&msg
, SSLContext
*ctx
);
79 OSStatus
SSL2ProcessClientMasterKey(SSLBuffer msgContents
, SSLContext
*ctx
);
80 OSStatus
SSL2EncodeClientMasterKey(SSLBuffer
&msg
, SSLContext
*ctx
);
81 OSStatus
SSL2ProcessClientFinished(SSLBuffer msgContents
, SSLContext
*ctx
);
82 OSStatus
SSL2EncodeClientFinished(SSLBuffer
&msg
, SSLContext
*ctx
);
83 OSStatus
SSL2ProcessServerHello(SSLBuffer msgContents
, SSLContext
*ctx
);
84 OSStatus
SSL2EncodeServerHello(SSLBuffer
&msg
, SSLContext
*ctx
);
85 OSStatus
SSL2ProcessServerVerify(SSLBuffer msgContents
, SSLContext
*ctx
);
86 OSStatus
SSL2EncodeServerVerify(SSLBuffer
&msg
, SSLContext
*ctx
);
87 OSStatus
SSL2ProcessServerFinished(SSLBuffer msgContents
, SSLContext
*ctx
);
88 OSStatus
SSL2EncodeServerFinished(SSLBuffer
&msg
, SSLContext
*ctx
);