]>
git.saurik.com Git - apple/security.git/blob - SecureTransport/privateInc/SecureTransportPriv.h
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.
20 File: SecureTransportPriv.h
22 Contains: Apple-private exported routines
24 Copyright: (c) 1999 by Apple Computer, Inc., all rights reserved.
28 #ifndef _SECURE_TRANSPORT_PRIV_H_
29 #define _SECURE_TRANSPORT_PRIV_H_ 1
31 #include <Security/SecureTransport.h>
33 #include <Security/Security.h>
39 /* The size of of client- and server-generated random numbers in hello messages. */
40 #define SSL_CLIENT_SRVR_RAND_SIZE 32
42 /* The size of the pre-master and master secrets. */
43 #define SSL_RSA_PREMASTER_SECRET_SIZE 48
44 #define SSL_MASTER_SECRET_SIZE 48
47 * For the following three functions, *size is the available
48 * buffer size on entry and the actual size of the data returned
49 * on return. The above consts are for convenience.
51 OSStatus
SSLInternalMasterSecret(
52 SSLContextRef context
,
53 void *secret
, // mallocd by caller, SSL_MASTER_SECRET_SIZE
54 size_t *secretSize
); // in/out
56 OSStatus
SSLInternalServerRandom(
57 SSLContextRef context
,
58 void *rand
, // mallocd by caller, SSL_CLIENT_SRVR_RAND_SIZE
59 size_t *randSize
); // in/out
61 OSStatus
SSLInternalClientRandom(
62 SSLContextRef context
,
63 void *rand
, // mallocd by caller, SSL_CLIENT_SRVR_RAND_SIZE
64 size_t *randSize
); // in/out
66 OSStatus
SSLInternal_PRF(
67 SSLContextRef context
,
74 void *out
, // mallocd by caller, length >= outLen
78 * Obtain a SecTrustRef representing peer certificates. Valid anytime,
79 * subsequent to a handshake attempt. The returned SecTrustRef is valid
80 * only as long as the SSLContextRef is.
83 SSLGetPeerSecTrust (SSLContextRef context
,
84 SecTrustRef
*secTrust
); /* RETURNED */
87 * Obtain resumable session info. Can be called anytime subsequent to
90 * if sessionWasResumed is True on return, the session is indeed a
91 * resumed session; the sessionID (an opaque blob generated by the
92 * server) is returned in *sessionID. The length of the sessionID
93 * is returned in *sessionIDLength. Caller must allocate the
94 * sessionID buffer; it max size is MAX_SESSION_ID_LENGTH bytes.
96 #define MAX_SESSION_ID_LENGTH 32
99 SSLGetResumableSessionInfo (
100 SSLContextRef context
,
101 Boolean
*sessionWasResumed
, // RETURNED
102 void *sessionID
, // RETURNED, mallocd by caller
103 size_t *sessionIDLength
); // IN/OUT
109 #endif /* _SECURE_TRANSPORT_PRIV_H_ */