]>
git.saurik.com Git - apple/security.git/blob - OSX/libsecurity_ssl/lib/sslDebug.h
2 * Copyright (c) 2000-2001,2005-2007,2010-2012,2014 Apple Inc. All Rights Reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
21 * @APPLE_LICENSE_HEADER_END@
25 * sslDebug.h - Debugging macros.
32 /* TODO: support secdebug in the kernel */
33 #define secdebug(x...)
35 #include <utilities/debugging.h>
39 #include <AssertMacros.h>
43 #define ssl_secdebug secdebug
47 /* log changes in handshake state */
48 #define sslHdskStateDebug(args...) ssl_secdebug("sslHdskState", ## args)
50 /* log handshake and alert messages */
51 #define sslHdskMsgDebug(args...) ssl_secdebug("sslHdskMsg", ## args)
53 /* log negotiated handshake parameters */
54 #define sslLogNegotiateDebug(args...) ssl_secdebug("sslLogNegotiate", ## args)
56 /* log received protocol messsages */
57 #define sslLogRxProtocolDebug(msgType) ssl_secdebug("sslLogRxProtocol", \
58 "---received protoMsg %s", msgType)
60 /* log resumable session info */
61 #define sslLogResumSessDebug(args...) ssl_secdebug("sslResumSession", ## args)
63 /* log low-level session info in appleSession.c */
64 #define sslLogSessCacheDebug(args...) ssl_secdebug("sslSessionCache", ## args)
66 /* log record-level I/O (SSLRead, SSLWrite) */
67 #define sslLogRecordIo(args...) ssl_secdebug("sslRecordIo", ## args)
69 /* cert-related info */
70 #define sslCertDebug(args...) ssl_secdebug("sslCert", ## args)
73 #define sslDhDebug(args...) ssl_secdebug("sslDh", ## args)
75 /* EAP-FAST PAC-based session resumption */
76 #define sslEapDebug(args...) ssl_secdebug("sslEap", ## args)
79 #define sslEcdsaDebug(args...) ssl_secdebug("sslEcdsa", ## args)
83 /* deployment build */
84 #define sslHdskStateDebug(args...)
85 #define sslHdskMsgDebug(args...)
86 #define sslLogNegotiateDebug(args...)
87 #define sslLogRxProtocolDebug(msgType)
88 #define sslLogResumSessDebug(args...)
89 #define sslLogSessCacheDebug(args...)
90 #define sslLogRecordIo(args...)
91 #define sslCertDebug(args...)
92 #define sslDhDebug(args...)
93 #define sslEapDebug(args...)
94 #define sslEcdsaDebug(args...)
101 /* all errors logged to stdout for DEBUG config only */
102 #define sslErrorLog(args...)
103 #define sslDebugLog(args...)
104 #define sslDump(d, l)
108 extern void SSLDump(const unsigned char *data
, unsigned long len
);
110 /* extra debug logging of non-error conditions, if SSL_DEBUG is defined */
112 //#define sslDebugLog(args...) printf(args)
113 #define sslDebugLog(args...) ssl_secdebug("sslDebug", ## args)
115 #define sslDebugLog(args...)
117 /* all errors logged to stdout for DEBUG config only */
118 //#define sslErrorLog(args...) printf(args)
119 #define sslErrorLog(args...) ssl_secdebug("sslError", ## args)
120 #define sslDump(d, l) SSLDump((d), (l))
128 #define ASSERT(s) check(s)
131 #endif /* _SSL_DEBUG_H_ */