2  * Copyright (c) 2002,2005-2007,2010-2012 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  * tls_ssl.h - Declarations of handshake layer callout struct to provide indirect calls to 
  26  *     SSLv3 and TLS routines.  
  38 #include "sslContext.h" 
  39 #include "sslRecord.h" 
  42  *** Each of {TLS, SSLv3} implements each of these functions. 
  45 typedef OSStatus (*generateKeyMaterialFcn
) ( 
  46         SSLBuffer key
,                                  // caller mallocs and specifies length of 
  47                                                                         //   required key material here 
  50 typedef OSStatus (*generateExportKeyAndIvFcn
) ( 
  51         SSLContext 
*ctx
,                                // clientRandom, serverRandom valid 
  52         const SSLBuffer clientWriteKey
, 
  53         const SSLBuffer serverWriteKey
, 
  54         SSLBuffer finalClientWriteKey
,  // RETURNED, mallocd by caller 
  55         SSLBuffer finalServerWriteKey
,  // RETURNED, mallocd by caller 
  56         SSLBuffer finalClientIV
,                // RETURNED, mallocd by caller 
  57         SSLBuffer finalServerIV
);               // RETURNED, mallocd by caller 
  60  * On entry: clientRandom, serverRandom, preMasterSecret valid 
  61  * On return: masterSecret valid 
  63 typedef OSStatus (*generateMasterSecretFcn
) ( 
  66 typedef OSStatus (*computeFinishedMacFcn
) ( 
  68         SSLBuffer finished
,             // output - mallocd by caller 
  71 typedef OSStatus (*computeCertVfyMacFcn
) ( 
  73     SSLBuffer 
*finished
,                // output - mallocd by caller 
  74     SSL_HashAlgorithm hash
);    //only used in TLS 1.2 
  77 typedef struct _SslTlsCallouts 
{ 
  78         generateKeyMaterialFcn          generateKeyMaterial
; 
  79         generateMasterSecretFcn         generateMasterSecret
; 
  80         computeFinishedMacFcn           computeFinishedMac
; 
  81         computeCertVfyMacFcn            computeCertVfyMac
; 
  85 /* From ssl3Callouts.c and tls1Callouts.c */ 
  86 extern const SslTlsCallouts     Ssl3Callouts
; 
  87 extern const SslTlsCallouts     Tls1Callouts
; 
  88 extern const SslTlsCallouts Tls12Callouts
; 
  94 #endif  /* _TLS_SSL_H_ */