]> git.saurik.com Git - apple/security.git/blob - SecureTransport/privateInc/sslUtils.h
Security-163.tar.gz
[apple/security.git] / SecureTransport / privateInc / sslUtils.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: sslUtils.h
21 ************************************************************/
22
23 #ifndef _SSLUTILS_H_
24 #define _SSLUTILS_H_ 1
25
26 #include "SecureTransport.h"
27 #include "sslPriv.h"
28
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32
33 UInt32 SSLDecodeInt(
34 const unsigned char *p,
35 int length);
36 unsigned char *SSLEncodeInt(
37 unsigned char *p,
38 UInt32 value,
39 int length);
40 UInt8* SSLEncodeUInt64(
41 UInt8 *p,
42 sslUint64 value);
43 void IncrementUInt64(
44 sslUint64 *v);
45
46 UInt32 SSLGetCertificateChainLength(
47 const SSLCertificate *c);
48 Boolean sslIsSessionActive(
49 const SSLContext *ctx);
50 OSStatus sslDeleteCertificateChain(
51 SSLCertificate *certs,
52 SSLContext *ctx);
53
54 OSStatus sslTime(
55 UInt32 *tim);
56
57 #if SSL_DEBUG
58 extern const char *protocolVersStr(
59 SSLProtocolVersion prot);
60 #endif
61
62 /*
63 * Redirect SSLBuffer-based I/O call to user-supplied I/O.
64 */
65 OSStatus sslIoRead(
66 SSLBuffer buf,
67 UInt32 *actualLength,
68 SSLContext *ctx);
69
70 OSStatus sslIoWrite(
71 SSLBuffer buf,
72 UInt32 *actualLength,
73 SSLContext *ctx);
74
75 /*
76 * Common RNG function.
77 */
78 OSStatus sslRand(
79 SSLContext *ctx,
80 SSLBuffer *buf);
81
82 OSStatus sslVerifyProtVersion(
83 SSLContext *ctx,
84 SSLProtocolVersion peerVersion,
85 SSLProtocolVersion *negVersion);
86
87 OSStatus sslGetMaxProtVersion(
88 SSLContext *ctx,
89 SSLProtocolVersion *version); // RETURNED
90
91 #define SET_SSL_BUFFER(buf, d, l) do { (buf).data = (d); (buf).length = (l); } while (0)
92
93 #ifdef __cplusplus
94 }
95 #endif
96
97 #endif