]> git.saurik.com Git - apple/security.git/blob - SecureTransport/privateInc/sslAlertMessage.h
Security-179.tar.gz
[apple/security.git] / SecureTransport / privateInc / sslAlertMessage.h
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: sslAlertMessage.h
21 ****************************************************************** */
22
23 #ifndef _SSLALERTMESSAGE_H_
24 #define _SSLALERTMESSAGE_H_ 1
25
26 #ifndef _SECURE_TRANSPORT_H_
27 #include "SecureTransport.h"
28 #endif
29
30 #include "sslPriv.h"
31 #include "sslRecord.h"
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37 typedef enum
38 { SSL_AlertLevelWarning = 1,
39 SSL_AlertLevelFatal = 2
40 } AlertLevel;
41
42 typedef enum
43 { SSL_AlertCloseNotify = 0,
44 SSL_AlertUnexpectedMsg = 10,
45 SSL_AlertBadRecordMac = 20,
46 SSL_AlertDecryptionFail = 21, /* TLS */
47 SSL_AlertRecordOverflow = 22, /* TLS */
48 SSL_AlertDecompressFail = 30,
49 SSL_AlertHandshakeFail = 40,
50 SSL_AlertNoCert = 41,
51 SSL_AlertBadCert = 42, /* SSLv3 only */
52 SSL_AlertUnsupportedCert = 43,
53 SSL_AlertCertRevoked = 44,
54 SSL_AlertCertExpired = 45,
55 SSL_AlertCertUnknown = 46,
56 SSL_AlertIllegalParam = 47,
57 /* remainder are TLS addenda */
58 SSL_AlertUnknownCA = 48,
59 SSL_AlertAccessDenied = 49,
60 SSL_AlertDecodeError = 50,
61 SSL_AlertDecryptError = 51,
62 SSL_AlertExportRestriction = 60,
63 SSL_AlertProtocolVersion = 70,
64 SSL_AlertInsufficientSecurity = 71,
65 SSL_AlertInternalError = 80,
66 SSL_AlertUserCancelled = 90,
67 SSL_AlertNoRenegotiation = 100
68 } AlertDescription;
69
70 OSStatus SSLProcessAlert(
71 SSLRecord rec,
72 SSLContext *ctx);
73 OSStatus SSLSendAlert(
74 AlertLevel level,
75 AlertDescription desc,
76 SSLContext *ctx);
77 OSStatus SSLFatalSessionAlert(
78 AlertDescription desc,
79 SSLContext *ctx);
80
81 #ifdef __cplusplus
82 }
83 #endif
84
85 #endif /* _SSLALERTMESSAGE_H_ */