]> git.saurik.com Git - apple/security.git/blame - SecureTransport/privateInc/ssl2.h
Security-54.tar.gz
[apple/security.git] / SecureTransport / privateInc / ssl2.h
CommitLineData
bac41a7b
A
1/*
2 * Copyright (c) 2000-2001 Apple Computer, Inc. All Rights Reserved.
3 *
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
8 * using this file.
9 *
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.
16 */
17
18
19/*
20 File: ssl2.h
21
22 Written by: Doug Mitchell, based on Netscape SSLRef 3.0
23
24 Copyright: (c) 1999 by Apple Computer, Inc., all rights reserved.
25
26*/
27/* *********************************************************************
28 File: ssl2.h
29
30 SSLRef 3.0 Final -- 11/19/96
31
32 Copyright (c)1996 by Netscape Communications Corp.
33
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.
37
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/>.
41
42 *********************************************************************
43
44 File: ssl2.h SSL 2 functionality header
45
46 This file contains function prototypes and equate values for SSL2.
47 The relevant functions are contained in files whose names match
48 ssl2*.c
49
50 ****************************************************************** */
51
52#ifndef _SSL2_H_
53#define _SSL2_H_
54
55#ifndef _SECURE_TRANSPORT_H_
56#include "SecureTransport.h"
57#endif
58
59#ifndef _SSL_PRIV_H_
60#include "sslPriv.h"
61#endif
62
63#ifndef _SSLREC_H_
64#include "sslrec.h"
65#endif
66
67typedef enum
68{ ssl2_mt_error = 0,
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
78} SSL2MessageType;
79
80typedef enum
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
85} SSL2ErrorCode;
86
87typedef enum
88{ ssl2_ct_x509_certificate = 1
89} SSL2CertTypeCode;
90
91#define SSL2_CONNECTION_ID_LENGTH 16
92
93typedef SSLErr (*EncodeSSL2MessageFunc)(SSLBuffer *msg, SSLContext *ctx);
94SSLErr SSL2ReadRecord(SSLRecord *rec, SSLContext *ctx);
95SSLErr SSL2WriteRecord(SSLRecord rec, SSLContext *ctx);
96SSLErr SSL2ProcessMessage(SSLRecord rec, SSLContext *ctx);
97SSLErr SSL2SendError(SSL2ErrorCode error, SSLContext *ctx);
98SSLErr SSL2AdvanceHandshake(SSL2MessageType msg, SSLContext *ctx);
99SSLErr SSL2PrepareAndQueueMessage(EncodeSSL2MessageFunc encodeFunc, SSLContext *ctx);
100SSLErr SSL2CompareSessionIDs(SSLContext *ctx);
101SSLErr SSL2InstallSessionKey(SSLContext *ctx);
102SSLErr SSL2GenerateSessionID(SSLContext *ctx);
103SSLErr SSL2InitCiphers(SSLContext *ctx);
104
105SSLErr SSL2ProcessClientHello(SSLBuffer msgContents, SSLContext *ctx);
106SSLErr SSL2EncodeClientHello(SSLBuffer *msg, SSLContext *ctx);
107SSLErr SSL2ProcessClientMasterKey(SSLBuffer msgContents, SSLContext *ctx);
108SSLErr SSL2EncodeClientMasterKey(SSLBuffer *msg, SSLContext *ctx);
109SSLErr SSL2ProcessClientFinished(SSLBuffer msgContents, SSLContext *ctx);
110SSLErr SSL2EncodeClientFinished(SSLBuffer *msg, SSLContext *ctx);
111SSLErr SSL2ProcessServerHello(SSLBuffer msgContents, SSLContext *ctx);
112SSLErr SSL2EncodeServerHello(SSLBuffer *msg, SSLContext *ctx);
113SSLErr SSL2ProcessServerVerify(SSLBuffer msgContents, SSLContext *ctx);
114SSLErr SSL2EncodeServerVerify(SSLBuffer *msg, SSLContext *ctx);
115SSLErr SSL2ProcessServerFinished(SSLBuffer msgContents, SSLContext *ctx);
116SSLErr SSL2EncodeServerFinished(SSLBuffer *msg, SSLContext *ctx);
117
118#endif